結果

問題 No.115 遠足のおやつ
ユーザー roaris
提出日時 2019-07-31 19:01:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 266 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,436 KB
最終ジャッジ日時 2024-07-05 06:53:57
合計ジャッジ時間 8,344 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 TLE * 1 -- * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

N, D, K = map(int, input().split())
l = [i for i in range(1, N+1)]

for c in combinations(l, K):
    if sum(c) == D:
        for c_i in c[:-1]:
            print(c_i, end=' ')
        print(c[-1])
        break
else:
    print(-1)
0