Submission #803075

#TimeUsernameProblemLanguageResultExecution timeMemory
803075HaroldVemenoStations (IOI20_stations)C++17
0 / 100
3063 ms2097152 KiB
#include "stations.h" #include <bits/stdc++.h> #ifdef GUDEB #define D(x) cerr << #x << ": " << (x) << '\n'; #define ifdeb if(true) #else #define D(x) ; #define ifdeb if(false) #endif #define all(x) begin(x), end(x) using namespace std; using ull = unsigned long long; using ll = long long; // #define int ll; vector<int> al[1000]; vector<int> labels; int lt = 0; void dfs(int v, int p) { for(auto a : al[v]) { if(a == p) continue; dfs(a, v); } labels[v] = lt++; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { for (int i = 0; i < u.size(); i++) { al[u[i]].push_back(v[i]); al[v[i]].push_back(u[i]); } labels.resize(n); dfs(0, 0); return labels; } int find_next_station(int s, int t, vector<int> c) { int mx = c[0]; int lub = 10000; for(int a : c) { if(a >= t) lub = min(lub, a); mx = max(mx, a); } if(lub == 10000) return mx; return lub; }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:32:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |  for (int i = 0; i < u.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...