結果

問題 No.8 N言っちゃダメゲーム
ユーザー KuphonyKuphony
提出日時 2016-03-17 18:10:17
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 941 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 61,764 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 16:44:30
合計ジャッジ時間 1,080 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#define MAX 10000
using namespace std;


int main(int argc, const char * argv[]) {
    int P;
    cin >> P;
    int array[P][2];
    for (int i = 0; i < P*2; i++) {
        cin >> array[i/2][i%2];
    }
    for (int x = 0; x < P; x++) {
        int n = array[x][0];
        int k = array[x][1];
        if((n-1)%(k+1) == 0)cout << "Lose\n";
        else cout << "Win\n";
        //動的計画法で解く
        //bool dp[n];
        //初期化
        //for (int i = 0; i <= n; i++) {
        //    dp[i] = false;
        //}
        //dp[0] = true;
        //埋めていく
        //for (int i = 0; i <= n; i++) {
        //    for (int j = 1; j <= k; j++) {
        //        if(i - j < 0)break;
        //        dp[i] |= !dp[i - j];
        //    }
        //}
        //if(dp[n])cout << "Win\n";
        //else cout << "Lose\n";
    }
}
0