結果

問題 No.2509 Beam Shateki
ユーザー miya145592miya145592
提出日時 2023-10-20 23:33:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,608 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 77,776 KB
最終ジャッジ日時 2023-10-20 23:34:27
合計ジャッジ時間 30,388 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,536 KB
testcase_01 AC 40 ms
53,536 KB
testcase_02 AC 37 ms
53,536 KB
testcase_03 AC 322 ms
76,572 KB
testcase_04 AC 322 ms
76,568 KB
testcase_05 AC 344 ms
76,488 KB
testcase_06 AC 322 ms
76,564 KB
testcase_07 AC 324 ms
76,496 KB
testcase_08 AC 318 ms
76,568 KB
testcase_09 AC 343 ms
76,572 KB
testcase_10 AC 326 ms
76,572 KB
testcase_11 AC 348 ms
76,496 KB
testcase_12 AC 325 ms
76,492 KB
testcase_13 AC 1,977 ms
77,760 KB
testcase_14 AC 1,878 ms
77,760 KB
testcase_15 AC 1,859 ms
77,704 KB
testcase_16 AC 1,883 ms
77,752 KB
testcase_17 AC 1,865 ms
77,744 KB
testcase_18 AC 1,841 ms
77,764 KB
testcase_19 AC 1,836 ms
77,760 KB
testcase_20 AC 1,792 ms
77,748 KB
testcase_21 WA -
testcase_22 AC 1,839 ms
77,776 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 AC 155 ms
76,356 KB
testcase_34 AC 559 ms
76,620 KB
testcase_35 AC 1,054 ms
77,084 KB
testcase_36 AC 280 ms
76,440 KB
testcase_37 AC 140 ms
76,068 KB
testcase_38 AC 300 ms
76,604 KB
testcase_39 AC 292 ms
76,492 KB
testcase_40 AC 620 ms
76,776 KB
testcase_41 AC 94 ms
75,940 KB
testcase_42 AC 342 ms
76,824 KB
testcase_43 AC 1,305 ms
77,420 KB
testcase_44 AC 1,553 ms
77,476 KB
testcase_45 AC 282 ms
76,560 KB
testcase_46 AC 397 ms
76,828 KB
testcase_47 AC 1,498 ms
77,316 KB
testcase_48 AC 473 ms
76,760 KB
testcase_49 AC 721 ms
76,888 KB
testcase_50 AC 867 ms
76,864 KB
testcase_51 AC 141 ms
76,236 KB
testcase_52 AC 597 ms
76,664 KB
testcase_53 WA -
testcase_54 AC 47 ms
59,580 KB
testcase_55 WA -
testcase_56 AC 53 ms
62,296 KB
testcase_57 AC 53 ms
62,296 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
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:
        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:
                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:
                    S.add((nx, ny))
                    nx+=dx
                    ny+=dy

                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:
                    S.add((nx2, ny2))
                    nx2+=dx2
                    ny2+=dy2

                sco=0
                for i, j in S:
                    sco += A[i-1][j-1]
                
                ans = max(ans, sco)
print(ans)
0