Submission #18010

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
180102016-01-18 08:13:12suhgyuho_williamDreaming (IOI13_dreaming)C++98
100 / 100
103 ms9116 KiB
#include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int N,M,L;
int a[100002];
int d[100002],q[100002];
int dia[100002],tmp;
int path[100002];
bool check[100002];
vector<pair<int,int> > edge[100002];
int bfs(int x){
int i,r;
int v,nextv,big;
int top,rear,ansv;
top = 0;
rear = 1;
q[1] = x;
d[x] = 0;
while(true){
top++;
if(top > rear) break;
for(i=0; i<edge[q[top]].size(); i++){
v = edge[q[top]][i].first;
if(d[v] > d[q[top]]+edge[q[top]][i].second){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dreaming.cpp: In function 'int bfs(int)':
dreaming.cpp:28:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<edge[q[top]].size(); i++){
            ~^~~~~~~~~~~~~~~~~~~~
dreaming.cpp:49:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<edge[q[top]].size(); i++){
            ~^~~~~~~~~~~~~~~~~~~~
dreaming.cpp:19:15: warning: variable 'ansv' set but not used [-Wunused-but-set-variable]
  int top,rear,ansv;
               ^~~~
dreaming.cpp:68:26: warning: 'nextv' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if(r > max(d[x],d[nextv]-d[x])){ r = max(d[x],d[nextv]-d[x]); ansv = x; }
                   ~~~~~~~^
dreaming.cpp:41:11: warning: 'v' may be used uninitialized in this function [-Wmaybe-uninitialized]
  check[v] = true;
  ~~~~~~~~~^~~~~~
#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...