結果
| 問題 |
No.889 素数!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-21 15:40:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 697 bytes |
| コンパイル時間 | 1,218 ms |
| コンパイル使用メモリ | 159,472 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-19 00:03:01 |
| 合計ジャッジ時間 | 2,836 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 57 WA * 4 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int n = 0;
cin >> n;
bool sosuflag = true;
bool hehoflag = false;
bool rippoflag = false;
int sum = 0;
for (int i = 2; i <= sqrt(n); i++){
if(n % i == 0){
sosuflag = false;
sum += i;
if(i*i == n){
hehoflag = true;
}else if(i*i*i == n){
rippoflag = true;
}
}
}
if(sosuflag){
cout << "Sosu!";
}else if(hehoflag){
cout << "Heihosu!";
}else if(rippoflag){
cout << "Ripposu!";
}else if(sum == n){
cout << "Kanzesu!";
}else{
cout << n;
}
}