제출 #1031676

#제출 시각아이디문제언어결과실행 시간메모리
1031676pccRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
114 ms10868 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int,int> #define fs first #define sc second #define pll pair<ll,ll> #define _all(T) T.begin(),T.end() const ll inf = 1e18; const int mxn = 2e5+10; int dif[mxn]; vector<int> all; int suf[mxn]; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int N = (int)s.size(); all.push_back(0); for(auto &i:s)all.push_back(i); for(auto &i:t)all.push_back(i); sort(_all(all));all.resize(unique(_all(all))-all.begin()); for(auto &i:s)i = lower_bound(_all(all),i)-all.begin(); for(auto &i:t)i = lower_bound(_all(all),i)-all.begin(); for(auto &i:s)suf[i]++; for(auto &i:t)suf[i]--; for(int i = all.size();i>=0;i--){ suf[i] += suf[i+1]; } return (*min_element(suf,suf+all.size())<-1); }

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

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:19:6: warning: unused variable 'N' [-Wunused-variable]
   19 |  int N = (int)s.size();
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...