結果

問題 No.1619 Coccinellidae
ユーザー ayaoniayaoni
提出日時 2021-07-22 22:24:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 857 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 79,524 KB
最終ジャッジ日時 2023-09-24 17:34:09
合計ジャッジ時間 3,484 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,196 KB
testcase_01 AC 99 ms
78,680 KB
testcase_02 AC 100 ms
79,524 KB
testcase_03 AC 74 ms
71,236 KB
testcase_04 AC 98 ms
79,492 KB
testcase_05 AC 94 ms
78,188 KB
testcase_06 AC 72 ms
70,916 KB
testcase_07 AC 96 ms
78,388 KB
testcase_08 AC 96 ms
78,488 KB
testcase_09 AC 72 ms
71,076 KB
testcase_10 AC 90 ms
77,480 KB
testcase_11 AC 96 ms
78,744 KB
testcase_12 AC 72 ms
71,256 KB
testcase_13 AC 96 ms
79,156 KB
testcase_14 AC 100 ms
79,380 KB
testcase_15 AC 73 ms
71,160 KB
testcase_16 AC 73 ms
71,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N,M,K = MI()
X = [i for i in range(N-1)]
X.append(M-(N-2)*(N-1)//2)

ANS = [-1]*N
for i in range(N):
    if K > N-1-i:
        K -= N-1-i
        ANS[N-1-i] = i
    else:
        ANS[K] = i
        n = i+1
        for j in range(K):
            ANS[j] = n
            n += 1
        for j in range(K+1,N-i):
            ANS[j] = n
            n += 1
        break

for i in range(N):
    print(X[ANS[i]])
0