結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2018-11-24 12:46:08 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 621 bytes |
コンパイル時間 | 910 ms |
コンパイル使用メモリ | 91,344 KB |
最終ジャッジ日時 | 2025-01-06 17:36:02 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 9 |
ソースコード
#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 auto goal = std::sqrt(n); int counter = 0; for( int i = 2; i <= goal; ++i){ if(n%i==0) { ++counter; if(counter>=3) { flag = true; break; } n /= i; } } if(flag==false) std::cout << "NO" << std::endl; else std::cout << "YES" << std::endl; return 0; }