結果
問題 | No.889 素数! |
ユーザー |
![]() |
提出日時 | 2019-09-24 14:29:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 910 bytes |
コンパイル時間 | 1,547 ms |
コンパイル使用メモリ | 161,380 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 05:07:34 |
合計ジャッジ時間 | 2,834 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include <bits/stdc++.h> using namespace std; using lli = long long int; template <class T>ostream &operator<<(ostream &o,const vector<T>&v) {o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;} template <class T>ostream &operator<<(ostream &o,const pair<T, T>&p) {o<<"("<<p.first<<", "<<p.second<<")";return o;} int main(void){ int n; cin >> n; vector<lli> p = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61}; vector<lli> s = {4, 9, 16, 25, 36, 49}; vector<lli> v = {8, 27}; vector<lli> c = {6, 28}; int st = 0; for(auto i : p) if(n == i) cout << "Sosu!" << endl, st = 1; for(auto i : s) if(n == i) cout << "Heihosu!" << endl, st = 1; for(auto i : v) if(n == i) cout << "Ripposu!" << endl, st = 1; for(auto i : c) if(n == i) cout << "Kanzensu!" << endl, st = 1; if(st != 1) cout << n << endl; return 0; }