結果
| 問題 |
No.8 N言っちゃダメゲーム
|
| ユーザー |
Kuphony
|
| 提出日時 | 2016-03-17 18:10:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 941 bytes |
| コンパイル時間 | 600 ms |
| コンパイル使用メモリ | 61,360 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-01 08:51:47 |
| 合計ジャッジ時間 | 1,091 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#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";
}
}
Kuphony