結果
| 問題 | 
                            No.889 素数!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-09-20 22:59:45 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 800 bytes | 
| コンパイル時間 | 612 ms | 
| コンパイル使用メモリ | 74,304 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-14 19:13:49 | 
| 合計ジャッジ時間 | 2,286 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge6 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 60 WA * 1 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
bool f0(int N) {
  if (N==1) return false;
  for (int i=2;i<N;++i) if (N%i==0) return false;
  return true;
}
bool f1(int N) {
  for (int i=2;i<N;++i) if (N==i*i) return true;
  return false;
}
bool f2(int N) {
  for (int i=2;i<N;++i) if (N==i*i*i) return true;
  return false;
}
bool f3(int N) {
  long long sum=0;
  for (int i=1;i<N;++i) if (N%i==0) sum+=i;
  return sum==N;
}
int main() {
  int N;
  std::cin>>N;
  if (f0(N)) {
    std::cout<<"Sosu!"<<std::endl;
  } else if (f1(N)) {
    std::cout<<"Heihosu!"<<std::endl;
  } else if (f2(N)) {
    std::cout<<"Ripposu!"<<std::endl;
  } else if (f3(N)) {
    std::cout<<"Kanzensu!"<<std::endl;
  } else {
    std::cout<<N<<std::endl;
  }
  return 0;
}