結果

問題 No.889 素数!
ユーザー kpinkcat
提出日時 2023-08-22 18:12:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 756 bytes
コンパイル時間 1,071 ms
コンパイル使用メモリ 100,896 KB
最終ジャッジ日時 2025-02-16 12:20:00
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 59 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;


int main()
{
    int n, sum1 = 0, f = 0;
    cin >> n;
    int t = pow(n, 0.5);
    for (int i = 2; i <= t; i++){
        if (n == i*i*i){
            cout << "Ripposu!" << endl;
            return 0;
        }
        if (n == i*i){
            cout << "Heihosu!" << endl;
            return 0;
        }
        if (!(n%i)) f++;
        if (!(n%i)){
            if (i != n/i) sum1 += (i + n/i);
            else sum1 += i;
        } 
    }
    if (n != 0 && (sum1 - n) == n) cout << "Kanzensu!" << endl;
    if (n != 0 && n != 1 && !f) cout << "Sosu!" << endl;
    else cout << n << endl;
}
0