結果
| 問題 |
No.1016 三目並べ
|
| ユーザー |
nadeshino
|
| 提出日時 | 2020-04-03 22:15:20 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 910 bytes |
| コンパイル時間 | 3,560 ms |
| コンパイル使用メモリ | 71,268 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-03 03:35:25 |
| 合計ジャッジ時間 | 4,096 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 WA * 4 |
コンパイルメッセージ
/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") or
S.contains("o---o") or S.contains("o--o-") or
S.contains("-o--o")
let T = input(int)
for _ in 1 .. T:
let _ = input(int)
let S = input(string)
if check(S):
echo "O"
else:
echo "X"
nadeshino