結果
問題 |
No.115 遠足のおやつ
|
ユーザー |
![]() |
提出日時 | 2015-12-10 23:38:10 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 372 bytes |
コンパイル時間 | 122 ms |
コンパイル使用メモリ | 6,784 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-09-15 07:44:28 |
合計ジャッジ時間 | 1,668 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 17 |
ソースコード
N, D, K = map(int, raw_input().split()) ans = range(1, K+1) d = D D -= sum(ans) if D < 0: ans = [-1] else: for i in xrange(K): if N - ans[-i-1] <= D: dif = N - ans[-i-1] ans[-i-1] += dif D -= dif else: ans[-i-1] += D break if sum(ans) != d: ans = [-1] for a in ans: print a,