Submission #253495

#TimeUsernameProblemLanguageResultExecution timeMemory
253495BadrangiikhArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include <deque> #include <cmath> using namespace std; #define ll long long /*freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);*/ long long count_swaps ( vector < long long > s ) { long long n = s . size ( ) ; long long x = 0 ; long long y = 0 ; while ( s . size ( ) > 0 ) { long long n = s . size ( ) ; for ( long long i = 0 ; i < n ; i ++ ) { if ( s [ i ] < 0 ) { y = abs ( s [ i ] ) ; for ( long long j = 0 ; j < n ; j ++ ) { if ( s [ j ] == y ) { if ( j > i ) { x += ( i + j - 1 ) ; s . erase ( s . begin ( ) + j ) ; s . erase ( s . begin ( ) + i ) ; } else { x += ( i + j ) ; s . erase ( s . begin ( ) + i ) ; s . erase ( s . begin ( ) + j ) ; } break ; } } break ; } } } return x ; }

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<long long int>)':
shoes.cpp:12:15: warning: unused variable 'n' [-Wunused-variable]
     long long n = s . size ( ) ;
               ^
/tmp/ccku41HI.o: In function `main':
grader.cpp:(.text.startup+0x272): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status