結果

問題 No.115 遠足のおやつ
ユーザー 👑 KazunKazun
提出日時 2020-12-09 05:05:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 297 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 71,640 KB
最終ジャッジ日時 2023-08-31 01:01:13
合計ジャッジ時間 4,197 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
71,464 KB
testcase_01 AC 59 ms
71,500 KB
testcase_02 AC 58 ms
71,472 KB
testcase_03 AC 58 ms
71,364 KB
testcase_04 AC 58 ms
71,320 KB
testcase_05 AC 59 ms
71,472 KB
testcase_06 AC 61 ms
71,312 KB
testcase_07 AC 60 ms
71,156 KB
testcase_08 AC 59 ms
71,360 KB
testcase_09 AC 57 ms
71,276 KB
testcase_10 AC 59 ms
71,640 KB
testcase_11 AC 59 ms
71,468 KB
testcase_12 AC 63 ms
71,304 KB
testcase_13 AC 63 ms
71,292 KB
testcase_14 AC 62 ms
71,472 KB
testcase_15 AC 61 ms
71,624 KB
testcase_16 AC 62 ms
71,164 KB
testcase_17 AC 61 ms
71,400 KB
testcase_18 AC 60 ms
71,440 KB
testcase_19 AC 60 ms
71,472 KB
testcase_20 AC 60 ms
71,144 KB
testcase_21 AC 61 ms
71,416 KB
testcase_22 AC 59 ms
71,332 KB
testcase_23 AC 59 ms
71,300 KB
testcase_24 AC 59 ms
71,584 KB
testcase_25 AC 60 ms
71,572 KB
testcase_26 AC 59 ms
71,468 KB
testcase_27 AC 59 ms
71,276 KB
testcase_28 AC 60 ms
71,264 KB
testcase_29 AC 62 ms
71,360 KB
testcase_30 AC 60 ms
71,396 KB
testcase_31 AC 61 ms
71,400 KB
testcase_32 AC 61 ms
71,604 KB
testcase_33 AC 61 ms
71,384 KB
testcase_34 AC 59 ms
71,580 KB
testcase_35 AC 60 ms
71,356 KB
testcase_36 AC 58 ms
71,164 KB
testcase_37 AC 58 ms
71,416 KB
testcase_38 AC 60 ms
71,400 KB
testcase_39 AC 61 ms
71,348 KB
testcase_40 AC 61 ms
71,300 KB
testcase_41 AC 58 ms
71,304 KB
testcase_42 AC 57 ms
71,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,K=map(int,input().split())

if not K*(K+1)//2<=D<=(K*(2*N+1-K))//2:
    print(-1)
    exit(0)

T=list(range(N-K+1,N+1))
for i in range(K):
    T[i]=i+1
    if sum(T)<D:
        S=0
        for j in range(K):
            if i!=j:
                S+=T[j]
        T[i]=D-S
        break
print(*T)
0