結果

問題 No.115 遠足のおやつ
ユーザー flippergoflippergo
提出日時 2021-01-01 15:44:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 446 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 71,656 KB
最終ジャッジ日時 2023-08-31 01:01:08
合計ジャッジ時間 4,909 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,396 KB
testcase_01 AC 71 ms
71,380 KB
testcase_02 AC 72 ms
71,580 KB
testcase_03 AC 67 ms
71,484 KB
testcase_04 AC 69 ms
71,160 KB
testcase_05 AC 68 ms
71,640 KB
testcase_06 AC 69 ms
71,412 KB
testcase_07 AC 69 ms
71,156 KB
testcase_08 AC 71 ms
71,524 KB
testcase_09 AC 69 ms
71,396 KB
testcase_10 AC 68 ms
71,604 KB
testcase_11 AC 68 ms
71,596 KB
testcase_12 AC 67 ms
71,472 KB
testcase_13 AC 69 ms
71,560 KB
testcase_14 AC 69 ms
71,320 KB
testcase_15 AC 67 ms
71,164 KB
testcase_16 AC 69 ms
71,376 KB
testcase_17 AC 69 ms
71,160 KB
testcase_18 AC 69 ms
71,560 KB
testcase_19 AC 71 ms
71,400 KB
testcase_20 AC 69 ms
71,420 KB
testcase_21 AC 70 ms
71,472 KB
testcase_22 AC 70 ms
71,512 KB
testcase_23 AC 70 ms
71,412 KB
testcase_24 AC 70 ms
71,312 KB
testcase_25 AC 69 ms
71,312 KB
testcase_26 AC 70 ms
71,592 KB
testcase_27 AC 69 ms
71,448 KB
testcase_28 AC 69 ms
71,284 KB
testcase_29 AC 70 ms
71,296 KB
testcase_30 AC 70 ms
71,656 KB
testcase_31 AC 69 ms
71,424 KB
testcase_32 AC 70 ms
71,300 KB
testcase_33 AC 67 ms
71,476 KB
testcase_34 AC 70 ms
71,316 KB
testcase_35 AC 69 ms
71,448 KB
testcase_36 AC 68 ms
71,368 KB
testcase_37 AC 70 ms
71,412 KB
testcase_38 AC 71 ms
71,472 KB
testcase_39 AC 69 ms
71,376 KB
testcase_40 AC 70 ms
71,544 KB
testcase_41 AC 71 ms
71,500 KB
testcase_42 AC 68 ms
71,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,K = map(int,input().split())
def check(i):
    if K==1:
        if i==D:
            return True
        else:
            return False
    if D<=i+((2*N-K+2)*(K-1))//2:
        return True
    else:
        return False
if D<((K+1)*K)//2 or D>((2*N-K+1)*K)//2:
    print(-1)
else:
    A = []
    for i in range(1,N+1):
        if check(i):
            A.append(i)
            D -= i
            K -= 1
            if K==0:break
    print(*A)
0