結果
| 問題 |
No.889 素数!
|
| コンテスト | |
| ユーザー |
merom686
|
| 提出日時 | 2019-09-20 21:35:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 874 bytes |
| コンパイル時間 | 790 ms |
| コンパイル使用メモリ | 73,844 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 16:45:19 |
| 合計ジャッジ時間 | 2,373 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 60 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
if (n == 1) {
cout << n << endl;
exit(0);
}
int b = 0;
for (int i = 2; i < n; i++) {
if (n % i == 0) b = 1;
}
if (b == 0) {
cout << "Sosu!" << endl;
exit(0);
}
for (int i = 2; i < n; i++) {
if (i * i == n) b = 0;
}
if (b == 0) {
cout << "Heihosu!" << endl;
exit(0);
}
for (int i = 2; i < n; i++) {
if (i * i * i == n) b = 0;
}
if (b == 0) {
cout << "Ripposu!" << endl;
exit(0);
}
if (n == 6 || n == 28) {
cout << "Kanzensu!" << endl;
exit(0);
}
cout << n << endl;
return 0;
}
merom686