結果
| 問題 | 
                            No.889 素数!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mine691
                         | 
                    
| 提出日時 | 2019-09-20 21:39:25 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 991 bytes | 
| コンパイル時間 | 1,667 ms | 
| コンパイル使用メモリ | 166,676 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-14 16:54:58 | 
| 合計ジャッジ時間 | 3,255 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 60 WA * 1 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() cin.tie(0), ios::sync_with_stdio(false)
template <typename T>
bool is_prime(T N)
{
    if (N < 2)
        return false;
    for (T i = 2; i * i <= N; ++i)
    {
        if (N % i == 0)
            return false;
    }
    return true;
}
bool is_seq(int N)
{
    for (int i = 1; i * i <= N; i++)
    {
        if (i * i == N)
            return true;
    }
    return false;
}
bool is_cub(int N)
{
    for (int i = 1; i * i * i <= N; i++)
    {
        if (i * i * i == N)
            return true;
    }
    return false;
}
int N;
int main()
{
    cin >> N;
    if (is_prime(N))
        cout << "Sosu!\n";
    else if (is_seq(N))
        cout << "Heihosu!\n";
    else if (is_cub(N))
        cout << "Ripposu!\n";
    else if (N == 6 || N == 28)
        cout << "Kanzensu!\n";
    else
        cout << N << endl;
}
            
            
            
        
            
mine691