結果

問題 No.630 門松グラフ
ユーザー kimiyukikimiyuki
提出日時 2018-01-05 22:44:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 13,088 KB
最終ジャッジ日時 2023-08-24 21:01:28
合計ジャッジ時間 7,214 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,848 KB
testcase_02 AC 15 ms
7,868 KB
testcase_03 WA -
testcase_04 AC 15 ms
7,888 KB
testcase_05 AC 15 ms
7,800 KB
testcase_06 AC 15 ms
7,840 KB
testcase_07 AC 15 ms
7,800 KB
testcase_08 AC 15 ms
7,812 KB
testcase_09 AC 16 ms
7,792 KB
testcase_10 AC 15 ms
7,900 KB
testcase_11 AC 16 ms
7,780 KB
testcase_12 AC 15 ms
7,844 KB
testcase_13 AC 16 ms
7,808 KB
testcase_14 AC 16 ms
7,844 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 16 ms
7,868 KB
testcase_19 AC 16 ms
7,924 KB
testcase_20 WA -
testcase_21 AC 15 ms
7,796 KB
testcase_22 WA -
testcase_23 AC 15 ms
7,816 KB
testcase_24 AC 143 ms
8,304 KB
testcase_25 AC 15 ms
7,924 KB
testcase_26 WA -
testcase_27 AC 143 ms
8,220 KB
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 #

#!/usr/bin/env python3
n, m = map(int, input().split())
a = n // 2
b = n - a
if m < n - 1 or a * b < m:
    print('NO')
else:
    print('YES')
    print(*[ i + 1 for i in range(n) ])
    def edges():
        for j in range(b):
            yield ( 1, a + j + 1 )
        for i in range(1, a):
            for j in range(b):
                yield ( i + 1, a + j + 1 )
    for i, ( u, v ) in enumerate(edges()):
        if i == m:
            break
        print(u, v)
0