제출 #829366

#제출 시각아이디문제언어결과실행 시간메모리
829366JoksimKaktusArranging Shoes (IOI19_shoes)C++17
45 / 100
21 ms3124 KiB
#include <bits/stdc++.h> #include <iostream> #include <vector> #include <cmath> #include <queue> #include <map> #include <algorithm> #include <iomanip> #include <set> using namespace std; long long count_swaps(vector <int> S){ long long res = 0; int next = 0; for(int i = 0;i < S.size();i++){ if(S[i] < 0){ res += abs(i-next); next += 2; } } return res; }

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

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