結果
問題 | No.607 開通777年記念 |
ユーザー |
![]() |
提出日時 | 2025-03-26 15:44:20 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 218 ms / 2,000 ms |
コード長 | 538 bytes |
コンパイル時間 | 286 ms |
コンパイル使用メモリ | 82,248 KB |
実行使用メモリ | 77,184 KB |
最終ジャッジ日時 | 2025-03-26 15:44:22 |
合計ジャッジ時間 | 2,380 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
def has_subarray(arr, target):prefix_set = {0}current_sum = 0for num in arr:current_sum += numif (current_sum - target) in prefix_set:return Trueprefix_set.add(current_sum)return Falsen, m = map(int, input().split())current_sums = [0] * nfound = Falsefor _ 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 = Truebreakprint("YES" if found else "NO")