結果

問題 No.115 遠足のおやつ
コンテスト
ユーザー しらっ亭
提出日時 2015-12-21 05:46:57
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 406 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 292 ms
コンパイル使用メモリ 21,280 KB
実行使用メモリ 15,868 KB
最終ジャッジ日時 2026-08-29 20:27:45
合計ジャッジ時間 6,165 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 14 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def solve():
    N, D, K = list(map(int, input().split()))

    L = list(range(N+1))

    last = 0
    ans = []
    while K:
        can = sum(range((N + 1) - (K - 1), N + 1))
        last = max(last + 1, D - can)
        ans.append(last)
        D -= last
        K -= 1
    if D != 0 or can == 0:
        print(-1)
    else:
        print(' '.join(map(str, ans)))


if __name__ == '__main__':
    solve()
0