結果

問題 No.264 じゃんけん
ユーザー jcm_2jcm_2
提出日時 2023-05-05 14:42:00
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 470 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 5,368 KB
実行使用メモリ 42,364 KB
最終ジャッジ日時 2023-08-14 22:33:23
合計ジャッジ時間 2,651 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
42,096 KB
testcase_01 AC 73 ms
42,184 KB
testcase_02 AC 72 ms
42,140 KB
testcase_03 AC 68 ms
42,364 KB
testcase_04 AC 70 ms
42,140 KB
testcase_05 AC 70 ms
42,140 KB
testcase_06 AC 67 ms
42,132 KB
testcase_07 AC 71 ms
42,256 KB
testcase_08 AC 70 ms
42,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
  // parse input
  const data = input.split("\n");
  const first_line = data[0].split(" ");

  // solve
  const c = solve(parseInt(first_line[0]), parseInt(first_line[1]));

  // output
  console.log(c);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

function solve(n, k) {
  const result = k -n;
  switch (result) {
    case 0:
      return 'Drew';
    case 1:
    case -2:
      return 'Won';
    default:
      return 'Lost';
  }
}
0