結果
問題 |
No.115 遠足のおやつ
|
ユーザー |
![]() |
提出日時 | 2015-12-10 23:36:26 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 370 bytes |
コンパイル時間 | 39 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-09-15 07:44:26 |
合計ジャッジ時間 | 1,548 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 14 WA * 26 |
ソースコード
N, D, K = map(int, raw_input().split()) ans = range(1, K+1) 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,