結果

問題 No.630 門松グラフ
ユーザー mkawa2mkawa2
提出日時 2020-06-11 14:24:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,260 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 25,960 KB
最終ジャッジ日時 2023-09-06 08:11:48
合計ジャッジ時間 7,568 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 19 ms
8,740 KB
testcase_02 AC 18 ms
8,788 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 20 ms
8,676 KB
testcase_06 AC 19 ms
8,684 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 20 ms
8,776 KB
testcase_10 AC 20 ms
8,644 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 20 ms
8,840 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 19 ms
8,816 KB
testcase_22 WA -
testcase_23 AC 20 ms
8,688 KB
testcase_24 WA -
testcase_25 AC 20 ms
8,740 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter
from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n,m=MI()
    n1=n//2
    n0=n-n//2
    if m<n-1 or m>n0*n1:
        print("NO")
        exit()

    uv=[]
    for v in range(n0+1,n+1):uv+=[(v-n0,v),(v-n0+1,v)]
    print(uv)

    cnt=n-1
    for v in range(n0 + 1, n + 1):
        for u in range(1,n0+1):
            if cnt==m:
                print("YES")
                print(*list(range(1,n+1)))
                for u,v in uv:print(u,v)
                exit()
            if v-n0==u or v-n0+1==u:continue
            uv.append((u,v))
            cnt+=1

main()
0