結果

問題 No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
ユーザー rlangevinrlangevin
提出日時 2023-05-21 16:51:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 941 ms
コンパイル使用メモリ 86,700 KB
実行使用メモリ 75,976 KB
最終ジャッジ日時 2023-08-23 15:12:43
合計ジャッジ時間 10,070 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,896 KB
testcase_01 AC 70 ms
70,872 KB
testcase_02 AC 69 ms
70,764 KB
testcase_03 AC 72 ms
70,868 KB
testcase_04 AC 79 ms
75,476 KB
testcase_05 AC 71 ms
70,596 KB
testcase_06 AC 75 ms
74,744 KB
testcase_07 AC 69 ms
70,736 KB
testcase_08 AC 70 ms
71,080 KB
testcase_09 AC 70 ms
70,940 KB
testcase_10 AC 68 ms
70,976 KB
testcase_11 AC 71 ms
71,116 KB
testcase_12 AC 70 ms
70,972 KB
testcase_13 AC 69 ms
71,072 KB
testcase_14 AC 72 ms
70,716 KB
testcase_15 AC 75 ms
75,580 KB
testcase_16 AC 67 ms
70,868 KB
testcase_17 AC 70 ms
70,980 KB
testcase_18 AC 75 ms
75,024 KB
testcase_19 AC 74 ms
74,936 KB
testcase_20 AC 74 ms
74,740 KB
testcase_21 AC 71 ms
70,924 KB
testcase_22 AC 70 ms
71,076 KB
testcase_23 AC 70 ms
70,900 KB
testcase_24 AC 71 ms
70,972 KB
testcase_25 AC 69 ms
70,864 KB
testcase_26 AC 71 ms
70,920 KB
testcase_27 AC 68 ms
70,724 KB
testcase_28 AC 69 ms
70,844 KB
testcase_29 AC 73 ms
70,972 KB
testcase_30 AC 74 ms
75,164 KB
testcase_31 AC 68 ms
70,760 KB
testcase_32 AC 71 ms
70,600 KB
testcase_33 AC 74 ms
75,044 KB
testcase_34 AC 78 ms
75,324 KB
testcase_35 AC 71 ms
70,916 KB
testcase_36 AC 72 ms
70,868 KB
testcase_37 AC 72 ms
70,760 KB
testcase_38 AC 70 ms
71,040 KB
testcase_39 AC 70 ms
70,948 KB
testcase_40 AC 67 ms
71,128 KB
testcase_41 AC 69 ms
71,108 KB
testcase_42 AC 68 ms
70,884 KB
testcase_43 AC 68 ms
70,868 KB
testcase_44 AC 70 ms
71,048 KB
testcase_45 AC 69 ms
70,808 KB
testcase_46 AC 80 ms
75,976 KB
testcase_47 AC 76 ms
74,940 KB
testcase_48 AC 75 ms
75,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
if 2 * K < N:
    print(-1)
    exit()
    
ans = []
for i in range(K):
    ans.append((i, i))
    
for i in range(K, N):
    ans.append((i, i - K))
    ans.append((i - K, i))
    
print(len(ans))
for a, b in ans:
    print(a + 1, b + 1)
0