文章
68
粉丝
691
获赞
26
访问
577.6k
https://blog.csdn.net/csyifanZhang/article/details/106372286
↑三道真题题解
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<cmath>
using namespace std;
#define ll int
#define vec vector<ll>
#define inf 0x3f3f3f3f
#define MAX 1005
#define P pair<ll,ll>
#define MOD 100000
int main() {
int n, a, b, c, d, cnt, fa[MAX], m, r = -1;
vec t[MAX]; P p[MAX]; cin >> n;
fill(fa, fa + MAX, -1);
memset(t, 0, sizeof(t));
for (int i = 0; i < n; i++) {
cin >> a >> b >> c >> d;
t[a].push_back(b), t[a].push_back(c), t[a].push_back(d);
fa[b] = fa[c] = fa[d] = a;
}
cin >> m;
for (int i = 0; i < m; i++)
cin >> p[i].second >> p[i].first;
sort(p, p + m);
vec tmp, pre;
for (int i = 0; i < m; i++) {
tmp.clear();
int le = p[i].second;
w...
登录后发布评论
高手
建议像其他同学一样注明题目来源,这样看到题解的同学也知道在哪里可以刷题哦
https://notebook.js.org/#/OJ/n-nuo/n-nuo-key-to-solve