結果
問題 |
No.115 遠足のおやつ
|
ユーザー |
![]() |
提出日時 | 2017-06-14 21:55:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 283 bytes |
コンパイル時間 | 133 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 21,376 KB |
最終ジャッジ日時 | 2024-09-24 23:16:29 |
合計ジャッジ時間 | 7,264 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 3 WA * 1 TLE * 1 -- * 35 |
ソースコード
N,D,K = map(int,input().split()) ans = [-1] * K def dfs(n,d,k): if k == 0: return d == 0 for i in range(n+1,N+1): if d-i < 0 or d < k * i: continue if dfs(n+1,d-i,k-1): ans[n] = i return True return False print(' '.join([str(a) for a in ans]) if dfs(0,D,K) else -1)