結果

問題 No.889 素数!
ユーザー conan1024haoconan1024hao
提出日時 2019-09-20 22:02:35
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 846 bytes
コンパイル時間 806 ms
コンパイル使用メモリ 88,996 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-09-14 17:35:06
合計ジャッジ時間 2,247 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 60 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <cmath>
#include<iomanip>
#include <unordered_map>
#include <map>
using namespace std;
static const long long MOD = 1000000007LL;
typedef long long ll;
unordered_map <string,int> ump;
 
 
int main()
{
    ll n;
    cin>>n;
    ll sum=0;
    bool a2=false;
    bool a3=false;
    for(ll i=1;i<=(n/2);i++)
    {
    	if(n%i==0)
    		sum+=i;
    	if(n/i==i&&n%i==0&&n>2)
    		a2=true;
    	if(n/i/i==i&&n%i==0&&n%(i*i)==0&&n>2)
    		a3=true;
    }
    if(sum==1)
    	cout<<"Sosu!"<<endl;
    else if(sum==n)
    	cout<<"Kanzensu!"<<endl;
    else if(a2==true)
    	cout<<"Heihosu!"<<endl;
    else if(a3==true)
    	cout<<"Ripposu!"<<endl;
    else
    	cout<<n<<endl;
    return 0;
}
0