用户输出
67326849456
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#10631 | #1072. zzy与飞行棋 | Accepted | 100 | 95 ms | 1812 K | C++ 11 / 487 B | Crux | 2019-07-04 15:14:23 |
#include "stdio.h"
long long foo(int n) {
if (n == 1)
return 6;
long long res = 0;
auto* cnt = new int[n + 1];
for (int i = 0; i <= n; ++i) cnt[i] = i / 2;
for (int i = 2; i <= n; ++i) {
for (int j = i + i; j <= n; j += i) cnt[j] -= cnt[i];
}
for (int i = 2; i <= n; ++i) res += cnt[i];
return res * 12;
}
int main() {
int n;
scanf("%d", &n);
printf("%lld", foo(n));
return 0;
}