結果

問題 No.1619 Coccinellidae
ユーザー trineutrontrineutron
提出日時 2021-07-22 21:49:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 12,080 KB
最終ジャッジ日時 2023-09-24 16:29:20
合計ジャッジ時間 3,471 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,804 KB
testcase_01 AC 116 ms
11,080 KB
testcase_02 AC 123 ms
11,840 KB
testcase_03 AC 15 ms
7,724 KB
testcase_04 AC 141 ms
11,844 KB
testcase_05 AC 74 ms
10,264 KB
testcase_06 AC 15 ms
7,796 KB
testcase_07 AC 93 ms
10,316 KB
testcase_08 AC 81 ms
10,416 KB
testcase_09 AC 15 ms
7,804 KB
testcase_10 AC 80 ms
9,992 KB
testcase_11 AC 98 ms
10,812 KB
testcase_12 AC 16 ms
7,844 KB
testcase_13 AC 139 ms
11,840 KB
testcase_14 AC 115 ms
12,080 KB
testcase_15 AC 16 ms
7,760 KB
testcase_16 AC 15 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = [-1] * n
used = 0

for i in range(n):
    if k == 0:
        break
    if k >= n - 1 - i:
        ans[n - 1 - i] = i
        k -= n - 1 - i
    else:
        ans[k] = i
        k = 0
    used += 1

for i in range(n):
    if ans[i] == -1:
        ans[i] = used
        used += 1
        if used == n:
            ans[i] = m - (n - 1) * (n - 2) // 2
    print(ans[i])
0