結果
問題 |
No.607 開通777年記念
|
ユーザー |
![]() |
提出日時 | 2025-03-31 17:28:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 224 ms / 2,000 ms |
コード長 | 475 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 82,720 KB |
実行使用メモリ | 86,116 KB |
最終ジャッジ日時 | 2025-03-31 17:29:26 |
合計ジャッジ時間 | 1,988 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
n, m = map(int, input().split()) deltas = [list(map(int, input().split())) for _ in range(m)] current_s = [0] * n found = False for row in deltas: for j in range(n): current_s[j] += row[j] # Check for subarray sum 777 seen = {0} prefix = 0 for num in current_s: prefix += num if prefix - 777 in seen: found = True break seen.add(prefix) if found: break print("YES" if found else "NO")