Submission #58776

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
587762018-07-19 10:12:06SherazinRace (IOI11_race)C++14
Compilation error
0 ms0 KiB
#include "race.h"
#include <bits/stdc++.h>
#define pii pair<int, int>
#define x first
#define y second
using namespace std;
const int N = 2e5 + 5;
int n, k;
int ans = -1, centroid, mxnode, tot, cnt;
int dep[N], path[N], dp[N];
vector<vector<pii> > g(N);
bitset<N> chk;
int subtree(int u, int p) {
for(pii v : g[u]) if(!chk[v.x] && v.x != p) {
dep[u] += subtree(v.x, u);
}
return ++dep[u];
}
void centdecomp(int u, int p) {
int ret = all - dep[u];
for(pii v : g[u]) if(!chk[v.x] && v.x != p) {
centdecomp(v.x, u);
ret = max(ret, dep[v.x]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

race.cpp: In function 'void centdecomp(int, int)':
race.cpp:26:12: error: 'all' was not declared in this scope
  int ret = all - dep[u];
            ^~~
race.cpp: In function 'void dfs(int, int, int, int, bool)':
race.cpp:38:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if(cost = k && (ans == -1 || edge < ans)) ans = edge;
      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
race.cpp: In function 'void proc(int)':
race.cpp:55:25: error: too many arguments to function 'void centdecomp(int, int)'
  centdecomp(u, u, dep[u]);
                         ^
race.cpp:25:6: note: declared here
 void centdecomp(int u, int p) {
      ^~~~~~~~~~