結果
問題 |
No.1981 [Cherry 4th Tune N] アルゴリズムが破滅する例
|
ユーザー |
![]() |
提出日時 | 2022-06-17 22:10:45 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,075 bytes |
コンパイル時間 | 178 ms |
コンパイル使用メモリ | 82,192 KB |
実行使用メモリ | 65,196 KB |
最終ジャッジ日時 | 2024-10-09 08:10:44 |
合計ジャッジ時間 | 6,091 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 25 |
ソースコード
import sys #input = sys.stdin.readline input = sys.stdin.buffer.readline #文字列はダメ #sys.setrecursionlimit(1000000) #import bisect #import itertools #import random #from heapq import heapify, heappop, heappush #from collections import defaultdict #from collections import deque #import copy #import math #from functools import lru_cache #@lru_cache(maxsize=None) MOD = pow(10,9) + 7 #MOD = 998244353 #dx = [1,0,-1,0] #dy = [0,1,0,-1] #dx8 = [1,1,0,-1,-1,-1,0,1] #dy8 = [0,1,1,1,0,-1,-1,-1] def main(): N,K = map(int,input().split()) if N == K: print(N) for i in range(1,N+1): ret = [i,i] print(*ret) exit() if K <= N//2: print(-1) exit() x = N-1-K #print("x",x) for i in range(x+1): ret = [2*i+1,2*i+2] print(*ret) l = 2*x + 2; r = 2*x+3 while True: if r >= N: break ret = [l,r] print(*ret) l += 1; r += 1 for i in range(1,N+1): ret = [i,i] print(*ret) if __name__ == '__main__': main()