結果
| 問題 | 
                            No.889 素数!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             momotaro1303
                         | 
                    
| 提出日時 | 2019-09-23 22:42:33 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 608 bytes | 
| コンパイル時間 | 1,468 ms | 
| コンパイル使用メモリ | 167,192 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-19 04:43:12 | 
| 合計ジャッジ時間 | 2,976 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 60 WA * 1 | 
ソースコード
#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){
	if(N!=0){
		cout<<"Kanzensu!"<<endl;
		return 0;
	}
}
if(!f){
	if(N!=0){
		cout<<"Sosu!"<<endl;
		return 0;
	}
}
cout<<N<<endl;
}
            
            
            
        
            
momotaro1303