結果

問題 No.115 遠足のおやつ
ユーザー 👑 colognecologne
提出日時 2022-02-03 01:43:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 71,612 KB
最終ジャッジ日時 2023-09-02 03:03:36
合計ジャッジ時間 5,770 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,088 KB
testcase_01 AC 71 ms
71,424 KB
testcase_02 AC 67 ms
71,524 KB
testcase_03 AC 68 ms
71,456 KB
testcase_04 AC 67 ms
71,236 KB
testcase_05 AC 67 ms
71,136 KB
testcase_06 AC 67 ms
71,256 KB
testcase_07 AC 68 ms
71,428 KB
testcase_08 AC 67 ms
71,112 KB
testcase_09 AC 67 ms
71,240 KB
testcase_10 AC 67 ms
71,612 KB
testcase_11 AC 66 ms
71,408 KB
testcase_12 AC 69 ms
71,428 KB
testcase_13 AC 67 ms
71,260 KB
testcase_14 AC 66 ms
71,364 KB
testcase_15 AC 68 ms
71,112 KB
testcase_16 AC 69 ms
71,400 KB
testcase_17 AC 69 ms
71,112 KB
testcase_18 AC 68 ms
71,416 KB
testcase_19 AC 68 ms
71,108 KB
testcase_20 AC 68 ms
71,248 KB
testcase_21 AC 70 ms
71,436 KB
testcase_22 AC 69 ms
71,112 KB
testcase_23 AC 69 ms
71,144 KB
testcase_24 AC 67 ms
71,360 KB
testcase_25 AC 69 ms
71,084 KB
testcase_26 AC 67 ms
71,248 KB
testcase_27 AC 68 ms
71,584 KB
testcase_28 AC 69 ms
71,520 KB
testcase_29 AC 67 ms
71,272 KB
testcase_30 AC 66 ms
71,344 KB
testcase_31 AC 68 ms
71,244 KB
testcase_32 AC 70 ms
71,376 KB
testcase_33 AC 67 ms
71,460 KB
testcase_34 AC 67 ms
71,100 KB
testcase_35 AC 67 ms
71,260 KB
testcase_36 AC 67 ms
71,556 KB
testcase_37 AC 66 ms
71,284 KB
testcase_38 AC 66 ms
71,520 KB
testcase_39 AC 68 ms
71,264 KB
testcase_40 AC 67 ms
71,080 KB
testcase_41 AC 68 ms
71,340 KB
testcase_42 AC 69 ms
71,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def input(): return sys.stdin.readline().rstrip()


def main():
    N, D, K = map(int, input().split())
    if K > N or D < K*(K+1)//2 or D > K*(2*N-K+1)//2:
        print(-1)
        return

    ans = []
    for i in range(1, K+1):
        max_rem = (K-i)*(2*N-(K-i)+1)//2
        cur = max(i, D-max_rem)
        D -= cur
        ans.append(cur)

    print(*ans)


if __name__ == '__main__':
    main()
0