結果

問題 No.1619 Coccinellidae
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-26 18:06:48
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 82,680 KB
最終ジャッジ日時 2023-09-19 02:57:07
合計ジャッジ時間 3,615 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,276 KB
testcase_01 AC 105 ms
81,360 KB
testcase_02 AC 102 ms
82,356 KB
testcase_03 AC 76 ms
71,400 KB
testcase_04 AC 103 ms
82,680 KB
testcase_05 AC 99 ms
79,976 KB
testcase_06 AC 73 ms
71,424 KB
testcase_07 AC 96 ms
80,260 KB
testcase_08 AC 97 ms
80,364 KB
testcase_09 AC 73 ms
71,380 KB
testcase_10 AC 92 ms
78,656 KB
testcase_11 AC 100 ms
80,836 KB
testcase_12 AC 75 ms
71,272 KB
testcase_13 AC 102 ms
82,360 KB
testcase_14 AC 104 ms
82,552 KB
testcase_15 AC 74 ms
71,380 KB
testcase_16 AC 75 ms
71,188 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
            k = 0
    else:
        while ans[j] != -1:
            j += 1
        ans[j] = a
        j += 1
print(*ans, sep='\n')
0