結果
| 問題 |
No.889 素数!
|
| コンテスト | |
| ユーザー |
Dente
|
| 提出日時 | 2019-09-20 21:38:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 923 bytes |
| コンパイル時間 | 1,632 ms |
| コンパイル使用メモリ | 172,436 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 16:52:45 |
| 合計ジャッジ時間 | 3,156 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 60 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;
vector<long long> divisor(long long n){
vector<long long> ret;
for(long long i = 1; i * i <= n; i++){
if(n % i == 0){
ret.push_back(i);
if(i * i != n) ret.push_back(n / i);
}
}
sort(begin(ret), end(ret));
return (ret);
}
signed main(){
int n;
cin >> n;
vector<ll> vec = divisor(n);
if(vec.size() == 2){
cout << "Sosu!" << endl;
}else if(n == 4 || n == 9 || n == 16 || n == 25 || n == 36 || n == 49){
cout << "Heihosu!" << endl;
}else if(n == 8 || n == 27){
cout << "Ripposu!" << endl;
}else if(n == 28){
cout << "Kanzensu!" << endl;
}else{
cout << n << endl;
}
}
Dente