結果
問題 | No.2509 Beam Shateki |
ユーザー | miya145592 |
提出日時 | 2023-10-20 23:33:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,608 bytes |
コンパイル時間 | 304 ms |
コンパイル使用メモリ | 82,504 KB |
実行使用メモリ | 78,744 KB |
最終ジャッジ日時 | 2024-09-20 23:34:09 |
合計ジャッジ時間 | 49,252 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
53,492 KB |
testcase_01 | AC | 38 ms
53,284 KB |
testcase_02 | AC | 37 ms
52,536 KB |
testcase_03 | AC | 313 ms
77,128 KB |
testcase_04 | AC | 310 ms
77,124 KB |
testcase_05 | AC | 304 ms
76,992 KB |
testcase_06 | AC | 309 ms
77,008 KB |
testcase_07 | AC | 317 ms
77,132 KB |
testcase_08 | AC | 312 ms
77,108 KB |
testcase_09 | AC | 307 ms
77,520 KB |
testcase_10 | AC | 313 ms
77,132 KB |
testcase_11 | AC | 317 ms
77,388 KB |
testcase_12 | AC | 308 ms
76,996 KB |
testcase_13 | AC | 1,717 ms
78,744 KB |
testcase_14 | AC | 1,690 ms
78,192 KB |
testcase_15 | AC | 1,670 ms
78,116 KB |
testcase_16 | AC | 1,668 ms
78,720 KB |
testcase_17 | AC | 1,685 ms
78,124 KB |
testcase_18 | AC | 1,704 ms
78,236 KB |
testcase_19 | AC | 1,722 ms
78,260 KB |
testcase_20 | AC | 1,699 ms
78,488 KB |
testcase_21 | WA | - |
testcase_22 | AC | 1,701 ms
78,136 KB |
testcase_23 | AC | 1,677 ms
77,988 KB |
testcase_24 | AC | 1,684 ms
78,392 KB |
testcase_25 | AC | 1,691 ms
78,316 KB |
testcase_26 | AC | 1,678 ms
78,228 KB |
testcase_27 | AC | 1,680 ms
78,252 KB |
testcase_28 | AC | 1,682 ms
78,256 KB |
testcase_29 | AC | 1,739 ms
78,652 KB |
testcase_30 | AC | 1,706 ms
78,112 KB |
testcase_31 | WA | - |
testcase_32 | AC | 1,660 ms
78,012 KB |
testcase_33 | AC | 129 ms
76,216 KB |
testcase_34 | AC | 459 ms
77,132 KB |
testcase_35 | AC | 847 ms
77,944 KB |
testcase_36 | AC | 241 ms
76,996 KB |
testcase_37 | AC | 90 ms
76,412 KB |
testcase_38 | AC | 261 ms
76,876 KB |
testcase_39 | AC | 235 ms
77,356 KB |
testcase_40 | AC | 532 ms
77,156 KB |
testcase_41 | AC | 84 ms
76,096 KB |
testcase_42 | AC | 292 ms
77,216 KB |
testcase_43 | AC | 1,051 ms
77,696 KB |
testcase_44 | AC | 1,246 ms
78,104 KB |
testcase_45 | AC | 238 ms
77,112 KB |
testcase_46 | AC | 347 ms
77,116 KB |
testcase_47 | AC | 1,243 ms
77,956 KB |
testcase_48 | AC | 419 ms
77,160 KB |
testcase_49 | AC | 659 ms
77,552 KB |
testcase_50 | AC | 706 ms
77,604 KB |
testcase_51 | AC | 118 ms
76,564 KB |
testcase_52 | AC | 473 ms
77,272 KB |
testcase_53 | WA | - |
testcase_54 | AC | 40 ms
59,712 KB |
testcase_55 | WA | - |
testcase_56 | AC | 45 ms
63,016 KB |
testcase_57 | AC | 49 ms
63,312 KB |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | WA | - |
ソースコード
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)