Submission #383895

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3838952021-03-31 00:49:27MODDITraffic (IOI10_traffic)C++14
100 / 100
1377 ms156208 KiB
#include "traffic.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define mp make_pair
#define pb push_back
using namespace std;
vi G[1000000], sum, arr;
bool vis[1000000];
static int N,P[1000000],S[1000000],D[1000000];
void dfs(int node){
vis[node] = true;
int cur = arr[node];
for(auto next : G[node]){
if(!vis[next]){
dfs(next);
cur += sum[next];
}
}
sum[node] = cur;
}
int LocateCentre(int N, int pp[], int S[], int D[]) {
for(int i = 0; i < N - 1; i++)
{
G[S[i]].pb(D[i]);
G[D[i]].pb(S[i]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

traffic.cpp:14:36: warning: 'D' defined but not used [-Wunused-variable]
   14 | static int N,P[1000000],S[1000000],D[1000000];
      |                                    ^
traffic.cpp:14:25: warning: 'S' defined but not used [-Wunused-variable]
   14 | static int N,P[1000000],S[1000000],D[1000000];
      |                         ^
traffic.cpp:14:14: warning: 'P' defined but not used [-Wunused-variable]
   14 | static int N,P[1000000],S[1000000],D[1000000];
      |              ^
traffic.cpp:14:12: warning: 'N' defined but not used [-Wunused-variable]
   14 | static int N,P[1000000],S[1000000],D[1000000];
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...