結果

問題 No.2509 Beam Shateki
ユーザー sasa8uyauyasasa8uyauya
提出日時 2023-10-20 21:58:27
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,000 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 78,068 KB
最終ジャッジ日時 2023-10-20 21:59:27
合計ジャッジ時間 21,572 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 168 ms
76,708 KB
testcase_01 AC 166 ms
76,508 KB
testcase_02 AC 90 ms
75,528 KB
testcase_03 AC 1,680 ms
78,068 KB
testcase_04 AC 1,661 ms
78,068 KB
testcase_05 AC 1,667 ms
78,068 KB
testcase_06 AC 1,684 ms
78,068 KB
testcase_07 AC 1,671 ms
78,064 KB
testcase_08 AC 1,685 ms
78,068 KB
testcase_09 AC 1,676 ms
78,068 KB
testcase_10 AC 1,695 ms
78,068 KB
testcase_11 AC 1,668 ms
78,068 KB
testcase_12 AC 1,682 ms
78,068 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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w=map(int,input().split())
a=[[0]*(w+2)]
for i in range(h):
  a+=[[0]+list(map(int,input().split()))+[0]]
a+=[[0]*(w+2)]
v=[[0]*(w+2) for i in range(h+2)]
g=0
c=0
s=[]
for i in range(h+2):
  for j in range(w+2):
    if 1<=i<=h and 1<=j<=w:
      continue
    s+=[(i,j)]
for i1,j1 in s:
  for i2,j2 in s:
    for dx1 in [-1,0,1]:
      for dy1 in [-1,0,1]:
        for dx2 in [-1,0,1]:
          for dy2 in [-1,0,1]:
            if (dx1,dy1)==(0,0) or (dx2,dy2)==(0,0):
              continue
            c+=1
            p=0
            x1=i1
            y1=j1
            while 0<=x1+dx1<=h+1 and 0<=y1+dy1<=w+1:
              x1+=dx1
              y1+=dy1
              if v[x1][y1]!=c:
                v[x1][y1]=c
                p+=a[x1][y1]
            x2=i2
            y2=j2
            while 0<=x2+dx2<=h+1 and 0<=y2+dy2<=w+1:
              x2+=dx2
              y2+=dy2
              if v[x2][y2]!=c:
                v[x2][y2]=c
                p+=a[x2][y2]
            g=max(g,p)
print(g)
0