結果
問題 | No.36 素数が嫌い! |
ユーザー |
|
提出日時 | 2015-05-30 22:12:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 338 bytes |
コンパイル時間 | 532 ms |
コンパイル使用メモリ | 59,752 KB |
実行使用メモリ | 10,012 KB |
最終ジャッジ日時 | 2024-07-06 12:47:50 |
合計ジャッジ時間 | 11,931 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 2 WA * 9 OLE * 2 -- * 13 |
ソースコード
#include <iostream> #include <math.h> #define ULL unsigned long long using namespace std; int main(){ ULL n; bool ans = true; cin >> n; if(n != 1){ for(ULL i=2; i<sqrt(n); i++){ cout << "i : " << i << "\tn % i = " << n%i << endl; if(n % i == 0){ ans = false; break; } } } cout << (ans ? "NO" : "YES") << endl; }