結果
| 問題 |
No.2509 Beam Shateki
|
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2023-10-20 23:07:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 597 bytes |
| コンパイル時間 | 382 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 80,128 KB |
| 最終ジャッジ日時 | 2024-09-20 22:09:30 |
| 合計ジャッジ時間 | 52,815 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 57 WA * 4 |
ソースコード
from itertools import product
h,w = map(int,input().split())
a = [[0]*(w+3)]+[[0]+list(map(int,input().split()))+[0,0] for _ in range(h)]+[[0]*(w+3),[0]*(w+3)]
s = []; ans = 0
for x in range(h+2):
for dx in range(-1,2):
px = x+dx; py = 1; t = set()
while a[px][py]: t.add((px,py)); px += dx; py += 1
s.append(t)
for y in range(w+2):
for dy in range(-1,2):
px = 1; py = y+dy; t = set()
while a[px][py]: t.add((px,py)); px += 1; py += dy
s.append(t)
for si in s:
for sj in s:
ans = max(ans,sum(a[x][y] for x,y in si|sj))
print(ans)
ニックネーム