結果

問題 No.889 素数!
ユーザー keisuke6keisuke6
提出日時 2022-05-27 20:53:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 1,644 ms
コンパイル使用メモリ 167,616 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-20 15:23:39
合計ジャッジ時間 3,606 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 59 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
bool rippo(int N){
    for(int i=0;i*i*i<=N;i++)if(i*i*i==N) return true;
    return false;
}
bool heiho(int N){
    for(int i=0;i*i<=N;i++)if(i*i==N) return true;
    return false;
}
bool sosu(int N){
    for(int i=2;i*i<=N;i++)if(N%i == 0) return false;
    return true;
}
signed main(){
    int N;
    cin>>N;
    if(N == 6 || N == 28) cout<<"Kanzensu!"<<endl;
    else if(rippo(N)) cout<<"Ripposu!"<<endl;
    else if(heiho(N)) cout<<"Heihosu!"<<endl;
    else if(sosu(N)) cout<<"Sosu!"<<endl;
    else cout<<N<<endl;
}
0