結果

問題 No.3023 素数判定するだけ
ユーザー izryt(趣味)izryt(趣味)
提出日時 2017-04-01 00:04:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 4,430 bytes
コンパイル時間 568 ms
コンパイル使用メモリ 65,032 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 13:34:16
合計ジャッジ時間 4,178 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 1 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int zero = (int)false;
int one = (int)true;
int two = (one << (one << zero)) | zero;
int three = (one << zero) | (one << (one << zero)) | zero;
int four = (one << (one << (one << zero))) | zero;
int five = (one << zero) | (one << (one << (one << zero))) | zero;
int six = (one << (one << zero)) | (one << (one << (one << zero))) | zero;
int seven = (one << zero) | (one << (one << zero)) | (one << (one << (one << zero))) | zero;
int eight = (one << (one << (one << (one << zero)))) | zero;
int nine = (one << zero) | (one << (one << (one << (one << zero)))) | zero;
int ten = (one << (one << zero)) | (one << (one << (one << (one << zero)))) | zero;
int eleven = (one << zero) | (one << (one << zero)) | (one << (one << (one << (one << zero)))) | zero;
int twelve = (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | zero;
int thirteen = (one << zero) | (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | zero;
int fourteen = (one << (one << zero)) | (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | zero;
int fifteen = (one << zero) | (one << (one << zero)) | (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | zero;
int sixteen = (one << (one << (one << (one << (one << zero))))) | zero;
int seventeen = (one << zero) | (one << (one << (one << (one << (one << zero))))) | zero;
int eighteen = (one << (one << zero)) | (one << (one << (one << (one << (one << zero))))) | zero;
int nineteen = (one << zero) | (one << (one << zero)) | (one << (one << (one << (one << (one << zero))))) | zero;
int twenty = (one << (one << (one << zero))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentyone = (one << zero) | (one << (one << (one << zero))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentytwo = (one << (one << zero)) | (one << (one << (one << zero))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentythree = (one << zero) | (one << (one << zero)) | (one << (one << (one << zero))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentyfour = (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentyfive = (one << zero) | (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentysix = (one << (one << zero)) | (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentyseven = (one << zero) | (one << (one << zero)) | (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentyeight = (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int twentynine = (one << zero) | (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int thirty = (one << (one << zero)) | (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int thirtyone = (one << zero) | (one << (one << zero)) | (one << (one << (one << zero))) | (one << (one << (one << (one << zero)))) | (one << (one << (one << (one << (one << zero))))) | zero;
int thirtytwo = (one << (one << (one << (one << (one << (one << zero)))))) | zero;
int thirtythree = (one << zero) | (one << (one << (one << (one << (one << (one << zero)))))) | zero;
int thirtyfour = (one << (one << zero)) | (one << (one << (one << (one << (one << (one << zero)))))) | zero;

int main()
{
    int n; cin >> n;

    if (n % two == zero) { cout << "NO\n"; return zero; }
    if (n % three == zero) { cout << "NO\n"; return zero; }
    if (n % five == zero) { cout << "NO\n"; return zero; }
    if (n % seven == zero) { cout << "NO\n"; return zero; }
    if (n % eleven == zero) { cout << "NO\n"; return zero; }
    if (n % thirteen == zero) { cout << "NO\n"; return zero; }
    if (n % seventeen == zero) { cout << "NO\n"; return zero; }
    if (n % nineteen == zero) { cout << "NO\n"; return zero; }
    if (n % twentythree == zero) { cout << "NO\n"; return zero; }
    if (n % twentynine == zero) { cout << "NO\n"; return zero; }
    if (n % thirtyone == zero) { cout << "NO\n"; return zero; }

    cout << "YES\n";
}
0