結果
問題 | No.607 開通777年記念 |
ユーザー |
|
提出日時 | 2019-09-03 16:55:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 835 ms / 2,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-12-24 06:32:51 |
合計ジャッジ時間 | 3,228 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
import sysinput = sys.stdin.readlinesys.setrecursionlimit(1000000)##############################N, M = map(int, input().split())A = [0] * Nfor i in range(M):a = list(map(int, input().split()))for j in range(len(a)):A[j] += a[j]# print(A)count = A[0]right = 1for left in range(N):while right < N and count + A[right] <= 777:count += A[right]right += 1# print(left, right, count, A)if count == 777:print('YES')exit()if left == right:right += 1else:count -= A[left]print('NO')