제출 #1042854

#제출 시각아이디문제언어결과실행 시간메모리
1042854ALeonidou철로 (IOI14_rail)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll int #define F first #define S second #define sz(x) (ll)x.size() #define endl "\n" #define pb push_back typedef vector <ll> vi; typedef pair <ll,ll> ii; typedef vector <ii> vii; #define dbg(x) cout<<#x<<": "<<x<<endl; #define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl; #define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl; mt19937 rng; void init_random(){ rng = mt19937(chrono::steady_clock::now().time_since_epoch().count()); } ll getNum(ll l, ll r){ return (l + rng() % (r-l+1)); } int main(){ init_random(); ll n = getNum(3,8), r = 10; vii v; ll f = getNum(0, r-2); v.pb(ii(f,1)); ll f2 = getNum(f+1, r-1); v.pb(ii(f2,2)); set <ll> st; st.insert(f); st.insert(f2); ll miniPos = f; ll maxPos = f2; for (ll i =2; i<n; i++){ ll p = getNum(0, r-1); while (st.find(p) != st.end()) p = getNum(0,r-1); st.insert(p); v.pb(ii(p, getNum(1,2))); miniPos = min(miniPos,p); maxPos = max(maxPos, p); } for (ll i =0; i<n; i++){ if (v[i].F == miniPos) v[i].S = 1; if (v[i].F == maxPos) v[i].S = 2; } cout<<"3"<<endl; cout<<n<<endl; for (ll i= 0; i<n; i++){ cout<<v[i].S<<" "<<v[i].F<<endl; } }

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

/usr/bin/ld: /tmp/cc39BvQk.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccrLRbjk.o:rail.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc39BvQk.o: in function `main':
grader.cpp:(.text.startup+0x2d9): undefined reference to `findLocation'
collect2: error: ld returned 1 exit status