結果

問題 No.1016 三目並べ
ユーザー nadeshinonadeshino
提出日時 2020-04-03 22:09:14
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 834 bytes
コンパイル時間 4,473 ms
コンパイル使用メモリ 68,200 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-16 02:02:30
合計ジャッジ時間 5,173 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'algorithm' [UnusedImport]
/home/judge/data/code/Main.nim(1, 19) Warning: imported and not used: 'math' [UnusedImport]
/home/judge/data/code/Main.nim(1, 45) Warning: imported and not used: 'tables' [UnusedImport]
/home/judge/data/code/Main.nim(1, 35) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import algorithm, math, strutils, sequtils, tables, macros

let read* = iterator: string {.closure.} =
  while true: (for s in stdin.readLine.split: yield s)

template input*(T: static[typedesc]): untyped = 
  when T is int: read().parseInt
  elif T is float: read().parseFloat
  elif T is string: read()

macro dump*(arg: varargs[untyped]): untyped =
  result = newNimNode(nnkStmtList)
  for x in arg:
    let name = toStrLit(x)
    result.add(quote do: stderr.write `name`, " = " , `x`, ", ")
  result.add(quote do: stderr.write "\n")

proc check(S: string): bool =
  return S.contains("--o-") or S.contains("-o--") or S.contains("-oo") or
  S.contains("oo-") or S.contains("o-o") or S.contains("ooo")

let T = input(int)
for _ in 1 .. T:
  let _ = input(int)
  let S = input(string)
  if check(S):
    echo "O"
  else:
    echo "X"
0