結果
| 問題 |
No.115 遠足のおやつ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-20 10:09:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 311 bytes |
| コンパイル時間 | 389 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 52,352 KB |
| 最終ジャッジ日時 | 2024-11-23 14:27:20 |
| 合計ジャッジ時間 | 3,410 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 WA * 2 |
ソースコード
n, d, k = map(int, input().split())
ans = [i for i in range(1, k + 1)]
d -= sum(ans)
if d < 0 or k > n:
print(-1)
exit()
r = n
for i in range(k - 1, -1, -1):
while ans[i] != r:
ans[i] += 1
d -= 1
if d == 0:
print(*ans)
exit()
r -= 1
print(-1)