結果

問題 No.2509 Beam Shateki
ユーザー sasa8uyauyasasa8uyauya
提出日時 2023-10-20 21:54:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,141 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 81,636 KB
実行使用メモリ 84,036 KB
最終ジャッジ日時 2023-10-20 21:55:18
合計ジャッジ時間 22,692 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
84,036 KB
testcase_01 AC 168 ms
76,492 KB
testcase_02 AC 92 ms
75,532 KB
testcase_03 AC 1,836 ms
78,556 KB
testcase_04 AC 1,793 ms
78,556 KB
testcase_05 AC 1,786 ms
78,556 KB
testcase_06 AC 1,789 ms
78,556 KB
testcase_07 AC 1,793 ms
78,556 KB
testcase_08 AC 1,782 ms
78,556 KB
testcase_09 AC 1,790 ms
78,556 KB
testcase_10 AC 1,788 ms
78,556 KB
testcase_11 AC 1,792 ms
78,556 KB
testcase_12 AC 1,787 ms
78,556 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
for i1 in range(h+2):
  for j1 in range(w+2):
    for i2 in range(h+2):
      for j2 in range(w+2):
        if (1<=i1<=h and 1<=j1<=w) or (1<=i2<=h and 1<=j2<=w):
          continue
        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