제출 #848646

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8486462023-09-13 07:27:08SalihSahin경주 (Race) (IOI11_race)C++14
100 / 100
1313 ms54608 KiB
#include <bits/stdc++.h>
#define pb push_back
#include "race.h"
#define endl "\n"
#define fastio cin.tie(0); ios_base::sync_with_stdio(false);
typedef long long ll;
using namespace std;
const int mod = 1e9 + 7;
const int MAXN = 2e5 + 5;
vector<pair<int, int> > adj[MAXN];
vector<int> sub(MAXN), vis(MAXN);
void subtreecalc(int node, int par){
sub[node] = 1;
for(auto itr: adj[node]){
if(itr.first != par && !vis[itr.first]){
subtreecalc(itr.first, node);
sub[node] += sub[itr.first];
}
}
}
int find_centroid(int node, int par, int sz){
for(auto itr: adj[node]){
if(vis[itr.first] || itr.first == par) continue;
if(sub[itr.first] > sz/2) return find_centroid(itr.first, node, sz);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:67:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   67 |     while(ind < adj[ct].size()){
      |           ~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...