結果

問題 No.889 素数!
ユーザー Mister
提出日時 2020-04-10 17:05:43
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 672 bytes
コンパイル時間 991 ms
コンパイル使用メモリ 83,124 KB
最終ジャッジ日時 2025-01-09 15:41:50
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <set>

const std::vector<std::set<int>>
    xss{{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61},
        {4, 9, 16, 25, 36, 49},
        {8, 27},
        {6, 28}};

const std::vector<std::string>
    ss{"So", "Heiho", "Rippo", "Kanzen"};

void solve() {
    int n;
    std::cin >> n;

    for (int i = 0; i < 4; ++i) {
        if (xss[i].count(n)) {
            std::cout << ss[i] << "su!" << std::endl;
            return;
        }
    }

    std::cout << n << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0