結果
問題 | No.607 開通777年記念 |
ユーザー |
![]() |
提出日時 | 2019-08-09 16:13:05 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 756 ms / 2,000 ms |
コード長 | 524 bytes |
コンパイル時間 | 82 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-19 07:38:45 |
合計ジャッジ時間 | 3,176 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
N, M = map(int, input().split())t = [0] * Nfor _ in range(M):a = list(map(int, input().split()))for i in range(N):t[i] += a[i]right, s = 0, 0for left in range(N):while right < N and s + t[right] <= 777:s += t[right]right += 1if s == 777:print('YES')breakif left == right:right += 1else:s -= t[left]else:continuebreakelse:print('NO')