結果
| 問題 | No.607 開通777年記念 |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-26 15:44:20 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 150 ms / 2,000 ms |
| コード長 | 538 bytes |
| 記録 | |
| コンパイル時間 | 224 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 85,344 KB |
| 最終ジャッジ日時 | 2026-07-07 22:03:44 |
| 合計ジャッジ時間 | 2,937 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
def has_subarray(arr, target):
prefix_set = {0}
current_sum = 0
for num in arr:
current_sum += num
if (current_sum - target) in prefix_set:
return True
prefix_set.add(current_sum)
return False
n, m = map(int, input().split())
current_sums = [0] * n
found = False
for _ in range(m):
a = list(map(int, input().split()))
for j in range(n):
current_sums[j] += a[j]
if has_subarray(current_sums, 777):
found = True
break
print("YES" if found else "NO")
lam6er