Submission #900697

#TimeUsernameProblemLanguageResultExecution timeMemory
900697ozner77Arranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include "shoes.h"
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long count_swaps(vector<int> s) {
    long long swaps=0;
    int e=s.size();
    swaps=((e-1)*e)/2
    return swaps;
}

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:11:22: error: expected ';' before 'return'
   11 |     swaps=((e-1)*e)/2
      |                      ^
      |                      ;
   12 |     return swaps;
      |     ~~~~~~            
shoes.cpp:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^