Submission #95605

# Submission time Handle Problem Language Result Execution time Memory
95605 2019-02-02T06:31:50 Z helloworldworld Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include <gap.h>
vector<long long> findnum(long long s,long long e){
    long long a,b,m,n;
    vector<long long> v1,v2,v;
    MinMax(s,e,&a,&b);
    if(a==-1||b==-1){
        return v;
    }
    if(a==b){
        v.push_back(a);
        return v;
    }
    m=(a+b)/2;
    n=m+1;
    v1=findnum(a,m);
    v2=findnum(n,b);
    for(int i=0;i<v1.size();i++){
        v.push_back(v1[i]);
    }
    for(int i=0;i<v2.size();i++){
        v.push_back(v2[i]);
    }
    return v;

}
long long findGap(int T,int N){
    long long s=0,e=1000000000000000000;
    vector<long long> v;
    long long a=0;
    v=findnum(s,e);
    for(int i=1;i<n;i++){
        if(a<v[i]-v[i-1])
            a=v[i]-v[i-1];
    }
    return a;








}

Compilation message

gap.cpp:2:1: error: 'vector' does not name a type
 vector<long long> findnum(long long s,long long e){
 ^~~~~~
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:28:5: error: 'vector' was not declared in this scope
     vector<long long> v;
     ^~~~~~
gap.cpp:28:12: error: expected primary-expression before 'long'
     vector<long long> v;
            ^~~~
gap.cpp:30:5: error: 'v' was not declared in this scope
     v=findnum(s,e);
     ^
gap.cpp:30:7: error: 'findnum' was not declared in this scope
     v=findnum(s,e);
       ^~~~~~~
gap.cpp:30:7: note: suggested alternative: 'findGap'
     v=findnum(s,e);
       ^~~~~~~
       findGap
gap.cpp:31:19: error: 'n' was not declared in this scope
     for(int i=1;i<n;i++){
                   ^