給定一張無向圖
若
第一行有兩個非負整數
接下來的
對於所有測資,
第一行輸出兩個數字,分別代表點集
第二行輸出點集
如果無法找到,輸出-1
。
2 1 1 2
1 1 1 2
注意:由於本題輸入/輸出十分龐大,使用C++作答的同學,請在程式碼開頭加上#include <cstdio>
,並利用scanf
讀入資料、用printf
輸出資料。
scanf 常用的讀入方式如下:
scanf("%d",&x);
讀入一個有號整數至int 型態變數x。
scanf("%lld",&y);
讀入一個有號整數至long long 型態變數y。
printf 常用的輸出方式如下:
printf("%d\n",x);
輸出一行包含一個int 型態變數x。
printf("%lld\n",y);
輸出一行包含一個long long 型態變數y。
Problem set by edisonhello
建國中學107學年度校隊選拔:複試pA
No. | Testdata Range | Constraints | Score |
---|---|---|---|
1 | 0~17 | 9 | |
2 | 0~27 | 13 | |
3 | 0~42 | 29 | |
4 | 0~59 | 無額外限制 | 49 |