結果
| 問題 |
No.8 N言っちゃダメゲーム
|
| コンテスト | |
| ユーザー |
mh72012246
|
| 提出日時 | 2016-10-25 14:11:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 672 bytes |
| コンパイル時間 | 555 ms |
| コンパイル使用メモリ | 66,664 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-24 03:33:16 |
| 合計ジャッジ時間 | 1,191 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <sstream> // istringstream
#include <algorithm> // sort
#include <utility> // pair
#include <cfloat> // DBL_MAX
typedef long long ll;
using namespace std;
const int maxN = 10000;
bool ps[maxN-1];
int main(){
int P; // [100]
cin >> P;
for(int round=0; round<P; round++){
int N,K; // [2,120000]
cin >> N >> K;
// you can win iff you can say N-1.
// <-> say N-1-(K+1) <-> N-1-n(K+1)
int firstTarget = (N-1)%(K+1);
if(0 < firstTarget && firstTarget <= K){
cout << "Win" << endl;
} else {
cout << "Lose" << endl;
}
}
return 0;
}
mh72012246