結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2018-11-24 13:19:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
OLE
|
実行時間 | - |
コード長 | 842 bytes |
コンパイル時間 | 605 ms |
コンパイル使用メモリ | 67,228 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-24 19:11:44 |
合計ジャッジ時間 | 99,249 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 3 |
other | AC * 1 WA * 9 OLE * 16 |
ソースコード
#include <iostream> #include <vector> #include <map> #include <cmath> using i64 = long long; int main() { i64 n = 0; std::cin >> n; bool flag = false; const i64 max = 100000000000000; const i64 goal = i64(std::sqrt(n)); int counter = 0; for( i64 i = 2; i <= goal; ++i){ std::cout << i << std::endl; if(n%i==0) { ++counter; if(counter>=3) { flag = true; break; } std::cout << "i: " << i << std::endl; n /= i; i = 1; std::cout << n << std::endl; } } if(n!=1) ++counter; if(counter>=3) flag=true; if(flag==false) std::cout << "NO" << std::endl; else std::cout << "YES" << std::endl; return 0; }