제출 #1042840

#제출 시각아이디문제언어결과실행 시간메모리
1042840ZicrusRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
2071 ms11460 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; typedef long long ll; ll plan_roller_coaster(vector<int> s, vector<int> t) { ll n = s.size(); vector<pair<ll, ll>> m; for (int i = 0; i < n; i++) { m.push_back({(ll)s[i], (ll)t[i]}); } std::sort(m.begin(), m.end()); ll cur = (*m.begin()).second; m.erase(m.begin()); ll res = 0; while (!m.empty()) { auto iter = lower_bound(m.begin(), m.end(), pair<ll, ll>(cur, 0)); if (iter == m.end()) return 1; cur = (*iter).second; m.erase(iter); } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

railroad.cpp: In function 'll plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:18:8: warning: unused variable 'res' [-Wunused-variable]
   18 |     ll res = 0;
      |        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...