結果
| 問題 |
No.8 N言っちゃダメゲーム
|
| ユーザー |
hanbei_dayo
|
| 提出日時 | 2020-07-26 02:38:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 1,361 bytes |
| コンパイル時間 | 913 ms |
| コンパイル使用メモリ | 99,088 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-27 19:00:41 |
| 合計ジャッジ時間 | 1,527 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
#include<random>
#include <bitset>
using namespace std;
#define N (1000000000+7)
//#define N 998244353
#define INF 1e16
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> Q;
const int inf = (int)1e9;
ll gcd(ll a, ll b) {
if (b > a) {
ll tmp = b;
b = a;
a = tmp;
}
if (a%b == 0)return b;
else return gcd(b, a%b);
}
unsigned long long popcount(unsigned long long x) {
x = ((x & 0xaaaaaaaaaaaaaaaaUL) >> 1) +
(x & 0x5555555555555555UL);
x = ((x & 0xccccccccccccccccUL) >> 2) +
(x & 0x3333333333333333UL);
x = ((x & 0xf0f0f0f0f0f0f0f0UL) >> 4) +
(x & 0x0f0f0f0f0f0f0f0fUL);
x = ((x & 0xff00ff00ff00ff00UL) >> 8) +
(x & 0x00ff00ff00ff00ffUL);
x = ((x & 0xffff0000ffff0000UL) >> 16) +
(x & 0x0000ffff0000ffffUL);
x = ((x & 0xffffffff00000000UL) >> 32) +
(x & 0x00000000ffffffffUL);
return x;
}
ll dp[120010];
int main(void){
int P;
cin>>P;
for(ll q=0;q<P;q++){
ll n,k;
cin>>n>>k;
if(n<=k){
cout<<"Win"<<endl;
continue;
}
n--;
while(true){
if(n>k+1){
n-=k+1;
}
else{
if(n==k+1)cout<<"Lose"<<endl;
else cout<<"Win"<<endl;
break;
}
}
}
return 0;
}
hanbei_dayo