Compare commits

..

2 Commits

Author SHA1 Message Date
7f08957050 update 2025-08-15 11:15:51 +08:00
eeeb774996 update 2025-08-15 09:49:12 +08:00
2 changed files with 62 additions and 2 deletions

59
src/8/15/P8817.cpp Normal file
View File

@ -0,0 +1,59 @@
#include <cstdint>
#include <functional>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
using ll = int64_t;
ll n,m,k;
std::vector<ll> score;
std::vector<std::vector<ll>> edg;
std::vector<std::vector<bool>> cango;
std::vector<std::vector<ll>> best3;
void dfscango(ll from,ll cur, ll curk){
if(curk>k){
return;
}
for(ll i=0;i<edg[cur].size();i++){
cango[from][edg[cur][i]]=true;
dfscango(from, edg[cur][i], curk+1);
}
return;
}
int main(){
std::cin>>n>>m>>k;
score.resize(n+1);
edg.resize(n+1);
cango.resize(n+1,std::vector<bool>(n+1));
best3.resize(n+1);
for(ll i=2;i<=n;i++){
std::cin>>score[i];
}
for(ll i=1;i<=m;i++){
ll u,v;
std::cin>>u>>v;
edg[u].push_back(v);
edg[v].push_back(u);
}
for(ll i=1;i<=n;i++){
dfscango(i, i, 0);
}
for(ll i=2;i<=n;i++){
std::priority_queue<std::pair<ll, ll>,std::vector<std::pair<ll, ll>>,std::greater<>> pr;
for(ll j=2;j<=n;j++){
if(i==j)continue;
if(cango[i][j]&&cango[j][1]){
pr.emplace(score[j],j);
}
}
//TODO
}
for(ll B=2;B<=n;B++){
for(ll C=B+1;C<=n;C++){
}
}
}

View File

@ -1,5 +1,6 @@
#include <iostream> #include <iostream>
#include <random>
int main(){ int main(){
int a; std::random_device rd;
std::cout<<a<<'\n'; std::cout<<rd()<<'\n';
} }