結果

問題 No.24 数当てゲーム
ユーザー むらためむらため
提出日時 2017-07-30 00:14:48
言語 Nim
(2.0.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 755 bytes
コンパイル時間 4,179 ms
コンパイル使用メモリ 72,248 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 13:45:26
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 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
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 50) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]
/home/judge/data/code/Main.nim(14, 22) Warning: Deprecated since v0.20, use 'toHashSet'; toSet is deprecated [Deprecated]
/home/judge/data/code/Main.nim(15, 2) template/generic instantiation of `times` from here
/home/judge/data/code/Main.nim(18, 37) Warning: Deprecated since v0.20, use 'toHashSet'; toSet is deprecated [Deprecated]
/home/judge/data/code/Main.nim(1, 45) Warning: imported and not used: 'math' [UnusedImport]
/home/judge/data/code/Main.nim(1, 50) Warning: imported and not used: 'future' [UnusedImport]
/home/judge/data/code/Main.nim(1, 26) Warning: imported and not used: 'strscans' [UnusedImport]
/home/judge/data/code/Main.nim(1, 35) Warning: imported and not used: 'algorithm' [UnusedImport]

ソースコード

diff #

import sequtils,strutils,strscans,algorithm,math,future,sets
template get():string = stdin.readLine()
template times(n:int,body:untyped): untyped = (for _ in 0..<n: body)
template FOR(i:untyped,a,b:int,body:untyped):untyped =
  if a < b: (var i = a; while i < b:( body; i += 1))
  else : (var i = a; while i >= b:( body; i -= 1))
template REP(i:untyped,n:int,body:untyped):untyped =
  block:(var i = 0; while i < n:( body; i += 1))
###################################################################

let
  N = get().parseInt()
var
  nums = toSeq(0..9).toSet()
N.times:
  let
    line = get().split()
    num = line[0..^2].map(parseInt).toSet()
    r = line[^1]
  if r == "NO":
    nums = nums - num
  else:
    nums = nums * num
echo toSeq(nums.items)[0]
0