結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-07-30 00:14:48 | 
| 言語 | Nim (2.2.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 755 bytes | 
| コンパイル時間 | 3,663 ms | 
| コンパイル使用メモリ | 71,236 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-30 01:54:14 | 
| 合計ジャッジ時間 | 4,181 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
コンパイルメッセージ
/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]
ソースコード
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]
            
            
            
        