結果

問題 No.24 数当てゲーム
ユーザー とばりとばり
提出日時 2018-09-22 19:56:29
言語 Nim
(2.0.2)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 500 bytes
コンパイル時間 2,927 ms
コンパイル使用メモリ 68,936 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 20:12:13
合計ジャッジ時間 3,548 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils

let n = parseInt(readLine(stdin))

var exists: array[10, bool]
for i in 0..9: exists[i] = true

for i in 0..<n:
  let
    tokens = readLine(stdin).split()
    nums = map(tokens[0..3], proc(x: string): int = parseInt(x))
    (a, b, c, d) = (nums[0], nums[1], nums[2], nums[3])
    r = tokens[4]

  if r == "YES":
    for d in {0..9} - {a,b,c,d}: exists[d] = false
  else:
    for d in {a,b,c,d}: exists[d] = false

for d in 0..9:
  if exists[d]: echo d
  

  

    
  
  


0