제출 #332366

#제출 시각아이디문제언어결과실행 시간메모리
332366nicholaskArranging Shoes (IOI19_shoes)C++14
컴파일 에러
0 ms0 KiB
//#include "shoes.h" #include <bits/stdc++.h> using namespace std; long long count_swaps(vector <int> s){ int n=(s.size()>>1); if (n<=1000){ long long ans=0; for (int i=0; i<n+n; i+=2){ int wh; for (int j=1; ; j++){ if (s[0]*-1==s[j]){ wh=j; break; } } if (s[0]>0) ans++; ans+=wh-1; s.erase(s.begin()+wh); s.erase(s.begin()); } return ans; } else { return n*1ll*(n-1); } } signed main(){ int n; cin>>n; vector <int> v(n); for (int i=0; i<n; i++) cin>>v[i]; cout<<count_swaps(v); }

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

/tmp/ccr77F4y.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccJ37FCm.o:shoes.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status