結果
問題 |
No.308 素数は通れません
|
ユーザー |
![]() |
提出日時 | 2015-12-01 04:22:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 803 bytes |
コンパイル時間 | 773 ms |
コンパイル使用メモリ | 85,408 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-14 06:30:40 |
合計ジャッジ時間 | 3,378 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 99 WA * 8 |
ソースコード
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<queue> #include<deque> #include<algorithm> #include<utility> #include<complex> #include<functional> #include<cassert> #include<set> #include<stack> using namespace std; typedef long long ll; void solve(){ ll n; cin >> n; if(n==4) cout << 3 <<endl; else if(n==6) cout << 5 <<endl; else if(n==8||n==9||n==10||n==15||n==16||n==22) cout << 7 <<endl; else if(n==12) cout << 11 <<endl; else if(n==14||n==15) cout << 13 <<endl; else if(n==20||n==21) cout << 19 <<endl; else if(n==24||n==25) cout << 23 <<endl; else if(n%8==1&&(n%5==0||n==sqrt(n)*sqrt(n))) cout << 14 <<endl; else cout << 8 <<endl; } int main(){ solve(); return 0; }