Submission #900716

#TimeUsernameProblemLanguageResultExecution timeMemory
900716ozner77Arranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include "shoes.h"
#include <bits/stdc++.h>
#include <vector>1
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long count_swaps(vector<int> s) {
    long long swaps=0;
    vector<int> a;
    vector<int> b;
    int e=s.size();
    for(int i=0;i<e;e++){
        if(s[i]<0 && i%2==0){
            continue;
        }else if(s[i]<0){
            b.push_back(i);
        }else{
            a.push_back(i);
        }
    }
    int xd=a.size();
    for(int j=0;j<xd;j++){
        swaps+=(b[j]-a[j])
    }
    return swaps;
}

Compilation message (stderr)

shoes.cpp:3:18: warning: extra tokens at end of #include directive
    3 | #include <vector>1
      |                  ^
shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:24:27: error: expected ';' before '}' token
   24 |         swaps+=(b[j]-a[j])
      |                           ^
      |                           ;
   25 |     }
      |     ~