結果
| 問題 |
No.607 開通777年記念
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-21 14:04:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 157 ms / 2,000 ms |
| コード長 | 450 bytes |
| コンパイル時間 | 239 ms |
| コンパイル使用メモリ | 82,308 KB |
| 実行使用メモリ | 85,672 KB |
| 最終ジャッジ日時 | 2024-11-25 09:03:49 |
| 合計ジャッジ時間 | 1,730 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
from collections import deque
n,m=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(m)]
for i in range(1,m):
for j in range(n):
a[i][j]+=a[i-1][j]
for i in range(m):
q=deque()
now=0
for j in range(n):
now+=a[i][j]
q.append(a[i][j])
while q and now>777:
out=q.popleft()
now-=out
if now==777:
print('YES')
exit()
print('NO')