結果
問題 | No.2509 Beam Shateki |
ユーザー | sasa8uyauya |
提出日時 | 2023-10-20 22:49:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,182 bytes |
コンパイル時間 | 367 ms |
コンパイル使用メモリ | 82,720 KB |
実行使用メモリ | 80,336 KB |
最終ジャッジ日時 | 2024-09-20 20:56:38 |
合計ジャッジ時間 | 8,881 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
53,912 KB |
testcase_01 | WA | - |
testcase_02 | AC | 39 ms
53,192 KB |
testcase_03 | AC | 113 ms
77,388 KB |
testcase_04 | AC | 113 ms
77,504 KB |
testcase_05 | AC | 112 ms
77,516 KB |
testcase_06 | AC | 112 ms
77,232 KB |
testcase_07 | AC | 113 ms
77,696 KB |
testcase_08 | AC | 113 ms
77,516 KB |
testcase_09 | AC | 113 ms
77,384 KB |
testcase_10 | WA | - |
testcase_11 | AC | 113 ms
77,624 KB |
testcase_12 | AC | 113 ms
77,512 KB |
testcase_13 | AC | 143 ms
79,696 KB |
testcase_14 | AC | 141 ms
79,668 KB |
testcase_15 | AC | 143 ms
80,044 KB |
testcase_16 | WA | - |
testcase_17 | AC | 147 ms
79,740 KB |
testcase_18 | AC | 148 ms
79,824 KB |
testcase_19 | AC | 141 ms
79,688 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 144 ms
79,940 KB |
testcase_23 | AC | 142 ms
79,920 KB |
testcase_24 | AC | 146 ms
80,044 KB |
testcase_25 | AC | 144 ms
79,812 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 143 ms
79,912 KB |
testcase_29 | AC | 145 ms
79,940 KB |
testcase_30 | AC | 145 ms
80,068 KB |
testcase_31 | WA | - |
testcase_32 | AC | 143 ms
80,068 KB |
testcase_33 | AC | 95 ms
76,136 KB |
testcase_34 | AC | 118 ms
78,120 KB |
testcase_35 | AC | 130 ms
79,116 KB |
testcase_36 | AC | 115 ms
77,192 KB |
testcase_37 | AC | 83 ms
76,044 KB |
testcase_38 | AC | 111 ms
77,724 KB |
testcase_39 | AC | 108 ms
77,264 KB |
testcase_40 | AC | 127 ms
78,560 KB |
testcase_41 | AC | 62 ms
67,668 KB |
testcase_42 | AC | 115 ms
77,560 KB |
testcase_43 | AC | 138 ms
79,344 KB |
testcase_44 | AC | 141 ms
79,444 KB |
testcase_45 | AC | 111 ms
77,432 KB |
testcase_46 | AC | 119 ms
77,480 KB |
testcase_47 | AC | 141 ms
79,696 KB |
testcase_48 | AC | 119 ms
78,548 KB |
testcase_49 | AC | 124 ms
78,952 KB |
testcase_50 | AC | 130 ms
78,552 KB |
testcase_51 | AC | 92 ms
76,344 KB |
testcase_52 | AC | 124 ms
78,276 KB |
testcase_53 | AC | 44 ms
53,832 KB |
testcase_54 | WA | - |
testcase_55 | AC | 40 ms
54,944 KB |
testcase_56 | AC | 39 ms
55,064 KB |
testcase_57 | WA | - |
testcase_58 | AC | 40 ms
53,572 KB |
testcase_59 | AC | 40 ms
53,724 KB |
testcase_60 | AC | 40 ms
54,184 KB |
testcase_61 | AC | 40 ms
53,372 KB |
testcase_62 | WA | - |
testcase_63 | WA | - |
ソースコード
h,w=map(int,input().split()) a=[list(map(int,input().split())) for i in range(h)] g=0 for hanten in range(2): for kaiten in range(4): A=[[0]*(h-1+w+h-1) for i in range(h)] for i in range(h): for j in range(w): A[i][j+h-1]=a[i][j] b1=[[0]*(h-1+w+h-1) for i in range(h)] for i in range(h): b1[i][h-1+w-1+i]=sum(A[i]) for i in range(h): for j in reversed(range(i,i+h-1+w-1)): b1[i][j]=b1[i][j+1] b2=[[0]*(h-1+w+h-1) for i in range(h)] for j in range(h-1,h-1+w+h-1): b2[h-1][j]=sum(A[h-1-i][j-i] for i in range(h)) for i in reversed(range(h-1)): for j in range(w+h-1): b2[i][j+i]=b2[i+1][j+1] g=max(g,sum((sorted([0,0]+[b1[i][h-1+w-1+i] for i in range(h)]))[::-1][:2])) g=max(g,sum((sorted([0,0]+[b2[h-1][h-1+i] for i in range(h+w-1)]))[::-1][:2])) for i in range(h): for j in range(i,i+h-1+w): g=max(g,b1[i][j]+b2[i][j]-A[i][j]) na=[[0]*h for i in range(w)] for i in range(h): for j in range(w): na[~j][i]=a[i][j] h,w=w,h a=na na=[[0]*w for i in range(h)] for i in range(h): for j in range(w): na[~i][j]=a[i][j] a=na print(g)