民间数据略水?
查看原帖
民间数据略水?
689673
caibyd楼主2022/10/30 23:05

RT,暴力卡到时间快到后疯狂输出 NO 甚至可以直接通过。

namespace{
	const int N=5e5+3;
	int n,m,Q,cd[N],rd[N],trd[N];
	struct node{
		int u;
		bool d;
	};
	struct node1{
		int x,y;
	};
	vector<node> a[N];
	vector<node1> fr[N];
	map<int,int> p[N];
	queue<int> q;
	void work(){
		n=read();m=read();
		while(m--){
			Int x=read(),y=read();
			++cd[x];++rd[y];
			p[x][y]=a[x].size();
			fr[y].pb({x,(int)a[x].size()});
			a[x].pb({y,0});
		}
		Q=read();
		while(Q--){
			if(1.0*clock()/CLOCKS_PER_SEC>0.9){
				puts("NO");
				while(Q--){
					puts("NO");
				}
				exit(0);
			}
            //此处省略了暴力
		}
	}
}

AC记录

2022/10/30 23:05
加载中...