제출 #282586

#제출 시각아이디문제언어결과실행 시간메모리
282586Pichon5Arranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include "shoes.h"
#include <bits/stdc++.h>
#define lcm(a,b) (a/__gcd(a,b))*b
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define F first
#define S second
#define mp make_pair
using namespace std;
long long count_swaps(std::vector<int> s) {
    ll res=0;
    int n=s.size()/2;
    if(n==2){
        if(s[i]<0){
            return 0;
        }
        return 1;
    }
    for(int i=1;i<n;i++){
        res+=i;
    }
    return res;
}

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

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:17:14: error: 'i' was not declared in this scope
   17 |         if(s[i]<0){
      |              ^