結果
問題 |
No.607 開通777年記念
|
ユーザー |
|
提出日時 | 2018-01-19 16:20:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 408 bytes |
コンパイル時間 | 93 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-24 12:04:24 |
合計ジャッジ時間 | 2,947 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 1 |
ソースコード
def densya(): N, M = map(int, input().split()) a = [0 for _ in range(N)] isEnd = False for i in range(M): b = list(map(int, input().split())) a = [a[j] + b[j] for j in range(N)] sum = 0 left = 0 for right in range(N): sum += a[right] if sum > 777: sum = sum - a[left] left += 1 if sum == 777: isEnd = True return isEnd if densya(): print("YES") else: print("NO")