Submission #650146

#TimeUsernameProblemLanguageResultExecution timeMemory
650146activedeltorreArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include <vector>
using namespace std;
long long count_swaps(vector<int>vec)
{
    long long n=vec.size();
    int cnt=0;
    int suma=0;
    for(i=0;i<n;i++)
    {
        if(v[i]<0)
        {
            suma=suma+i-cnt;
            cnt=cnt+2;
        }
    }
    return suma;
}   

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<n;i++)
      |         ^
shoes.cpp:10:12: error: 'v' was not declared in this scope
   10 |         if(v[i]<0)
      |            ^