結果
問題 |
No.889 素数!
|
ユーザー |
![]() |
提出日時 | 2020-03-27 15:48:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,323 bytes |
コンパイル時間 | 1,764 ms |
コンパイル使用メモリ | 168,944 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-01-02 08:38:48 |
合計ジャッジ時間 | 3,311 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; #define INF 1000000000 #define mod 1000000007 using ll=long long; const ll LINF=1001002003004005006ll; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;} template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;} signed main(){ cin.tie(0); ios::sync_with_stdio(0); set<int> so,he,ri,ka; set<int> tmp; for(int i=2;i<65;i++) tmp.insert(i); while(!tmp.empty()){ int p=*tmp.begin(); so.insert(p); for(int i=p;i<=64;i+=p){ if(tmp.count(i)) tmp.erase(i); } } for(int i=2;i<=64;i++){ he.insert(i*i); ri.insert(i*i*i); } ka.insert(6);ka.insert(28); int n;cin>>n; if(so.count(n)){ cout<<"Sosu!\n"; return 0; } if(he.count(n)){ cout<<"Heihosu!\n"; return 0; } if(ri.count(n)){ cout<<"Ripposu!\n"; return 0; } if(ka.count(n)){ cout<<"Kanzensu!\n"; return 0; } cout<<n<<endl; return 0; }