제출 #282679

#제출 시각아이디문제언어결과실행 시간메모리
282679medmdgArranging Shoes (IOI19_shoes)C++14
10 / 100
1 ms256 KiB
#include <bits/stdc++.h> using namespace std; long long count_swaps(std::vector<int> S){ int ans=0; int count=0; while(S.size()){ if(S[0]>0) count ++; for(long long int i=1;i<S.size();i++){ if(S[i]==-1*S[0]){ count += i-1; S.erase(S.begin()+i); S.erase(S.begin()); break; } } ans+=count; } return ans; }

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

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:10:32: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         for(long long int i=1;i<S.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...