結果
問題 | No.2641 draw X |
ユーザー | nikoro256 |
提出日時 | 2024-02-19 23:23:10 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,025 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 82,180 KB |
実行使用メモリ | 109,832 KB |
最終ジャッジ日時 | 2024-09-29 03:06:53 |
合計ジャッジ時間 | 12,853 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
53,360 KB |
testcase_01 | AC | 37 ms
53,036 KB |
testcase_02 | AC | 37 ms
53,572 KB |
testcase_03 | AC | 36 ms
53,900 KB |
testcase_04 | AC | 37 ms
52,532 KB |
testcase_05 | AC | 37 ms
53,292 KB |
testcase_06 | WA | - |
testcase_07 | AC | 38 ms
53,540 KB |
testcase_08 | AC | 38 ms
53,488 KB |
testcase_09 | AC | 39 ms
55,044 KB |
testcase_10 | AC | 41 ms
54,660 KB |
testcase_11 | AC | 38 ms
54,180 KB |
testcase_12 | AC | 38 ms
53,324 KB |
testcase_13 | AC | 37 ms
53,376 KB |
testcase_14 | AC | 38 ms
53,008 KB |
testcase_15 | AC | 129 ms
104,816 KB |
testcase_16 | AC | 1,136 ms
109,832 KB |
testcase_17 | AC | 39 ms
52,884 KB |
testcase_18 | AC | 37 ms
52,768 KB |
testcase_19 | AC | 39 ms
54,156 KB |
testcase_20 | AC | 151 ms
79,884 KB |
testcase_21 | AC | 156 ms
82,372 KB |
testcase_22 | AC | 185 ms
79,484 KB |
testcase_23 | WA | - |
testcase_24 | AC | 83 ms
78,232 KB |
testcase_25 | AC | 112 ms
78,336 KB |
testcase_26 | WA | - |
testcase_27 | AC | 170 ms
78,472 KB |
testcase_28 | AC | 148 ms
88,444 KB |
testcase_29 | AC | 151 ms
102,264 KB |
testcase_30 | WA | - |
testcase_31 | AC | 198 ms
90,584 KB |
testcase_32 | WA | - |
testcase_33 | AC | 872 ms
103,044 KB |
testcase_34 | AC | 392 ms
92,360 KB |
testcase_35 | AC | 455 ms
90,016 KB |
testcase_36 | AC | 299 ms
106,064 KB |
testcase_37 | AC | 1,575 ms
108,740 KB |
testcase_38 | AC | 431 ms
104,656 KB |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | AC | 255 ms
104,428 KB |
testcase_42 | AC | 517 ms
106,192 KB |
testcase_43 | WA | - |
ソースコード
H,W=map(int,input().split()) S=[] for _ in range(H): S.append(input()) down=[[0]*(W+1) for _ in range(H+1)] up=[[0]*(W+1) for _ in range(H+1)] for i in range(H): for j in range(W): if S[i][j]=='#': down[i][j]+=1 up[i][j]+=1 if i!=H-1 and j!=W-1 and S[i+1][j+1]=='#': down[i+1][j+1]+=down[i][j] if i!=H-1 and j!=0 and S[i+1][j-1]=='#': up[i+1][j-1]+=up[i][j] ansdown=[[0]*(W+1) for _ in range(H+1)] ansup=[[0]*(W+1) for _ in range(H+1)] for i in range(1,H-1): for j in range(1,W-1): if S[i][j]=='#' and S[i-1][j-1]=='#' and S[i-1][j+1]=='#' and S[i+1][j-1]=='#' and S[i+1][j+1]=='#': left,right=0,10**6//2+1 while right-left>1: mid=(right+left)//2 x=i+mid y=j+mid xs=i-mid-1 ys=j-mid-1 x2=i+mid y2=j-mid xs2=i-mid-1 ys2=j+mid+1 if 0<=x<H and 0<=y<W and 0<=xs+1<H and 0<=ys+1<W and down[x][y]-down[xs][ys]==mid*2+1: if 0<=x2<H and 0<=y2<W and 0<=xs2+1<H and 0<=ys2-1<W and up[x2][y2]-up[xs2][ys2]==mid*2+1: left=mid else: right=mid else: right=mid mid=left ansdown[i-mid][j-mid]+=1 ansdown[i+mid+1][j+mid+1]-=1 ansup[i-mid][j+mid]+=1 ansup[i+mid+1][j-mid-1]+=1 for i in range(H): for j in range(W): if i!=H-1 and j!=W-1 and S[i+1][j+1]=='#': ansdown[i+1][j+1]+=ansdown[i][j] if i!=H-1 and j!=0 and S[i+1][j-1]=='#': ansup[i+1][j-1]+=ansup[i][j] flag=True for i in range(H): for j in range(W): if S[i][j]=='#': if ansdown[i][j]==0 and ansup[i][j]==0: flag=False if flag: print('Yes') else: print('No')