結果
| 問題 | No.2509 Beam Shateki |
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2023-10-20 23:07:40 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 597 bytes |
| 記録 | |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 95,684 KB |
| 実行使用メモリ | 87,776 KB |
| 最終ジャッジ日時 | 2026-09-01 01:06:51 |
| 合計ジャッジ時間 | 50,178 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
ニックネーム