結果

問題 No.8 N言っちゃダメゲーム
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-02 02:36:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 2,271 ms
コンパイル使用メモリ 200,324 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-18 18:08:13
合計ジャッジ時間 3,184 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
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 -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:20:13: 警告: ‘p’ is used uninitialized [-Wuninitialized]
   20 |     while (p--) {
      |            ~^~
main.cpp:19:9: 備考: ‘p’ はここで定義されています
   19 |     int p;
      |         ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

vector<int> getprimes(int n) {
    bool isprime[n+1];
    fill(isprime, isprime+n+1, true);
    vector<int> primes;
    for (int i = 2; i <= n; i++) {
        if (!isprime[i]) continue;
        primes.push_back(i);
        for (int j = i+i; j <= n; j += i)
            isprime[j] = false;
    }
    return primes;
}

int main() {
    int p;
    while (p--) {
        int n, k;
        cin>>n>>k;
        if ((n-1)%(k+1)==0) puts("Lose");
        else puts("Win");
    }
    return 0;
}
0