結果
| 問題 |
No.889 素数!
|
| コンテスト | |
| ユーザー |
momotaro1303
|
| 提出日時 | 2019-09-23 22:33:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 576 bytes |
| コンパイル時間 | 1,762 ms |
| コンパイル使用メモリ | 166,600 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 04:42:34 |
| 合計ジャッジ時間 | 2,921 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 59 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int N;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
cin>>N;
for(int i=2; i<=N; i++){
if(i*i==N){
cout<<"Heihosu!"<<endl;
return 0;
}
if(i*i*i==N){
cout<<"Ripposu!"<<endl;
return 0;
}
}
int s=0;
bool f=false;
for(int i=1; i<=sqrt(N); i++){
if(N%i==0){
s+=i;
if(i!=(N/i)) s+=(N/i);
if(i>1&&i<N) f=true;
if((N/i)>1&&(N/i)<N) f=true;
}
}
s-=N;
if(s==N){
cout<<"Kanzensu!"<<endl;
return 0;
}
if(!f){
cout<<"Sosu!"<<endl;
return 0;
}
cout<<N<<endl;
}
momotaro1303