結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,324 KB
testcase_01 AC 16 ms
8,240 KB
testcase_02 AC 16 ms
8,200 KB
testcase_03 AC 15 ms
8,332 KB
testcase_04 AC 16 ms
8,200 KB
testcase_05 AC 15 ms
8,184 KB
testcase_06 AC 16 ms
8,336 KB
testcase_07 AC 15 ms
8,200 KB
testcase_08 AC 15 ms
7,960 KB
testcase_09 AC 15 ms
8,236 KB
testcase_10 AC 15 ms
8,264 KB
testcase_11 AC 16 ms
8,208 KB
testcase_12 AC 16 ms
8,188 KB
testcase_13 AC 16 ms
8,288 KB
testcase_14 WA -
testcase_15 AC 16 ms
8,196 KB
testcase_16 AC 15 ms
8,348 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 169 ms
13,220 KB
testcase_21 AC 16 ms
8,264 KB
testcase_22 AC 173 ms
13,112 KB
testcase_23 AC 16 ms
8,240 KB
testcase_24 WA -
testcase_25 AC 16 ms
8,184 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 164 ms
12,836 KB
testcase_29 AC 144 ms
11,956 KB
testcase_30 AC 142 ms
10,976 KB
testcase_31 WA -
testcase_32 AC 83 ms
10,096 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split(" "))

if M > ((N-2) * 2) or (N-1) > M :
	print("NO")
	exit(0)
else:
	print("YES")

a = [100000,99999]
remain_ver = [i for i in range(1,N-1)]
a.extend(remain_ver)

for num in a:
	print(num,end=" ")
print()

if M % 2 == 0:
	print("3 1")
	print("3 2")
	M -= 2
	for i in range(4,N+1):
		if (M == 0):
			exit(0)
		print(str(i) + " 1")
		M -= 1
	if M >= 0:
		for i in range(4,N+1):
			if (M == 0):
				exit(0)
			print(str(i) + " 2")
			M -= 1

		
else:
	print("3 1")
	print("3 2")
	M -= 2
	for i in range(4,N+1):
		if (M == 0):
			exit(0)
		print(str(i) + " 1")
		M -= 1
	if M >= 0:
		for i in range(4,N+1):
			if (M == 0):
				exit(0)
			print(str(i) + " 2")
			M -= 1

0