結果

問題 No.1619 Coccinellidae
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-07-22 23:21:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 497 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 84,464 KB
最終ジャッジ日時 2023-09-24 19:33:21
合計ジャッジ時間 3,983 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n,m,k = map(int,input().split())
ans = []
for i in range(n):
    if i == n-1:
        ans.append(m-(1 + i)*i//2)
    else:
        ans.append(i+1)
N = n-1
cnt = 0
goukei = 0
while True:
    if goukei + N > k:
        break
    goukei += N
    N -= 1
    cnt += 1
if cnt == 0:
    ll = []
else:
    ll = ans[-cnt::]
ll.sort(reverse = True)
lll = ans[:n-cnt]
for j in range(k - goukei):
    lll[-(j+1)] ,lll[-(j + 2)] = lll[-(j + 2)]  ,lll[-(j+1)]
ans = ll + lll
for i in range(n):
    print(ans[i])
0