結果

問題 No.889 素数!
ユーザー nabla_delta
提出日時 2019-10-05 02:06:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 1,312 ms
コンパイル使用メモリ 166,440 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 06:39:49
合計ジャッジ時間 2,913 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

bool is_prime(int n){
	if(n==0 || n==1) return false;
	for(int i=2; i*i<=n; i++){
		if(n%i==0) return false;
	}
	return true;
}

int main(){
	int n;
	cin >> n;
	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==6 || n==28) cout << "Kanzensu!" << endl;
	else if(is_prime(n)) cout << "Sosu!" << endl;
	else cout << n << endl;
	return 0;
}
0