Submission #14770

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
147702015-06-22 04:36:52progressiveDreaming (IOI13_dreaming)C++98
100 / 100
121 ms16116 KiB
#include "dreaming.h"
#include <vector>
#include <algorithm>
using namespace std;
static const int MAXN=100100;
vector<pair<int,int> > conn[MAXN];
static int color[MAXN];
static int tp=0;
static int hdist[MAXN];
static int dist[MAXN];
static int parent[MAXN];
vector<int> samecolor[MAXN];
vector<int> radius;
void colordfs(int a,int pa,int c)
{
color[a]=c;
samecolor[c].push_back(a);
for(int i=0;i<conn[a].size();i++)
{
int target=conn[a][i].first;
if(target==pa) continue;
hdist[target]=hdist[a]+conn[a][i].second;
colordfs(target,a,c);
}
}
void dfs(int a,int pa)
{
parent[a]=pa;
for(int i=0;i<conn[a].size();i++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dreaming.cpp: In function 'void colordfs(int, int, int)':
dreaming.cpp:19:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<conn[a].size();i++)
              ~^~~~~~~~~~~~~~~
dreaming.cpp: In function 'void dfs(int, int)':
dreaming.cpp:30:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<conn[a].size();i++)
              ~^~~~~~~~~~~~~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:51:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<samecolor[i].size();j++)
               ~^~~~~~~~~~~~~~~~~~~~
dreaming.cpp:55:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<samecolor[i].size();j++)
               ~^~~~~~~~~~~~~~~~~~~~
#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...