제출 #1061960

#제출 시각아이디문제언어결과실행 시간메모리
1061960Hectorungo_18Roller Coaster Railroad (IOI16_railroad)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; // #define int long long long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = s.size(); vector<pair<int, int>> v(n); for(int i = 0; i < n; i++){ v[i]={s[i], t[i]}; } sort(v.begin(), v.end()); vector<pair<int, int>> sol; long long int ans = 1e18+7; do{ int ex = 1; long long int aux = 0; for(int i = 0; i < n; i++){ if(ex <= v[i].first){ ex = v[i].second; continue; } aux+=ex-v[i].first; ex = v[i].second; if(aux < 0) break; } if(aux < 0) continue; if(ans > aux){ ans = aux; sol = v; } } while(next_permutation(v.begin(), v.end())); // cout << ans << endl; // for(auto x : sol){ // cout << x.first << " " << x.second << endl;; // } return ans; } signed main() { // ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<int> s(n), t(n); for(int i = 0; i < n; i++){ cin >> s[i] >> t[i]; } cout << plan_roller_coaster(s, t) << endl; }

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

/usr/bin/ld: /tmp/ccU7MohS.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccfsOEzR.o:railroad.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status