結果

問題 No.889 素数!
ユーザー MayimgMayimg
提出日時 2019-09-25 04:46:14
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 699 bytes
コンパイル時間 1,797 ms
コンパイル使用メモリ 193,948 KB
最終ジャッジ日時 2025-01-07 19:07:37
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
const vector<int> pr = {
2,	3,	5,	7,	11,	13,	17,	19,	23,	29,
31,	37,	41,	43,	47,	53,	59,	61};
const vector<int> sq = {4, 9, 16, 25, 36, 49, 64};
const vector<int> cb = {8, 27, 64};
const vector<int> pf = {6, 28};
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  int n;
  cin >> n;
  if (count(pr.begin(), pr.end(), n)) {
    cout << "Sosu!\n";
  } else if (count(sq.begin(), sq.end(), n)) {
    cout << "Heihosu!\n";
  } else if (count(cb.begin(), cb.end(), n)) {
    cout << "Ripposu!\n";
  } else if (count(pf.begin(), pf.end(), n)) {
    cout << "Kanzensu!\n";
  } else {
    cout << n << '\n';
  }
  return 0;
}
0