Submission #287911

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2879112020-09-01 06:27:12Bill_00Traffic (IOI10_traffic)C++14
Compilation error
0 ms0 KiB
#include <traffic.h>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<long long>adj[1000001];
vector<long long>leaf;
long long p[1000001];
long long sum[1000001];
long long dp[1000001],vis[1000001];
ll b[1000001];
void dfs(ll j){
if(adj[j].size()==1 && p[j]==adj[j][0]){
leaf.push_back(j);
return;
}
for(ll i=0;i<adj[j].size();i++){
if(adj[j][i]!=p[j]){
p[adj[j][i]]=j;
dfs(adj[j][i]);
}
}
}
long long calc(ll j){
sum[j]=(long long)b[j];
for(ll i=0;i<adj[j].size();i++){
if(adj[j][i]!=p[j]){
sum[j]+=calc(adj[j][i]);
}
}
return sum[j];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

traffic.cpp: In function 'void dfs(long long int)':
traffic.cpp:16:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |  for(ll i=0;i<adj[j].size();i++){
      |             ~^~~~~~~~~~~~~~
traffic.cpp: In function 'long long int calc(long long int)':
traffic.cpp:25:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |  for(ll i=0;i<adj[j].size();i++){
      |             ~^~~~~~~~~~~~~~
traffic.cpp: In function 'void check(long long int)':
traffic.cpp:33:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |  for(ll i=0;i<adj[j].size();i++){
      |             ~^~~~~~~~~~~~~~
traffic.cpp: At global scope:
traffic.cpp:45:4: error: ambiguating new declaration of 'long long int LocateCentre(int, int*, int*, int*)'
   45 | ll LocateCentre(int n,int a[],int s[],int d[]){
      |    ^~~~~~~~~~~~
In file included from traffic.cpp:1:
traffic.h:1:5: note: old declaration 'int LocateCentre(int, int*, int*, int*)'
    1 | int LocateCentre(int N, int P[], int S[], int D[]);
      |     ^~~~~~~~~~~~