結果

問題 No.1635 Let’s Sort Integers!!
ユーザー るさるさ
提出日時 2021-08-14 10:35:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 726 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 192,780 KB
最終ジャッジ日時 2024-04-15 07:43:07
合計ジャッジ時間 18,331 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,292 KB
testcase_01 AC 37 ms
52,616 KB
testcase_02 AC 38 ms
53,000 KB
testcase_03 AC 38 ms
52,204 KB
testcase_04 AC 37 ms
52,572 KB
testcase_05 AC 37 ms
53,312 KB
testcase_06 AC 37 ms
53,312 KB
testcase_07 AC 37 ms
52,580 KB
testcase_08 AC 37 ms
52,820 KB
testcase_09 AC 38 ms
52,488 KB
testcase_10 AC 38 ms
52,552 KB
testcase_11 AC 38 ms
52,532 KB
testcase_12 AC 37 ms
52,792 KB
testcase_13 AC 37 ms
52,368 KB
testcase_14 AC 37 ms
53,256 KB
testcase_15 AC 38 ms
52,956 KB
testcase_16 AC 38 ms
52,316 KB
testcase_17 AC 38 ms
52,600 KB
testcase_18 AC 37 ms
53,804 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 38 ms
53,380 KB
testcase_28 AC 38 ms
52,928 KB
testcase_29 AC 37 ms
52,504 KB
testcase_30 AC 37 ms
52,864 KB
testcase_31 AC 38 ms
52,940 KB
testcase_32 AC 37 ms
53,008 KB
testcase_33 AC 38 ms
52,948 KB
testcase_34 AC 38 ms
52,200 KB
testcase_35 AC 38 ms
53,424 KB
testcase_36 AC 37 ms
53,280 KB
testcase_37 AC 37 ms
52,692 KB
testcase_38 AC 38 ms
52,448 KB
testcase_39 AC 37 ms
52,004 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 39 ms
53,612 KB
testcase_48 AC 38 ms
53,712 KB
testcase_49 AC 39 ms
53,820 KB
testcase_50 AC 40 ms
53,288 KB
testcase_51 AC 42 ms
58,860 KB
testcase_52 AC 39 ms
52,820 KB
testcase_53 AC 37 ms
53,288 KB
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 37 ms
52,756 KB
testcase_60 AC 260 ms
189,684 KB
testcase_61 AC 234 ms
192,780 KB
testcase_62 AC 253 ms
184,968 KB
testcase_63 AC 233 ms
189,820 KB
testcase_64 AC 236 ms
185,084 KB
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 AC 111 ms
134,352 KB
testcase_69 AC 38 ms
52,392 KB
testcase_70 AC 225 ms
189,344 KB
testcase_71 AC 235 ms
186,296 KB
testcase_72 AC 237 ms
190,536 KB
testcase_73 AC 233 ms
185,732 KB
testcase_74 AC 241 ms
186,228 KB
testcase_75 WA -
testcase_76 WA -
testcase_77 WA -
testcase_78 AC 108 ms
134,220 KB
testcase_79 AC 37 ms
52,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int, input().split())
fst = [0]
bst = []
f = True
k -= n-1
if k < 0:
    print(-1)
    exit()
for i in range(n-1, 0, -1):
    if k < i-1:
        break
    if f:
        bst.append(n-i)
    else:
        fst.append(n-i)
    k -= i-1
    f = not f
else:
    if k:
        print(-1)
        exit()
    i = 0
#print(f, i)
if f:
    for i in range(n-i, n-k-1):
        fst.append(i)
    if i != 0: fst.append(n-1)
    for i in range(n-k-1, n-1):
        fst.append(i)
else:
    for i in range(n-i, n-k-1):
        bst.append(i)
    if i != 0: bst.append(n-1)
    for i in range(n-k-1, n-1):
        bst.append(i)

ans = [0] * n
bst.reverse()
st = fst + bst
#print(st)
for i in range(n):
    ans[st[i]] = i+1
print(*ans)
0