제출 #713435

#제출 시각아이디문제언어결과실행 시간메모리
713435europiumArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include "shoes.h" #include <iostream> #include <vector> #include <algorithm> #include <string> #include <numeric> #include <cmath> #include<iterator> #include <set> #include <map> #include <math.h> #include <iomanip> #include <unordered_set> using namespace std; using ll = long long; // subtask 4 - 15 points // ll count_swaps(vector<int> s) { // ll n = s.size() / 2; // return n * (n - 1) / 2; // } // subtask 3 ll count_swaps(vector<int> a) { ll n = s.size(); ll closest = 0; ll ans = 0; for (ll i = 0; i < n; i++){ if (a[i] < 0){ ans += i - closest; closest +=2 ; } } return ans; }

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

shoes.cpp: In function 'll count_swaps(std::vector<int>)':
shoes.cpp:26:9: error: 's' was not declared in this scope
   26 |  ll n = s.size();
      |         ^