제출 #889107

#제출 시각아이디문제언어결과실행 시간메모리
889107svazArranging Shoes (IOI19_shoes)C++14
25 / 100
19 ms3244 KiB
#include "shoes.h" #include<iostream> #include<vector> using namespace std; long long count_swaps(std::vector<int> S){ if(S.size()==2){ if(S[0]>S[1])return 1; return 0; } long long in=0; for(int i=1;i<(S.size()/2);i++){ in+=i; } return in; } /*int main(){ int n,zap; cin>>n; vector<int>zapatos; for(int i=0;i<(n*2);i++){ cin>>zap; zapatos.push_back(zap); } cout<<count_swaps(zapatos)<<"\n"; return 0; }*/

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

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