結果
問題 | No.607 開通777年記念 |
ユーザー |
![]() |
提出日時 | 2018-05-19 12:43:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 908 ms / 2,000 ms |
コード長 | 401 bytes |
コンパイル時間 | 202 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 15,616 KB |
最終ジャッジ日時 | 2024-06-28 14:21:33 |
合計ジャッジ時間 | 3,126 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
import sys N, M = map(int, input().split()) a = [0] * N for l in sys.stdin.readlines(): a = [n+m for n, m in zip(a, map(int, l.split()))]+[0] i, j, total = 0, 1, a[0] while j <= N: if total == 777: print("YES") exit() if total < 777: total += a[j] j += 1 else: total -= a[i] i += 1 print("NO")