Submission #316654

#TimeUsernameProblemLanguageResultExecution timeMemory
316654Tahmid690Arranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "shoes.h"
using namespace std;
long long count_swaps(vector<int> ara){
    if(n==1){
        if(ara[0]<0) return 0;
    else return 1;
    }
    long long n;
    n=ara.size();
    n/=2;
    return (n*(n-1))/2;
}

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:5:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |     if(n==1){
      |        ^
      |        yn