用户输出
1452159764
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#21409 | #1072. zzy与飞行棋 | Wrong Answer | 18 | 65 ms | 3104 K | C++ 17 / 817 B | 自动化82-郭筠陶 | 2020-02-06 17:27:14 |
#include <bits/stdc++.h>
using namespace std;
const int max_ = 4e5 + 10;
vector<int> phi(max_, 0);
vector<int> primes;
void getPhi();
int main() {
int n;
cin >> n;
getPhi();
int ans = 0;
for (int i = 1; i <= n; ++i) {
ans += phi.at(i);
}
cout << ans * 6;
return 0;
}
void getPhi() {
phi.at(1) = 1;
for (int i = 2; i < max_; i++) {
if (phi.at(i) == 0) {
primes.push_back(i);
phi.at(i) = i - 1;
}
for (int j = 0; j < primes.size() && primes.at(j) * i < max_; ++i) {
int prime = primes.at(j);
if (i % prime == 0) {
phi.at(i * prime) = phi.at(i) * prime;
break;
} else {
phi.at(i * prime) = phi.at(i) * (prime - 1);
}
}
}
}
用户输出
1452159764
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-1626274948
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-1065653540
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-58257232
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-1219195136
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
599807300
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
541844096
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
354220800
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-1107995120
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0