結果

問題 No.7 プライムナンバーゲーム
ユーザー troro_kelptroro_kelp
提出日時 2018-12-30 16:30:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 812 bytes
コンパイル時間 831 ms
コンパイル使用メモリ 93,820 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 18:58:42
合計ジャッジ時間 1,433 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
vector<int> prime;

bool sieve[200010];

int key[100010];
int Hash[55];
int main(void)
{
    int N;
    cin >> N;

    for (int i = 0; i < 10010; ++i)
        sieve[i] = true;

    sieve[0] = sieve[1] = false;

    for (int i = 2; i * i < 10010; ++i)
    {
        if (sieve[i])
        {
            for (int j = 2; i * j < 10010; ++j)
            {
                sieve[i * j] = false;
            }
        }
    }
    if (sieve[N - 2])
        cout << "Win" << endl;
    else
        cout << "No" << endl;
    return 0;
}
0