제출 #168975

#제출 시각아이디문제언어결과실행 시간메모리
168975pulpy_orangeArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long ll count_swaps(vector<ll>S){ int n=S.size(); int ans=0; ll vis[n]; memset(vis, 0, sizeof(vis)); for(ll i=0;i<n;i++){ if(vis[i])continue; ll curr=S[i]; vis[i]=1; if(curr<0){ for(ll j=i+1;j<n;j++){ if(!vis[j] and S[j]>0 and curr==-1*S[j]){ vis[j]=1; ans+=(j-1-i); break; } } } else{ for(ll j=i+1;j<n;j++){ if(!vis[j] and S[j]<0 and curr==-1*S[j]){ vis[j]=1; ans+=(j-i); break; } } } } return ans; }

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

/tmp/ccjfnYcy.o: In function `main':
grader.cpp:(.text.startup+0x282): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status