結果

問題 No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-06-17 21:50:54
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 347 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 82,096 KB
実行使用メモリ 67,144 KB
最終ジャッジ日時 2024-04-17 13:33:59
合計ジャッジ時間 6,225 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,788 KB
testcase_01 AC 36 ms
52,628 KB
testcase_02 AC 36 ms
52,192 KB
testcase_03 AC 43 ms
55,316 KB
testcase_04 AC 46 ms
61,424 KB
testcase_05 AC 39 ms
53,904 KB
testcase_06 AC 43 ms
59,484 KB
testcase_07 AC 37 ms
52,740 KB
testcase_08 AC 36 ms
52,000 KB
testcase_09 AC 36 ms
52,836 KB
testcase_10 AC 38 ms
53,420 KB
testcase_11 AC 38 ms
53,580 KB
testcase_12 AC 36 ms
53,284 KB
testcase_13 AC 37 ms
52,328 KB
testcase_14 AC 39 ms
54,492 KB
testcase_15 AC 45 ms
61,080 KB
testcase_16 AC 35 ms
53,200 KB
testcase_17 AC 35 ms
53,032 KB
testcase_18 AC 43 ms
60,324 KB
testcase_19 AC 42 ms
59,160 KB
testcase_20 AC 43 ms
59,340 KB
testcase_21 AC 38 ms
52,880 KB
testcase_22 AC 35 ms
52,896 KB
testcase_23 AC 36 ms
53,548 KB
testcase_24 AC 36 ms
52,984 KB
testcase_25 AC 37 ms
52,884 KB
testcase_26 AC 39 ms
53,776 KB
testcase_27 AC 36 ms
53,196 KB
testcase_28 AC 36 ms
51,956 KB
testcase_29 AC 39 ms
53,384 KB
testcase_30 AC 44 ms
59,728 KB
testcase_31 AC 37 ms
52,364 KB
testcase_32 AC 38 ms
53,040 KB
testcase_33 AC 42 ms
59,564 KB
testcase_34 AC 48 ms
61,276 KB
testcase_35 AC 37 ms
53,760 KB
testcase_36 AC 40 ms
55,596 KB
testcase_37 AC 41 ms
54,880 KB
testcase_38 AC 36 ms
52,184 KB
testcase_39 AC 36 ms
52,080 KB
testcase_40 AC 36 ms
53,836 KB
testcase_41 AC 36 ms
53,436 KB
testcase_42 RE -
testcase_43 AC 37 ms
53,476 KB
testcase_44 AC 35 ms
52,500 KB
testcase_45 AC 35 ms
53,048 KB
testcase_46 AC 48 ms
64,716 KB
testcase_47 AC 42 ms
61,216 KB
testcase_48 AC 43 ms
59,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
if k == 0 or k < n//2:
    print(-1)
    exit()
ans = [[i,i] for i in range(1,n+1)]

sans = []
k = n-k
while k:
    a,b = ans.pop()
    c,d = ans.pop()
    sans.append([a,d])
    sans.append([a,b])
    sans.append([c,d])
    k -= 1

while ans:
    sans.append(ans.pop())
print(len(sans))
for i in sans:
    print(*i)
0