Submission #677035

#TimeUsernameProblemLanguageResultExecution timeMemory
677035hello_there_123Arranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define int long long long long count_swaps(vector<int> s) { int ans = 0; int n = s.size(); bool arr[n+3]; memset(arr,0,sizeof(arr)); for(int i=0;i<n;i++){ if(arr[i]) continue; int cnt = 0; for(int j=i+1;j<n;j++){ if(s[j] == -s[i] && arr[j] == 0){ arr[j] = 1; ans+=cnt; break; } else if(arr[j] == 0) cnt++; } if(s[i]>0) ans++; } return ans; }

Compilation message (stderr)

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