John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only possible if other tasks have already been executed. Input The input will consist of several instances of the problem. Each instance begins with…
#include<iostream> #include<vector> #include<queue> using namespace std; typedef long long ll; ; int in[N],n,r; vector<int>ans; vector<int>edge[N]; priority_queue<int,vector<int>,greater<int> >priq; int main…
..被多组测试坑了一波 #include<iostream> #include<vector> #include<queue> using namespace std; typedef long long ll; const int N = 1e3; vector<int>edge[N]; vector<int> ans; priority_queue<int, vector<int>, greater<int> &…
确定比赛名次 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 37566 Accepted Submission(s): 14659 Problem Description 有N个比赛队(1<=N<=500),编号依次为1,2,3,....,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直…
Genealogical tree Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8003 Accepted: 5184 Special Judge Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. T…