제출 #1030682

#제출 시각아이디문제언어결과실행 시간메모리
1030682ZicrusArranging Shoes (IOI19_shoes)C++17
45 / 100
21 ms4416 KiB
#include <bits/stdc++.h> #include "shoes.h" using namespace std; typedef long long ll; ll count_swaps(vector<int> a) { ll n = a.size() / 2; vector<ll> leftPos; ll res = 0; for (int i = 0; i < a.size(); i++) { if (a[i] < 0) leftPos.push_back(i); } for (int i = 0; i < n; i++) { res += abs(leftPos[i] - 2*i); } return res; }

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

shoes.cpp: In function 'll count_swaps(std::vector<int>)':
shoes.cpp:11:23: 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 = 0; i < a.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...