結果
問題 | No.2509 Beam Shateki |
ユーザー | miya145592 |
提出日時 | 2023-10-21 00:31:48 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,317 bytes |
コンパイル時間 | 146 ms |
コンパイル使用メモリ | 82,480 KB |
実行使用メモリ | 77,908 KB |
最終ジャッジ日時 | 2024-09-21 01:09:39 |
合計ジャッジ時間 | 21,999 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
52,872 KB |
testcase_01 | AC | 37 ms
54,076 KB |
testcase_02 | AC | 38 ms
52,768 KB |
testcase_03 | AC | 172 ms
77,364 KB |
testcase_04 | AC | 177 ms
77,152 KB |
testcase_05 | AC | 179 ms
76,872 KB |
testcase_06 | AC | 176 ms
77,136 KB |
testcase_07 | AC | 172 ms
77,276 KB |
testcase_08 | AC | 169 ms
76,772 KB |
testcase_09 | AC | 172 ms
77,160 KB |
testcase_10 | AC | 177 ms
76,776 KB |
testcase_11 | AC | 173 ms
76,760 KB |
testcase_12 | AC | 176 ms
76,748 KB |
testcase_13 | AC | 653 ms
77,152 KB |
testcase_14 | AC | 651 ms
77,184 KB |
testcase_15 | AC | 662 ms
77,184 KB |
testcase_16 | AC | 652 ms
77,172 KB |
testcase_17 | AC | 648 ms
77,288 KB |
testcase_18 | AC | 642 ms
77,180 KB |
testcase_19 | AC | 660 ms
77,148 KB |
testcase_20 | AC | 647 ms
77,292 KB |
testcase_21 | AC | 651 ms
77,440 KB |
testcase_22 | AC | 657 ms
77,284 KB |
testcase_23 | AC | 646 ms
77,312 KB |
testcase_24 | AC | 654 ms
77,024 KB |
testcase_25 | AC | 649 ms
77,172 KB |
testcase_26 | AC | 686 ms
77,180 KB |
testcase_27 | AC | 670 ms
77,432 KB |
testcase_28 | AC | 649 ms
77,544 KB |
testcase_29 | AC | 643 ms
77,820 KB |
testcase_30 | AC | 641 ms
77,168 KB |
testcase_31 | WA | - |
testcase_32 | AC | 640 ms
77,304 KB |
testcase_33 | AC | 110 ms
76,944 KB |
testcase_34 | AC | 226 ms
76,668 KB |
testcase_35 | AC | 374 ms
76,928 KB |
testcase_36 | AC | 153 ms
76,816 KB |
testcase_37 | AC | 77 ms
76,352 KB |
testcase_38 | AC | 162 ms
76,660 KB |
testcase_39 | AC | 157 ms
77,404 KB |
testcase_40 | AC | 265 ms
77,612 KB |
testcase_41 | AC | 61 ms
70,208 KB |
testcase_42 | AC | 174 ms
77,144 KB |
testcase_43 | AC | 436 ms
77,048 KB |
testcase_44 | AC | 501 ms
77,908 KB |
testcase_45 | AC | 164 ms
76,808 KB |
testcase_46 | AC | 190 ms
77,164 KB |
testcase_47 | AC | 501 ms
77,180 KB |
testcase_48 | AC | 207 ms
76,876 KB |
testcase_49 | AC | 279 ms
77,140 KB |
testcase_50 | AC | 325 ms
76,664 KB |
testcase_51 | AC | 100 ms
76,236 KB |
testcase_52 | AC | 240 ms
76,532 KB |
testcase_53 | AC | 41 ms
60,272 KB |
testcase_54 | AC | 40 ms
61,204 KB |
testcase_55 | AC | 41 ms
61,564 KB |
testcase_56 | AC | 41 ms
61,904 KB |
testcase_57 | AC | 44 ms
60,404 KB |
testcase_58 | WA | - |
testcase_59 | AC | 41 ms
61,660 KB |
testcase_60 | WA | - |
testcase_61 | AC | 40 ms
60,840 KB |
testcase_62 | AC | 43 ms
60,120 KB |
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)] ans = 0 for x in range(H+W+4): 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+2) 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, H+W+4): 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+2) 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)