結果
問題 | No.2509 Beam Shateki |
ユーザー |
|
提出日時 | 2023-10-20 22:00:06 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,195 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 81,796 KB |
実行使用メモリ | 76,604 KB |
最終ジャッジ日時 | 2023-10-20 22:00:37 |
合計ジャッジ時間 | 11,777 ms |
ジャッジサーバーID (参考情報) |
judge10 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 55 ms
66,336 KB |
testcase_01 | AC | 58 ms
66,340 KB |
testcase_02 | AC | 36 ms
53,544 KB |
testcase_03 | AC | 743 ms
76,604 KB |
testcase_04 | AC | 716 ms
76,604 KB |
testcase_05 | AC | 760 ms
76,444 KB |
testcase_06 | AC | 720 ms
76,604 KB |
testcase_07 | AC | 753 ms
76,604 KB |
testcase_08 | AC | 752 ms
76,604 KB |
testcase_09 | AC | 714 ms
76,604 KB |
testcase_10 | AC | 744 ms
76,604 KB |
testcase_11 | AC | 715 ms
76,604 KB |
testcase_12 | AC | 746 ms
76,604 KB |
testcase_13 | TLE | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
testcase_56 | -- | - |
testcase_57 | -- | - |
testcase_58 | -- | - |
testcase_59 | -- | - |
testcase_60 | -- | - |
testcase_61 | -- | - |
testcase_62 | -- | - |
testcase_63 | -- | - |
ソースコード
import sys input = sys.stdin.readline h,w = map(int,input().split()) grid = [] for i in range(h): grid.append(list(map(int,input().split()))) ans = 0 dxy = [[[1,-1],[1,0],[1,1]],[[-1,-1],[-1,0],[-1,1]],[[-1,1],[0,1],[1,1]],[[-1,-1],[0,-1],[1,-1]]] s = set() for j in range(w+2): s.add((0,j,0)) s.add((h,j,1)) for j in range(h+2): s.add((j,0,2)) s.add((j,w,3)) for x,y,e in s: for dx,dy in dxy[e]: temp = 1 cnt = 0 se = set() while 1 <= x+dx*temp <= h and 1 <= y+dy*temp <= w: cnt += grid[x+dx*temp-1][y+dy*temp-1] se.add((x+dx*temp-1,y+dy*temp-1)) temp += 1 if temp == 1: continue for u,v,o in s: if x == u and y == v: continue for dx,dy in dxy[o]: c = 0 temp = 1 while 1 <= u+dx*temp <= h and 1 <= v+dy*temp <= w: if (u+dx*temp-1,v+dy*temp-1) in se: temp += 1 continue c += grid[u+dx*temp-1][v+dy*temp-1] temp += 1 ans = max(ans,cnt+c) print(ans)