//resubmission test. #include #include #include #include #include #include #include using namespace std; int main(){ int N,M; scanf("%d%d",&N,&M); unordered_map >m; for(;M--;){ int a,b,c; scanf("%d%d%d",&a,&b,&c); m[a][b]=c; } uniform_int_distribution distribution(0,N-1); mt19937_64 engine((unsigned int)time(NULL)^(getpid()<<16)); vectorv(N),order(N); iota(order.begin(),order.end(),0); int r=0; for(int i=0;i<100000;i++){ v=order; //random_shuffle(v.begin(),v.end()); int a,b; a=distribution(engine),b=distribution(engine); swap(v[a],v[b]); a=distribution(engine),b=distribution(engine); swap(v[a],v[b]); int s=0; for(int i=0;i