結果

問題 No.889 素数!
ユーザー ui_mtc
提出日時 2019-09-20 23:11:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 1,481 ms
コンパイル使用メモリ 162,580 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-14 19:55:52
合計ジャッジ時間 2,996 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 60 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main() {
  int N;
  cin >> N;
  
  if( N == 0 ){
    cout << 0 << endl;
    return 0;
  }
  
  int kazu = 0;
  for( int i = 1; i < N; i++ ){
    if( N % i == 0 ) kazu += i;
    if( i*i == N ){
      cout << "Heihosu!" << endl;
      return 0;
    }else if( i*i*i == N ){
      cout << "Ripposu!" << endl;
      return 0;
    }
  }
  if( N == kazu ){
    cout << "Kanzensu!" << endl;
    return 0;
  }
  
  vector<int> sosu(17);
  sosu = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61 };
  for( int i = 0; i < 17; i++ ){
    if( N == sosu.at(i) ){
      cout << "Sosu!" << endl;
      return 0;
    }
  }
  cout << N << endl;
}
0