結果

問題 No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
ユーザー ikoma
提出日時 2022-06-17 22:43:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 276 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 64,252 KB
最終ジャッジ日時 2024-10-09 09:00:17
合計ジャッジ時間 6,207 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,K=map(int,input().split())

if K==0:
    print(-1)
    exit()

edge = [(1,2)]
for i in range(2,N+1):
    if K<N:
        edge.append((i-1,i%N+1))
        K+=1
    edge.append((i,i%N+1))

print(len(edge))
for a,b in edge:
    print(a,b)
0