Submission #283508

#TimeUsernameProblemLanguageResultExecution timeMemory
283508JoseCopasArranging Shoes (IOI19_shoes)C++17
Compilation error
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;
}
*/

Compilation message (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)
      |          ^~~~~~