제출 #1031683

#제출 시각아이디문제언어결과실행 시간메모리
1031683pccRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
111 ms7332 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() //claim always can be connected const ll inf = 1e18; const int mxn = 2e5+10; vector<int> all; int deg[mxn*3]; 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(); s.push_back(all.size()-1); t.push_back(1); for(auto &i:t)deg[i]--; for(auto &i:s)deg[i]++; for(int i = all.size()-1;i>=0;i--){ deg[i] += deg[i+1]; } return *min_element(deg,deg+all.size())<0; }

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

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:20:6: warning: unused variable 'N' [-Wunused-variable]
   20 |  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...