Submission #275303

#TimeUsernameProblemLanguageResultExecution timeMemory
275303surenArranging Shoes (IOI19_shoes)C++14
0 / 100
1090 ms256 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define mk make_pair #define pb push_back #define F first #define S second int count_swaps( vector < int > vc ){ int ans = 0, i; while( vc.size() > 0 ){ for( i = 1; i < vc.size(); i ++ ){ if( vc[i] == vc[0] * -1 ){ if( vc[i] < 0 ){ ans += i; vc.erase( vc.begin() + i ); vc.erase( vc.begin() + 0 ); } } } } return ans; }

Compilation message (stderr)

shoes.cpp: In function 'int count_swaps(std::vector<int>)':
shoes.cpp:12:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   for( i = 1; i < vc.size(); i ++ ){
      |               ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...