結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 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 && n != two) { cout << "NO\n"; return zero; }
    if (n % three == zero && n != three) { cout << "NO\n"; return zero; }
    if (n % five == zero && n != five) { cout << "NO\n"; return zero; }
    if (n % seven == zero && n != seven) { cout << "NO\n"; return zero; }
    if (n % eleven == zero && n != eleven) { cout << "NO\n"; return zero; }
    if (n % thirteen == zero && n != thirteen) { cout << "NO\n"; return zero; }
    if (n % seventeen == zero && n != seventeen) { cout << "NO\n"; return zero; }
    if (n % nineteen == zero && n != nineteen) { cout << "NO\n"; return zero; }
    if (n % twentythree == zero && n != twentythree) { cout << "NO\n"; return zero; }
    if (n % twentynine == zero && n != twentynine) { cout << "NO\n"; return zero; }
    if (n % thirtyone == zero && n != thirtyone) { cout << "NO\n"; return zero; }

    cout << "YES\n";
}
0