Submission #383193

#TimeUsernameProblemLanguageResultExecution timeMemory
383193danielcm585Stations (IOI20_stations)C++14
Compilation error
0 ms0 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; int find_next_station(int S, int T, vector<int> C) { if (C.size() == 1) return C[0]; if (S < C[0]) { for (int i = 0; i < C.size(); i++) { if (S <= T && T <= C[i]) return C[i]; } return C.back(); } else { for (int i = C.size()-1; i >= 0; i--) { if (C[i] <= T && T <= S) return C[i]; } return C[0]; } }

Compilation message (stderr)

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:9:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   for (int i = 0; i < C.size(); i++) {
      |                   ~~^~~~~~~~~~
/tmp/ccrktehy.o: In function `main':
stub.cpp:(.text.startup+0x29a): undefined reference to `label(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status