結果

問題 No.1619 Coccinellidae
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-26 17:59:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 87,464 KB
最終ジャッジ日時 2023-09-19 02:56:27
合計ジャッジ時間 5,147 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,792 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 75 ms
71,268 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 77 ms
71,120 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 75 ms
70,760 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 73 ms
70,640 KB
testcase_16 AC 77 ms
70,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
cur = 0
A = []
for i in range(n):
    if i == n-1:
        A.append(m)
    else:
        A.append(cur)
        m -= cur
        cur += 1
ans = [-1]*n
j = 0
for i, a in enumerate(A):
    if k != 0:
        if k >= n-i-1:
            ans[-1+i] = a
            k -= n-i-1
        else:
            ans[k] = a
    else:
        while j < n:
            if ans[j] == -1:
                break
            else:
                j += 1
        ans[j] = a
        j += 1
print(*ans, sep='\n')
0