Submission #91516

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
915162018-12-28 03:25:29faustaadpRace (IOI11_race)C++17
100 / 100
1071 ms114648 KiB
#include "race.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll n,k,has,b[202020],besar[202020],calon,me[1010101],i;
vector<ll> v[202020];
vector<ll> w[202020];
void dfs(ll aa,ll bb,ll cc)
{
ll ii,ma=0;
besar[aa]=1;
for(ii=0;ii<v[aa].size();ii++)
if((v[aa][ii]!=bb)&&(!b[v[aa][ii]]))
{
dfs(v[aa][ii],aa,cc);
besar[aa]+=besar[v[aa][ii]];
ma=max(ma,besar[v[aa][ii]]);
}
//cout<<aa<<" "<<ma<<" "<<(cc-besar[aa])<<"\n";
if((ma<=(cc/2))&&((cc-besar[aa])<=(cc/2)))calon=aa;
}
void dfs2(ll aa,ll bb)
{
ll ii,ma=0;
besar[aa]=1;
for(ii=0;ii<v[aa].size();ii++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

race.cpp: In function 'void dfs(long long int, long long int, long long int)':
race.cpp:16:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ii=0;ii<v[aa].size();ii++)
              ~~^~~~~~~~~~~~~
race.cpp: In function 'void dfs2(long long int, long long int)':
race.cpp:30:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ii=0;ii<v[aa].size();ii++)
              ~~^~~~~~~~~~~~~
race.cpp:28:11: warning: unused variable 'ma' [-Wunused-variable]
     ll ii,ma=0;
           ^~
race.cpp: In function 'void cari(long long int, long long int, long long int, long long int)':
race.cpp:47:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ii=0;ii<v[aa].size();ii++)
              ~~^~~~~~~~~~~~~
race.cpp: In function 'void cari(long long int, long long int)':
race.cpp:61:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ii=0;ii<v[calon].size();ii++)
              ~~^~~~~~~~~~~~~~~~
race.cpp:67:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(jj=0;jj<isi.size();jj++)
                  ~~^~~~~~~~~~~
race.cpp:76:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ii=0;ii<ini.size();ii++)
              ~~^~~~~~~~~~~
race.cpp:81:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ii=0;ii<v[C0].size();ii++)
              ~~^~~~~~~~~~~~~
race.cpp:80:8: warning: unused variable 'te' [-Wunused-variable]
     ll te=0;
        ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...