L2-025 分而治之
这是一道简单题,写着篇博客主要是给自己提个醒,做题要学会变通
这道题我一直在考虑如何对点进行操作,结果超时,但实际上这题对边进行遍历一遍就好了
#include
using namespace std;
vectorv[10010];
int a[10010],b[10010];
int vis[10010],flag=0;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n,m;
cin>>n>>m;
for(int i=1;i>t1>>t2;
a[i]=t1