結果

問題 No.8 N言っちゃダメゲーム
ユーザー youjo_yamiotiyoujo_yamioti
提出日時 2018-12-02 09:46:07
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 487 bytes
コンパイル時間 1,163 ms
コンパイル使用メモリ 145,316 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-09-10 20:06:13
合計ジャッジ時間 7,801 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,064 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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