ACM思维题训练集合 Furik and Rubik love playing computer games. Furik has recently found a new game that greatly interested Rubik. The game consists of n parts and to complete each part a player may probably need to complete some other ones. We know that the…
题意及思路:https://www.cnblogs.com/dd-bond/p/10859864.html 代码: #include <bits/stdc++.h> #define LL long long #define db double using namespace std; const int maxn = 500010; stack<pair<int ,int> >s; vector<int> G[maxn]; int a[maxn], ans[…