結果

問題 No.8 N言っちゃダメゲーム
ユーザー satonakatakumi
提出日時 2021-08-12 12:58:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 285 bytes
コンパイル時間 1,820 ms
コンパイル使用メモリ 191,332 KB
最終ジャッジ日時 2025-01-23 17:44:21
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   u64 P; scanf("%lu", &P);
      |          ~~~~~^~~~~~~~~~~
main.cpp:9:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |     u64 N, K; scanf("%lu %lu", &N, &K);
      |               ~~~~~^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using u64 = std::uint64_t;

int main() {
  auto f = [](u64 n, u64 k) -> bool { return 0 == (n - 1) % (k + 1); };
  u64 P; scanf("%lu", &P);
  for (u64 _ = 0; _ < P; _++) {
    u64 N, K; scanf("%lu %lu", &N, &K);
    printf(f(N, K) ? "Lose\n" : "Win\n");
  }
}
0