제출 #283508

#제출 시각아이디문제언어결과실행 시간메모리
283508JoseCopasArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include "shoes.h"
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

long long count_swaps(std::vector<int> s)
{
    long long c=0;
    if(s.length()/2==1)
    {
        if(s[1]<0 && s[0]==0-s[1])c++;
    }
	return c;
}
/*
int main()
{

    return 0;
}
*/

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

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:9:10: error: 'class std::vector<int>' has no member named 'length'
    9 |     if(s.length()/2==1)
      |          ^~~~~~