結果
問題 | No.2509 Beam Shateki |
ユーザー | miya145592 |
提出日時 | 2023-10-21 00:19:46 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,511 bytes |
コンパイル時間 | 328 ms |
コンパイル使用メモリ | 82,828 KB |
実行使用メモリ | 77,144 KB |
最終ジャッジ日時 | 2024-09-21 00:50:35 |
合計ジャッジ時間 | 21,478 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
52,736 KB |
testcase_01 | AC | 39 ms
52,208 KB |
testcase_02 | AC | 38 ms
52,532 KB |
testcase_03 | AC | 171 ms
77,144 KB |
testcase_04 | AC | 175 ms
76,828 KB |
testcase_05 | AC | 173 ms
76,700 KB |
testcase_06 | AC | 174 ms
76,812 KB |
testcase_07 | AC | 173 ms
76,624 KB |
testcase_08 | AC | 171 ms
76,944 KB |
testcase_09 | AC | 170 ms
76,508 KB |
testcase_10 | AC | 171 ms
76,684 KB |
testcase_11 | AC | 173 ms
76,756 KB |
testcase_12 | AC | 173 ms
76,756 KB |
testcase_13 | AC | 627 ms
76,632 KB |
testcase_14 | AC | 630 ms
76,720 KB |
testcase_15 | AC | 624 ms
76,928 KB |
testcase_16 | AC | 627 ms
76,808 KB |
testcase_17 | AC | 626 ms
76,752 KB |
testcase_18 | AC | 630 ms
77,132 KB |
testcase_19 | AC | 627 ms
76,828 KB |
testcase_20 | AC | 630 ms
77,008 KB |
testcase_21 | WA | - |
testcase_22 | AC | 624 ms
76,996 KB |
testcase_23 | AC | 623 ms
77,004 KB |
testcase_24 | AC | 629 ms
76,752 KB |
testcase_25 | AC | 633 ms
77,000 KB |
testcase_26 | AC | 630 ms
77,132 KB |
testcase_27 | AC | 624 ms
77,072 KB |
testcase_28 | AC | 626 ms
76,836 KB |
testcase_29 | AC | 625 ms
77,084 KB |
testcase_30 | AC | 626 ms
76,956 KB |
testcase_31 | WA | - |
testcase_32 | AC | 625 ms
76,796 KB |
testcase_33 | AC | 110 ms
76,448 KB |
testcase_34 | AC | 225 ms
76,868 KB |
testcase_35 | AC | 365 ms
76,856 KB |
testcase_36 | AC | 155 ms
77,028 KB |
testcase_37 | AC | 74 ms
73,344 KB |
testcase_38 | AC | 166 ms
76,796 KB |
testcase_39 | AC | 149 ms
76,548 KB |
testcase_40 | AC | 257 ms
76,760 KB |
testcase_41 | AC | 62 ms
66,560 KB |
testcase_42 | AC | 176 ms
77,068 KB |
testcase_43 | AC | 434 ms
76,912 KB |
testcase_44 | AC | 493 ms
76,744 KB |
testcase_45 | AC | 154 ms
76,684 KB |
testcase_46 | AC | 182 ms
76,672 KB |
testcase_47 | AC | 483 ms
76,976 KB |
testcase_48 | AC | 209 ms
77,104 KB |
testcase_49 | AC | 277 ms
76,760 KB |
testcase_50 | AC | 316 ms
76,876 KB |
testcase_51 | AC | 101 ms
76,208 KB |
testcase_52 | AC | 241 ms
77,124 KB |
testcase_53 | WA | - |
testcase_54 | AC | 39 ms
52,608 KB |
testcase_55 | WA | - |
testcase_56 | AC | 43 ms
59,264 KB |
testcase_57 | AC | 44 ms
59,264 KB |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | WA | - |
ソースコード
import sys input = sys.stdin.readline H, W = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(H)] dir = [-1, 0, 1] pos = [] for i in range(H+2): if i==0 or i==H+1: for j in range(W+2): pos.append((i, j)) else: pos.append((i, 0)) pos.append((i, W+1)) ans = 0 for x in range(H+W+1): if 0<=x<=H+1: dir = [(0, 1), (1, 1), (-1, 1)] else: dir = [(1, 0), (1, 1), (1, -1)] for dx, dy in dir: sco = 0 S = set() if 0<=x<=H+1: nx = x ny = 0 else: nx = 0 ny = x-(H) nx+=dx ny+=dy while 1<=nx<=H and 1<=ny<=W: sco += A[nx-1][ny-1] S.add((nx, ny)) nx+=dx ny+=dy for x2 in range(x+1, H+W+1): if 0<=x2<=H+1: dir2 = [(0, 1), (1, 1), (-1, 1)] else: dir2 = [(1, 0), (1, 1), (1, -1)] for dx2, dy2 in dir2: sco2 = 0 if 0<=x2<=H+1: nx2 = x2 ny2 = 0 else: nx2 = 0 ny2 = x2-(H) nx2+=dx2 ny2+=dy2 while 1<=nx2<=H and 1<=ny2<=W: if (nx2, ny2) not in S: sco2 += A[nx2-1][ny2-1] nx2+=dx2 ny2+=dy2 ans = max(ans, sco+sco2) print(ans)