結果
| 問題 | No.889 素数! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-20 23:56:17 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 437 bytes |
| 記録 | |
| コンパイル時間 | 488 ms |
| コンパイル使用メモリ | 73,584 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-04 17:42:41 |
| 合計ジャッジ時間 | 2,323 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 61 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int N;
main()
{
cin>>N;
bool sosu=N>=2;
for(int i=2;i*i<=N;i++)
{
if(N%i==0)
{
sosu=false;
}
if(i*i==N)
{
cout<<"Heihosu!"<<endl;
return 0;
}
}
for(int i=2;i*i*i<=N;i++)
{
if(i*i*i==N)
{
cout<<"Ripposu!"<<endl;
return 0;
}
}
if(sosu)
{
cout<<"Sosu!"<<endl;
return 0;
}
if(N==6||N==28)
{
cout<<"Kanzensu!"<<endl;
return 0;
}
cout<<N<<endl;
}