結果
| 問題 | 
                            No.889 素数!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-09-20 23:55:43 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 437 bytes | 
| コンパイル時間 | 532 ms | 
| コンパイル使用メモリ | 64,100 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-14 20:57:20 | 
| 合計ジャッジ時間 | 2,147 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge6 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 59 WA * 2 | 
コンパイルメッセージ
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=true;
	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;
}