結果

問題 No.889 素数!
ユーザー KKT89KKT89
提出日時 2019-09-26 08:09:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 676 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 69,428 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-23 07:39:58
合計ジャッジ時間 2,414 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 56 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;

bool isprime(int n){
    if(n<=1)return false;
    for(int i=2;i*i<=n;i++){
        if(n%i==0)return false;
    }
    return true;
}

int main(){
    int n; cin >> n;
    if(isprime(n)){
        cout << "Sosu!" << endl;
        return 0;
    }
    if(n==6||n==28){
        cout << "Kanzensu!" << endl;
        return 0;
    }
    for(int i=2;i<8;i++){
        if(i*i==n){
            cout << "Heihousu!" << endl;
            return 0;
        }
        if(i*i*i==n){
            cout << "Ripposu!" << endl;
            return 0;
        }
    }
    cout << n << endl;
}
0