結果

問題 No.1619 Coccinellidae
ユーザー shotoyooshotoyoo
提出日時 2021-07-22 23:10:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 834 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 87,348 KB
実行使用メモリ 80,720 KB
最終ジャッジ日時 2023-09-24 19:10:32
合計ジャッジ時間 3,724 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,380 KB
testcase_01 AC 85 ms
79,440 KB
testcase_02 AC 86 ms
80,608 KB
testcase_03 AC 68 ms
71,232 KB
testcase_04 AC 81 ms
80,720 KB
testcase_05 AC 80 ms
78,632 KB
testcase_06 WA -
testcase_07 AC 81 ms
78,628 KB
testcase_08 AC 84 ms
78,632 KB
testcase_09 WA -
testcase_10 AC 80 ms
78,264 KB
testcase_11 AC 85 ms
79,088 KB
testcase_12 AC 69 ms
71,292 KB
testcase_13 AC 82 ms
80,388 KB
testcase_14 AC 84 ms
80,520 KB
testcase_15 AC 68 ms
71,176 KB
testcase_16 AC 67 ms
71,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))


n,m,k = list(map(int, input().split()))
def sub(n,m,k):
    k0 = k
    l = list(range(1,n+1))
    l[-1] = m - (n-1)*(n)//2
    l.sort()
#     print(l)
    ans = [-1]*n
    done = [0]*n
    for v in range(n, 0, -1):
        i = n - v
        if k>v-1:
            k -= v-1
            ans[v-1] = l[i]
            done[i] = 1
        else:
            ans[k] = l[i]
            done[i] = 1
            break
    j = 0
    for i in range(n):
        while j<n and ans[j]>=0:
            j += 1
        if not done[i]:
            ans[j] = l[i]
#     print(ans, k)
    write("\n".join(map(str, ans)))
sub(n,m,k)
0