Submission #298236

#TimeUsernameProblemLanguageResultExecution timeMemory
298236RayaabualjamalArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include "shoes.h" #include <iostream> #include <vector> #include <cstdio> #define rep(i,a,b) for(int i = a; i<b; i++) using namespace std; long long count_swaps(vector<int> s) { if(s.size()==2){ if(s[0]<0){ return 0; }else{ return 1; } } //vector <int> n(n), p(n), sum(n+n, 0); long long ans = 0; rep(i,0,n){ ans+= i; } return ans; }

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:17:10: error: 'n' was not declared in this scope
   17 |  rep(i,0,n){
      |          ^
shoes.cpp:5:37: note: in definition of macro 'rep'
    5 | #define rep(i,a,b) for(int i = a; i<b; i++)
      |                                     ^