結果

問題 No.8 N言っちゃダメゲーム
ユーザー youjo_yamiotiyoujo_yamioti
提出日時 2018-12-02 09:33:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 1,179 ms
コンパイル使用メモリ 145,644 KB
実行使用メモリ 23,852 KB
最終ジャッジ日時 2023-09-10 19:36:37
合計ジャッジ時間 7,972 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:24: warning: ‘N’ is used uninitialized in this function [-Wuninitialized]
     vector<int> judge(N+1,0);
                       ~^~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int P,N,K;
    vector<int> judge(N+1,0);
    cin >> P;
    int i;
    for(i=0;i<P;i++){
        cin >> N >> K;
        judge[N-1] = 0;
        for(int j=N-2;j>=0;j--){
            for(int k=1;k<=K;k++){
                if(judge[j+k] == 0) judge[j] = 1;
            }
        }
        if(judge[0] == 0) cout << "Win" << endl;
        else cout << "Lose" << endl;
    }
    return 0;
}
0