結果

問題 No.1314 N言っちゃダメゲーム (5)
ユーザー t98slider
提出日時 2022-12-20 14:04:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 390 bytes
コンパイル時間 1,245 ms
コンパイル使用メモリ 165,388 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-18 01:49:37
合計ジャッジ時間 1,969 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
  ll m, k, f, s, a, b;
  cin >> m >> k;
  s = m / (k + 1);
  f = m - 1 - s;
  if(f & 1){ a = (f + 1) / 2 + (s + 1) / 2, b = f / 2 + s / 2; }
  else{ a = (f + 1) / 2 + s / 2, b = f / 2 + (s + 1) / 2;}
  if(a > b) cout << "Win" << '\n';
  else if(a == b) cout << "Draw" << '\n';
  else cout << "Lose" << '\n';
}
0