結果

問題 No.264 じゃんけん
コンテスト
ユーザー jntkym
提出日時 2019-05-10 17:05:57
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 587 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,386 ms
コンパイル使用メモリ 68,376 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-23 04:50:56
合計ジャッジ時間 2,670 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sequtils, strutils
let nk: seq[int] = stdin.readline.split.map(parseint)
let mine: int = nk[0]
let opponent: int = nk[1]

proc janken(mine, opponent: int): string =
  if mine == 0:
    if opponent == 0:
      return "Drew"
    elif opponent == 1:
      return "Won"
    else:
      return "Lost"
  elif mine == 1:
    if opponent == 0:
      return "Lost"
    elif opponent == 1:
      return "Drew"
    else:
      return "Won"
  else:
    if opponent == 0:
      return "Won"
    elif opponent == 1:
      return "Lost"
    else:
      return "Drew"

echo janken(mine, opponent)
0