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记录