PIPI OJ 1203: PIPI发工资(拓扑排序)
1203: PIPI发工资
菜鸟生成记(75)
主思路:题中提到了,a,b为上下级关系,a的工资要高于b,结合样例
2 2
1 2
2 1
-1
这一题需要拓扑排序;同时要反向建建(正向错误75%,最下面解释,正向建边的错误之处)
#include<bits/stdc++.h>
using namespace std;
const int N=2e4;
int n,m;
vector<int>e[N];
int in1[N];
queue<pair<int,int>
原创
2021-06-16 11:40:35 ·
535 阅读 ·
1 评论