Submission #586713

#TimeUsernameProblemLanguageResultExecution timeMemory
586713John3_141592Stations (IOI20_stations)C++14
0 / 100
855 ms552 KiB
#include "stations.h" #include <vector> #include <bits/stdc++.h> using namespace std; std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { int rep[10006]; fill(rep,rep+1009,0); bool band=false; for(int i=0;i<n;i++){ rep[u[i]]++; rep[v[i]]++; if(rep[u[i]]>2 || rep[v[i]]>2) band=true; } if(!band){ vector <int> vec; for(int i=0;i<n;i++) vec.push_back(i); return vec; } } int find_next_station(int s, int t, std::vector<int> c) { if(c.size()==1) return c.back(); if(t>s) return max(c[0],c[1]); else return min(c[0],c[1]); }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
#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...