結果

問題 No.1619 Coccinellidae
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-07-22 23:39:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 85,308 KB
最終ジャッジ日時 2023-09-24 20:10:49
合計ジャッジ時間 3,490 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,384 KB
testcase_01 AC 105 ms
83,108 KB
testcase_02 AC 99 ms
85,080 KB
testcase_03 AC 71 ms
71,228 KB
testcase_04 AC 97 ms
85,308 KB
testcase_05 AC 94 ms
80,920 KB
testcase_06 AC 72 ms
71,492 KB
testcase_07 AC 97 ms
81,632 KB
testcase_08 AC 97 ms
81,244 KB
testcase_09 AC 71 ms
71,372 KB
testcase_10 AC 92 ms
80,852 KB
testcase_11 AC 98 ms
82,464 KB
testcase_12 AC 71 ms
71,332 KB
testcase_13 AC 99 ms
85,156 KB
testcase_14 AC 102 ms
84,508 KB
testcase_15 AC 71 ms
71,384 KB
testcase_16 AC 70 ms
71,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k = map(int,input().split())
ans = []
for i in range(n):
    if i == n-1:
        ans.append(m-(i-1)*i//2)
    else:
        ans.append(i)
N = n-1
cnt = 0
goukei = 0
while goukei < k:
    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