Submission #143647

#TimeUsernameProblemLanguageResultExecution timeMemory
143647ignaciocantaArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include "shoes.h"

using namespace std;

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()

long long count_swaps(std::vector<int> s) {
	int n = s.size();
	int count = 0;
	forn(i, n){
	if(s[i] < 0) cont++;
	}
	return cont;
}

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:13:15: error: 'cont' was not declared in this scope
  if(s[i] < 0) cont++;
               ^~~~
shoes.cpp:13:15: note: suggested alternative: 'count'
  if(s[i] < 0) cont++;
               ^~~~
               count
shoes.cpp:15:9: error: 'cont' was not declared in this scope
  return cont;
         ^~~~
shoes.cpp:15:9: note: suggested alternative: 'count'
  return cont;
         ^~~~
         count
shoes.cpp:11:6: warning: unused variable 'count' [-Wunused-variable]
  int count = 0;
      ^~~~~