結果
問題 | No.2509 Beam Shateki |
ユーザー | hirayuu_yc |
提出日時 | 2023-10-20 21:44:51 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,554 bytes |
コンパイル時間 | 246 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 99,012 KB |
最終ジャッジ日時 | 2024-09-20 18:01:31 |
合計ジャッジ時間 | 46,468 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 69 ms
67,932 KB |
testcase_01 | AC | 85 ms
76,952 KB |
testcase_02 | AC | 44 ms
54,528 KB |
testcase_03 | AC | 312 ms
78,304 KB |
testcase_04 | AC | 313 ms
78,504 KB |
testcase_05 | AC | 303 ms
78,248 KB |
testcase_06 | AC | 310 ms
78,304 KB |
testcase_07 | AC | 314 ms
78,460 KB |
testcase_08 | AC | 307 ms
78,804 KB |
testcase_09 | AC | 316 ms
78,380 KB |
testcase_10 | AC | 323 ms
78,844 KB |
testcase_11 | AC | 312 ms
78,428 KB |
testcase_12 | AC | 309 ms
78,376 KB |
testcase_13 | AC | 1,531 ms
98,304 KB |
testcase_14 | AC | 1,569 ms
98,264 KB |
testcase_15 | AC | 1,593 ms
98,816 KB |
testcase_16 | AC | 1,556 ms
99,012 KB |
testcase_17 | AC | 1,539 ms
98,560 KB |
testcase_18 | AC | 1,575 ms
98,384 KB |
testcase_19 | AC | 1,561 ms
98,496 KB |
testcase_20 | AC | 1,546 ms
98,684 KB |
testcase_21 | AC | 1,576 ms
98,704 KB |
testcase_22 | AC | 1,543 ms
98,376 KB |
testcase_23 | AC | 1,556 ms
98,320 KB |
testcase_24 | AC | 1,534 ms
98,664 KB |
testcase_25 | AC | 1,545 ms
98,696 KB |
testcase_26 | AC | 1,551 ms
98,572 KB |
testcase_27 | AC | 1,584 ms
98,440 KB |
testcase_28 | AC | 1,554 ms
98,472 KB |
testcase_29 | AC | 1,527 ms
98,604 KB |
testcase_30 | AC | 1,489 ms
98,304 KB |
testcase_31 | WA | - |
testcase_32 | AC | 1,541 ms
98,744 KB |
testcase_33 | AC | 152 ms
77,388 KB |
testcase_34 | AC | 469 ms
79,700 KB |
testcase_35 | AC | 845 ms
85,376 KB |
testcase_36 | AC | 268 ms
77,936 KB |
testcase_37 | AC | 113 ms
77,200 KB |
testcase_38 | AC | 277 ms
78,292 KB |
testcase_39 | AC | 240 ms
78,244 KB |
testcase_40 | AC | 524 ms
81,692 KB |
testcase_41 | AC | 100 ms
76,952 KB |
testcase_42 | AC | 312 ms
78,372 KB |
testcase_43 | AC | 988 ms
88,148 KB |
testcase_44 | AC | 1,139 ms
91,140 KB |
testcase_45 | AC | 248 ms
77,772 KB |
testcase_46 | AC | 333 ms
78,816 KB |
testcase_47 | AC | 1,145 ms
90,368 KB |
testcase_48 | AC | 400 ms
79,032 KB |
testcase_49 | AC | 599 ms
80,348 KB |
testcase_50 | AC | 700 ms
83,628 KB |
testcase_51 | AC | 137 ms
77,692 KB |
testcase_52 | AC | 492 ms
79,844 KB |
testcase_53 | AC | 78 ms
72,576 KB |
testcase_54 | AC | 79 ms
72,448 KB |
testcase_55 | AC | 91 ms
77,012 KB |
testcase_56 | AC | 90 ms
76,644 KB |
testcase_57 | AC | 90 ms
76,636 KB |
testcase_58 | WA | - |
testcase_59 | AC | 92 ms
76,620 KB |
testcase_60 | WA | - |
testcase_61 | AC | 92 ms
77,056 KB |
testcase_62 | AC | 93 ms
76,736 KB |
testcase_63 | WA | - |
ソースコード
from copy import deepcopy deg=[(0,1),(1,0),(1,1),(-1,1),(1,-1),(-1,-1)] H,W=map(int,input().split()) A=[list(map(int,input().split())) for i in range(H)] beam=[] for i in range(W+2): for xd,yd in deg: x=i y=0 x+=xd y+=yd now=0 while 1<=x<=W and 1<=y<=H: now+=A[y-1][x-1] x+=xd y+=yd beam.append((now,i,0,xd,yd)) for i in range(H+2): for xd,yd in deg: x=0 y=i x+=xd y+=yd now=0 while 1<=x<=W and 1<=y<=H: now+=A[y-1][x-1] x+=xd y+=yd beam.append((now,0,i,xd,yd)) ap=deepcopy(A) beam.sort(reverse=True) ans1=0 for p in range(len(beam)): A=deepcopy(ap) x=beam[p][1] y=beam[p][2] xd=beam[p][3] yd=beam[p][4] x+=xd y+=yd ans=beam[p][0] while 1<=x<=W and 1<=y<=H: A[y-1][x-1]=0 x+=xd y+=yd maxi=0 for i in range(W+2): for xd,yd in deg: x=i y=0 x+=xd y+=yd now=0 while 1<=x<=W and 1<=y<=H: now+=A[y-1][x-1] x+=xd y+=yd maxi=max(maxi,now) for i in range(H+2): for xd,yd in deg: x=0 y=i x+=xd y+=yd now=0 while 1<=x<=W and 1<=y<=H: now+=A[y-1][x-1] x+=xd y+=yd maxi=max(maxi,now) ans1=max(ans1,ans+maxi) print(ans1)