Submission #257603

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2576032020-08-04 13:10:23davi_bartDreaming (IOI13_dreaming)C++14
100 / 100
240 ms11116 KiB
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include "dreaming.h"
using namespace std;
typedef long long ll;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<pair<int,int> > v[100010];
vector<pair<int,int> >group;
vector<bool> vis(100010,0);
vector<int> distA(100010,0),distB(100010,0);//profondita;
void dist(int pos){
priority_queue<pair<pair<int,int>,int>,vector<pair<pair<int,int>,int > >,greater<pair<pair<int,int>,int> > >q;
q.push({{0,pos},-1});
vector<int> y;
int A=pos;
while(!q.empty()){
int p=q.top().first.second;
int d=q.top().first.first;
int prec=q.top().second;
q.pop();
y.push_back(p);
vis[p]=1;
A=p;
for(auto x:v[p])if(x.first!=prec)q.push({{d+x.second,x.first},p});
}
q.push({{0,A},-1});
int B=A;
while(!q.empty()){
int p=q.top().first.second;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:66:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=1;i<group.size();i++){
               ~^~~~~~~~~~~~~
#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...