Submission #1062923

#TimeUsernameProblemLanguageResultExecution timeMemory
1062923nvujicaRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
70 ms7752 KiB
#include <bits/stdc++.h> #include "railroad.h" #define fi first #define se second using namespace std; const int inf = 1e9 + 5; vector <pair<int, int> > v; long long plan_roller_coaster(vector<int> s, vector<int> t) { int n = s.size(); for(int i = 0; i < n; i++){ v.push_back({t[i], -1}); v.push_back({s[i], 1}); } // v.push_back({1, -1}); // v.push_back({inf, 1}); sort(v.begin(), v.end()); reverse(v.begin(), v.end()); int sum = 0; for(int i = 0; i < v.size(); i++){ sum += v[i].se; if(sum < 0) return 1; } return 0; }

Compilation message (stderr)

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:28:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |     for(int i = 0; i < v.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...