結果
問題 | No.889 素数! |
ユーザー |
![]() |
提出日時 | 2020-01-22 03:15:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 426 bytes |
コンパイル時間 | 1,563 ms |
コンパイル使用メモリ | 167,996 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 23:01:02 |
合計ジャッジ時間 | 3,347 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n; cin>>n; ll a=-1; ll b=0; ll c=0; ll d=0; for(ll i=1;i<n;++i){ if(n%i==0){++a;d+=i;} if(i*i==n)++b; if(i*i*i==n)++c; } if(a==0&&n!=1){cout<<"Sosu!"<<endl;} else if(d==n&&d!=0){cout<<"Kanzensu!"<<endl;} else if(c>0){cout<<"Ripposu!"<<endl;} else if(b>0){cout<<"Heihosu!"<<endl;} else{cout<<n<<endl;} }