結果
問題 | No.889 素数! |
ユーザー | tekihei2317 |
提出日時 | 2019-09-20 21:32:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 612 bytes |
コンパイル時間 | 1,723 ms |
コンパイル使用メモリ | 166,164 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 16:32:00 |
合計ジャッジ時間 | 3,237 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include<bits/stdc++.h> #define int long long using namespace std; bool isPrime(int N) { if(N<2) return false; for(int i=2;i*i<=N;i++){ if(N%i==0) return false; } return true; } signed main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin>>N; if(isPrime(N)){ cout<<"Sosu!"<<endl; }else if(N==4 or N==9 or N==16 or N==25 or N==36 or N==49){ cout<<"Heihosu!"<<endl; }else if(N==8 or N==27){ cout<<"Ripposu!"<<endl; }else if(N==6 or N==28){ cout<<"Kanzensu!"<<endl; }else{ cout<<N<<endl; } return 0; }