結果
問題 |
No.458 異なる素数の和
|
ユーザー |
![]() |
提出日時 | 2018-11-30 14:48:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 391 bytes |
コンパイル時間 | 406 ms |
コンパイル使用メモリ | 59,008 KB |
実行使用メモリ | 16,832 KB |
最終ジャッジ日時 | 2024-06-26 23:39:27 |
合計ジャッジ時間 | 6,838 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 27 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:26:18: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized] 26 | std::cout << ans << std::endl; | ^~~
ソースコード
#include <iostream> #include <list> int main() { int n; std::cin >> n; std::list<int> l; for(int i = 0; i < n; i++) { l.push_back(i); } int ans; while(!l.empty()) { ans = l.front(); for(int i = 1; (ans * i) < n; i++) { l.remove(ans * i); } } std::cout << ans << std::endl; }