Submission #147169

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1471692019-08-28 09:26:00Bodo171Highway Tolls (IOI18_highway)C++14
51 / 100
260 ms16328 KiB
//sursa de anul trecut de cand nu mergea Yandex
#include "highway.h"
#include <vector>
#include <iostream>
using namespace std;
const int nmax=100005;
vector<int> l[nmax],qr;
vector< pair<int,int> > v[nmax];
int lev[nmax],to_tt[nmax],lg[nmax];
int n,root,levmx,sec;
long long actual,stan,dif;
void dfs(int x)
{
l[lev[x]].push_back(x);
if(lev[x]>levmx) levmx=lev[x];
int nod=0;
for(int i=0;i<v[x].size();i++)
{
nod=v[x][i].first;
if(!lev[nod])
{
lev[nod]=lev[x]+1;
to_tt[nod]=v[x][i].second;
dfs(nod);
}
}
}
int gaseste_primul()
{
//la al doilea ii determini usor nivelul
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

highway.cpp: In function 'void dfs(int)':
highway.cpp:17:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<v[x].size();i++)
                 ~^~~~~~~~~~~~
highway.cpp: In function 'int gaseste_primul()':
highway.cpp:50:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(ret+(1<<p)<=l[lv].size())
            ~~~~~~~~~~^~~~~~~~~~~~~~
highway.cpp: In function 'int gaseste_al_doilea()':
highway.cpp:70:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(ret+(1<<p)<=l[lv].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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...