結果
問題 | No.2509 Beam Shateki |
ユーザー | miya145592 |
提出日時 | 2023-10-21 00:34:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,314 bytes |
コンパイル時間 | 225 ms |
コンパイル使用メモリ | 82,208 KB |
実行使用メモリ | 78,060 KB |
最終ジャッジ日時 | 2024-09-21 01:13:21 |
合計ジャッジ時間 | 40,966 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 48 ms
62,272 KB |
testcase_01 | AC | 45 ms
60,972 KB |
testcase_02 | AC | 38 ms
53,012 KB |
testcase_03 | AC | 284 ms
77,380 KB |
testcase_04 | AC | 290 ms
77,148 KB |
testcase_05 | AC | 286 ms
77,248 KB |
testcase_06 | AC | 282 ms
76,936 KB |
testcase_07 | AC | 289 ms
77,264 KB |
testcase_08 | AC | 290 ms
76,992 KB |
testcase_09 | AC | 293 ms
77,136 KB |
testcase_10 | AC | 289 ms
77,000 KB |
testcase_11 | AC | 287 ms
76,884 KB |
testcase_12 | AC | 288 ms
77,128 KB |
testcase_13 | AC | 1,342 ms
77,416 KB |
testcase_14 | AC | 1,337 ms
77,304 KB |
testcase_15 | AC | 1,340 ms
77,296 KB |
testcase_16 | AC | 1,335 ms
77,184 KB |
testcase_17 | AC | 1,332 ms
77,400 KB |
testcase_18 | AC | 1,354 ms
77,280 KB |
testcase_19 | AC | 1,333 ms
77,408 KB |
testcase_20 | AC | 1,343 ms
77,152 KB |
testcase_21 | AC | 1,330 ms
77,536 KB |
testcase_22 | AC | 1,334 ms
77,292 KB |
testcase_23 | AC | 1,340 ms
77,404 KB |
testcase_24 | AC | 1,342 ms
77,172 KB |
testcase_25 | AC | 1,338 ms
77,300 KB |
testcase_26 | AC | 1,332 ms
77,552 KB |
testcase_27 | AC | 1,344 ms
77,408 KB |
testcase_28 | AC | 1,338 ms
77,564 KB |
testcase_29 | AC | 1,340 ms
77,292 KB |
testcase_30 | AC | 1,324 ms
77,564 KB |
testcase_31 | WA | - |
testcase_32 | AC | 1,355 ms
77,212 KB |
testcase_33 | AC | 141 ms
77,068 KB |
testcase_34 | AC | 412 ms
77,300 KB |
testcase_35 | AC | 723 ms
77,420 KB |
testcase_36 | AC | 243 ms
76,680 KB |
testcase_37 | AC | 93 ms
76,308 KB |
testcase_38 | AC | 250 ms
78,060 KB |
testcase_39 | AC | 240 ms
77,304 KB |
testcase_40 | AC | 530 ms
77,860 KB |
testcase_41 | AC | 88 ms
76,416 KB |
testcase_42 | AC | 298 ms
77,780 KB |
testcase_43 | AC | 879 ms
77,412 KB |
testcase_44 | AC | 1,016 ms
77,940 KB |
testcase_45 | AC | 231 ms
76,976 KB |
testcase_46 | AC | 329 ms
76,800 KB |
testcase_47 | AC | 996 ms
77,296 KB |
testcase_48 | AC | 357 ms
77,120 KB |
testcase_49 | AC | 546 ms
77,272 KB |
testcase_50 | AC | 618 ms
77,304 KB |
testcase_51 | AC | 131 ms
76,168 KB |
testcase_52 | AC | 443 ms
77,012 KB |
testcase_53 | AC | 54 ms
63,888 KB |
testcase_54 | AC | 54 ms
63,168 KB |
testcase_55 | AC | 59 ms
64,404 KB |
testcase_56 | AC | 57 ms
66,236 KB |
testcase_57 | AC | 57 ms
65,460 KB |
testcase_58 | WA | - |
testcase_59 | AC | 56 ms
64,692 KB |
testcase_60 | WA | - |
testcase_61 | AC | 56 ms
66,024 KB |
testcase_62 | AC | 56 ms
65,180 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(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)