結果
| 問題 | No.3715 Tomorrow is MONDAY!!!!!! |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2026-09-18 21:48:22 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 109 ms / 2,000 ms |
| + 333µs | |
| コード長 | 364 bytes |
| 記録 | |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 80,768 KB |
| 実行使用メモリ | 116,224 KB |
| 最終ジャッジ日時 | 2026-09-18 21:48:33 |
| 合計ジャッジ時間 | 5,150 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
k, n = map(int, input().split())
d = list(map(int, input().split()))
before = 0
after = sum(d) - k
s = 0
for d in d:
after -= d - 1
cand = []
pre = (s - 1) % n + 1
if pre <= before: cand.append(pre)
nxt = n - (s + d - 1) % n
if nxt <= after: cand.append(nxt)
ans = min(cand) if cand else -1
before += d - 1
s += d
print(ans)
Kude