結果
問題 | No.1016 三目並べ |
ユーザー |
![]() |
提出日時 | 2020-04-03 22:09:14 |
言語 | Nim (2.2.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 834 bytes |
コンパイル時間 | 4,232 ms |
コンパイル使用メモリ | 69,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 03:15:08 |
合計ジャッジ時間 | 4,813 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 WA * 5 |
コンパイルメッセージ
/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]
ソースコード
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"