結果

問題 No.1619 Coccinellidae
ユーザー lloyzlloyz
提出日時 2022-11-02 00:08:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,328 KB
実行使用メモリ 82,552 KB
最終ジャッジ日時 2023-09-23 12:02:26
合計ジャッジ時間 3,422 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,448 KB
testcase_01 AC 95 ms
81,132 KB
testcase_02 AC 98 ms
82,476 KB
testcase_03 AC 69 ms
71,272 KB
testcase_04 AC 100 ms
82,484 KB
testcase_05 AC 93 ms
80,200 KB
testcase_06 AC 69 ms
71,476 KB
testcase_07 AC 91 ms
80,372 KB
testcase_08 AC 92 ms
80,296 KB
testcase_09 AC 70 ms
71,396 KB
testcase_10 AC 86 ms
78,424 KB
testcase_11 AC 93 ms
80,720 KB
testcase_12 AC 69 ms
71,360 KB
testcase_13 AC 94 ms
82,416 KB
testcase_14 AC 98 ms
82,552 KB
testcase_15 AC 67 ms
71,372 KB
testcase_16 AC 67 ms
71,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())

A = [i for i in range(n)]
sum_ = sum(A)
if sum_ < m:
    A[n - 1] += m - sum_

ANS = [-1 for _ in range(n)]
f, l = 0, n - 1
for i in range(n):
    if k >= n - i - 1:
        ANS[i] = A[l]
        l -= 1
        k -= n - i - 1
    else:
        ANS[i] = A[f]
        f += 1
print(*ANS, sep='\n')
0