結果

問題 No.1314 N言っちゃダメゲーム (5)
ユーザー 沙耶花
提出日時 2020-12-11 00:14:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 439 bytes
コンパイル時間 1,988 ms
コンパイル使用メモリ 191,356 KB
最終ジャッジ日時 2025-01-16 21:43:18
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000000000000


int main(){
	
	int M,K;
	cin>>M>>K;
	
	int win = M-1 - ((M-1)/(K+1));
	int lose = M - 1 - win;
	
	int x = (win+1)/2;
	int y = win/2;
	
	if(win&1){
		x += lose;
	}
	else{
		y += lose;
	}
	
	if(x>y)cout<<"Win"<<endl;
	else if(x==y)cout<<"Draw"<<endl;
	else cout<<"Lose"<<endl;
	
    return 0;
}
0