結果
問題 | No.607 開通777年記念 |
ユーザー |
|
提出日時 | 2022-06-23 06:39:02 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 189 ms / 2,000 ms |
コード長 | 880 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 82,832 KB |
実行使用メモリ | 78,080 KB |
最終ジャッジ日時 | 2024-11-06 19:32:44 |
合計ジャッジ時間 | 2,550 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
# import pypyjit# pypyjit.set_param('max_unroll_recursion=-1')import sysfrom itertools import combinations, permutations, product, accumulate, groupbyfrom collections import defaultdict, deque, Counterfrom functools import reducefrom operator import add, mulimport heapqimport bisectimport mathimport copysys.setrecursionlimit(10 ** 9)input = lambda: sys.stdin.readline().rstrip()INF = float("inf")MOD = 10 ** 9 + 7N,M = map(int, input().split())TRAIN = [0]*Nans = Falsefor _ in range(M):L = list(map(int,input().split()))for i in range(N):TRAIN[i] += L[i]passenger=0que = deque()for i in range(N):passenger += TRAIN[i]que.append(TRAIN[i])while passenger > 777:passenger -= que.popleft()if passenger == 777:ans = Trueif ans:print('YES')else:print('NO')