結果
問題 | No.106 素数が嫌い!2 |
ユーザー | Yugimn |
提出日時 | 2022-05-11 03:29:02 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 84 ms / 5,000 ms |
コード長 | 620 bytes |
コンパイル時間 | 2,060 ms |
コンパイル使用メモリ | 187,960 KB |
実行使用メモリ | 81,132 KB |
最終ジャッジ日時 | 2023-09-25 12:50:10 |
合計ジャッジ時間 | 3,961 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 44 ms
80,964 KB |
testcase_01 | AC | 22 ms
80,988 KB |
testcase_02 | AC | 21 ms
81,132 KB |
testcase_03 | AC | 23 ms
80,940 KB |
testcase_04 | AC | 44 ms
81,048 KB |
testcase_05 | AC | 77 ms
80,952 KB |
testcase_06 | AC | 77 ms
80,812 KB |
testcase_07 | AC | 84 ms
80,936 KB |
testcase_08 | AC | 24 ms
80,808 KB |
testcase_09 | AC | 24 ms
80,912 KB |
testcase_10 | AC | 77 ms
80,816 KB |
testcase_11 | AC | 39 ms
81,008 KB |
testcase_12 | AC | 72 ms
80,808 KB |
testcase_13 | AC | 22 ms
80,808 KB |
testcase_14 | AC | 22 ms
80,964 KB |
testcase_15 | AC | 22 ms
80,932 KB |
コンパイルメッセージ
main.cpp:9:12: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ 9 | void print(auto a){ | ^~~~ main.cpp:13:13: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ 13 | void prints(auto a){ | ^~~~ main.cpp:21:13: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ 21 | void printl(auto a){ | ^~~~ 関数 ‘void printl(auto:3) [with auto:3 = int]’ 内, inlined from ‘int main()’ at main.cpp:45:9: main.cpp:22:8: 警告: ‘A’ may be used uninitialized [-Wmaybe-uninitialized] 22 | cout << a << endl; | ~~~~~^~~~ main.cpp: 関数 ‘int main()’ 内: main.cpp:35:7: 備考: ‘A’ はここで定義されています 35 | int A, N, K, I, J; cin >> N >> K; | ^
ソースコード
//Normal #define _GLIBCXX_DEBUG #define ll long long #include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; void print(auto a){ cout << a; } void prints(auto a){ cout << a << " "; } void prints(){ cout << " "; } void printl(auto a){ cout << a << endl; } void printl(){ cout << endl; } void fix(int n){ cout << fixed << setprecision(n); } int main(){ vector<ll> X(1e7, 0); int A, N, K, I, J; cin >> N >> K; for(I = 2; I <= N; I++, A += K <= X[I] + !X[I]){ if(!X[I]){ for(J = I; J <= N; J += I){ X[J]++; } } } printl(A); return 0; }