結果
問題 | No.86 TVザッピング(2) |
ユーザー | 6soukiti29 |
提出日時 | 2017-08-11 07:54:16 |
言語 | Nim (2.0.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,451 bytes |
コンパイル時間 | 2,922 ms |
コンパイル使用メモリ | 68,112 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-12 14:03:21 |
合計ジャッジ時間 | 4,215 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | WA | - |
testcase_06 | AC | 1 ms
4,376 KB |
testcase_07 | AC | 2 ms
4,376 KB |
testcase_08 | AC | 2 ms
4,380 KB |
testcase_09 | AC | 2 ms
4,376 KB |
testcase_10 | AC | 2 ms
4,380 KB |
testcase_11 | AC | 2 ms
4,380 KB |
testcase_12 | WA | - |
testcase_13 | AC | 2 ms
4,380 KB |
testcase_14 | AC | 2 ms
4,380 KB |
testcase_15 | AC | 2 ms
4,376 KB |
testcase_16 | AC | 2 ms
4,376 KB |
testcase_17 | AC | 2 ms
4,380 KB |
testcase_18 | AC | 2 ms
4,376 KB |
testcase_19 | AC | 2 ms
4,380 KB |
testcase_20 | AC | 2 ms
4,380 KB |
testcase_21 | AC | 2 ms
4,380 KB |
testcase_22 | AC | 2 ms
4,376 KB |
testcase_23 | AC | 2 ms
4,380 KB |
testcase_24 | AC | 2 ms
4,376 KB |
testcase_25 | RE | - |
testcase_26 | WA | - |
testcase_27 | AC | 2 ms
4,380 KB |
testcase_28 | AC | 2 ms
4,376 KB |
testcase_29 | AC | 2 ms
4,380 KB |
testcase_30 | AC | 2 ms
4,380 KB |
testcase_31 | AC | 2 ms
4,380 KB |
testcase_32 | AC | 2 ms
4,376 KB |
ソースコード
import sequtils,strutils var M,N : int (M, N) = stdin.readline.split.map(parseInt) var hyou = newSeq[string](M + 2,) D = [[1,0],[0,-1],[-1,0],[0,1]] cnt : int ans : bool cntd : int flag : array[102,array[102,int]] hyou[0] = repeat('#',M + 2) hyou[M + 1] = repeat('#',M + 2) for n in 1..M: hyou[n] = '#' & stdin.readline & '#' proc tansaku(i,j : int):bool= var x = i y = j cntf = 0 cntf2 = 0 nx,ny : int for d2 in 0..3: var d = d2 while cntf <= cntd: nx = x + D[d][0] ny = y + D[d][1] if nx == i and ny == j and cntf == cntd - 1: return true elif hyou[ny][nx] == '.' and flag[ny][nx] < cnt: flag[ny][nx] = cnt cntf += 1 x = nx y = ny cntf2 = 0 elif cntf2 == 0: cntf2 += 1 d = (d + 1) mod 4 else: break return false for x in 1..N: for y in 1..M: if hyou[y][x] == '.': cntd += 1 block tansaku: if cntd > 4 * (M + N): break tansaku for x in 1..N: for y in 1..M: if hyou[y][x] == '.': cnt += 1 if tansaku(x,y): ans = true break tansaku if ans: echo "YES" else: echo "NO"