結果

問題 No.1619 Coccinellidae
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-26 18:04:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 82,636 KB
最終ジャッジ日時 2023-09-19 02:56:41
合計ジャッジ時間 4,328 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,392 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 79 ms
71,396 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 77 ms
71,252 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 77 ms
71,104 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 81 ms
71,284 KB
testcase_16 AC 78 ms
71,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
A = [i for i in range(n)]
A[-1] += m-sum(A)
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 ans[j] != -1:
            j += 1
        ans[j] = a
        j += 1
print(*ans, sep='\n')
0