Submission #401430

#TimeUsernameProblemLanguageResultExecution timeMemory
401430victoriadGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include "vector" #include <cmath> using namespace std; long long findGap(int T, int N) { vector<long long>a; long long i=0; while(a.size()<N){ long long int s=i,t=i+1; MinMax(i,i+1,&s,&t); i+=2; if(s==t){ if(s<0)continue; a.push_back(t); } else{ a.push_back(s); a.push_back(t); } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:9:17: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |   while(a.size()<N){
      |         ~~~~~~~~^~
gap.cpp:23:3: error: expected '}' at end of input
   23 |   }
      |   ^
gap.cpp:7:1: note: to match this '{'
    7 | { vector<long long>a;
      | ^
gap.cpp:23:3: warning: no return statement in function returning non-void [-Wreturn-type]
   23 |   }
      |   ^