結果

問題 No.1619 Coccinellidae
ユーザー keijakkeijak
提出日時 2021-07-23 19:13:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 994 ms
コンパイル使用メモリ 86,784 KB
実行使用メモリ 82,624 KB
最終ジャッジ日時 2023-09-25 18:12:35
合計ジャッジ時間 4,731 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,428 KB
testcase_01 AC 101 ms
81,072 KB
testcase_02 WA -
testcase_03 AC 75 ms
71,404 KB
testcase_04 AC 108 ms
82,420 KB
testcase_05 WA -
testcase_06 AC 80 ms
71,228 KB
testcase_07 AC 98 ms
80,276 KB
testcase_08 WA -
testcase_09 AC 78 ms
71,356 KB
testcase_10 AC 100 ms
80,016 KB
testcase_11 WA -
testcase_12 AC 76 ms
71,380 KB
testcase_13 AC 107 ms
82,220 KB
testcase_14 WA -
testcase_15 AC 76 ms
71,452 KB
testcase_16 AC 77 ms
71,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
v = [i for i in range(n)]
sv = sum(v)
assert(sv <= m)
v[n-1] += m - sv
a = [-1 for i in range(n)]

for i in range(n):
    r = n - 1 - i
    if k <= r:
        p = (n-1) - k
        a[p] = v[r]
        break
    a[i] = v[r]
cur = 0
for i in range(n):
    if a[i] != -1:
        continue
    a[i] = v[cur]
    cur += 1

print(*a, sep='\n')
0