Submission #298999

#TimeUsernameProblemLanguageResultExecution timeMemory
298999REALITYNBArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int count_swaps(vector<int> a){ int n = a.size() ; int ans = 0 ; for(int i=0;i<n;i++){ if(a[i]==0) continue ; // cout <<a[i] << " " ; int ze = 0 ; for(int j=i+1;j<n;j++){ if(a[j]==0) ze++ ; if(a[j]==a[i]*-1){ ans+=(j-i-(a[i]<0)-ze) , a[j]=0 ; cout << j << " " << a[i] << endl ; break ; } //if(a[j]==a[i]*-1) break ; } } // cout << ans ; return ans ; }

Compilation message (stderr)

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