Submission #127850

#TimeUsernameProblemLanguageResultExecution timeMemory
127850LittleFlowers__Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; #define in ({long longx=0;long longc=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';n?-x:x;}) mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); long longrnd(long longl,long longr){return l+rng()%(r-l+1);} #define fasty ios_base::sync_with_stdio(false),cin.tie(nullptr); #define task "TASK" #define forinc(a,b,c) for(long longa=b,_c=c;a<=_c;++a) #define fordec(a,b,c) for(long longa=b,_c=c;a>=_c;--a) #define forv(a,b) for(auto&a:b) #define fi first #define se second #define pb push_back #define ii pair<int,int> #define mt make_tuple #define all(a) a.begin(),a.end() #define reset(f, x) memset(f, x, sizeof(f)) #define bit(x,i) ((x>>(i-1))&1) #define on(x,i) (x|(1ll<<(i-1))) #define off(x,i) (x&~(1<<(i-1))) long longfindGap(long longT,long longN){ if(T==1){ long longl=0,r=1e18,ret; vector<int> h,t; forinc(i,1,(N+1)/2){ long longx,y; MinMax(l,r,&x,&y); h.pb(x); t.pb(y); l=x+1,r=y-1; } ret=t.back()-h.back(); forinc(i,1,h.size()-1) ret=max({ret,h[i]-h[i-1],t[i-1]-t[i]}); return ret; } else{ return -1; } }

Compilation message (stderr)

gap.cpp: In function 'long int longrnd(long int, long int)':
gap.cpp:6:44: error: 'l' was not declared in this scope
 long longrnd(long longl,long longr){return l+rng()%(r-l+1);}
                                            ^
gap.cpp:6:53: error: 'r' was not declared in this scope
 long longrnd(long longl,long longr){return l+rng()%(r-l+1);}
                                                     ^
gap.cpp: In function 'long int longfindGap(long int, long int)':
gap.cpp:24:8: error: 'T' was not declared in this scope
     if(T==1){
        ^
gap.cpp:27:21: error: 'N' was not declared in this scope
         forinc(i,1,(N+1)/2){
                     ^
gap.cpp:9:43: note: in definition of macro 'forinc'
 #define forinc(a,b,c) for(long longa=b,_c=c;a<=_c;++a)
                                           ^
gap.cpp:27:16: error: 'i' was not declared in this scope
         forinc(i,1,(N+1)/2){
                ^
gap.cpp:9:45: note: in definition of macro 'forinc'
 #define forinc(a,b,c) for(long longa=b,_c=c;a<=_c;++a)
                                             ^
gap.cpp:29:20: error: 'l' was not declared in this scope
             MinMax(l,r,&x,&y);
                    ^
gap.cpp:29:25: error: 'x' was not declared in this scope
             MinMax(l,r,&x,&y);
                         ^
gap.cpp:28:18: warning: unused variable 'longx' [-Wunused-variable]
             long longx,y;
                  ^~~~~
gap.cpp:9:32: warning: unused variable 'longa' [-Wunused-variable]
 #define forinc(a,b,c) for(long longa=b,_c=c;a<=_c;++a)
                                ^
gap.cpp:27:9: note: in expansion of macro 'forinc'
         forinc(i,1,(N+1)/2){
         ^~~~~~
gap.cpp:34:16: error: 'i' was not declared in this scope
         forinc(i,1,h.size()-1) ret=max({ret,h[i]-h[i-1],t[i-1]-t[i]});
                ^
gap.cpp:9:45: note: in definition of macro 'forinc'
 #define forinc(a,b,c) for(long longa=b,_c=c;a<=_c;++a)
                                             ^
gap.cpp:34:69: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
         forinc(i,1,h.size()-1) ret=max({ret,h[i]-h[i-1],t[i-1]-t[i]});
                                                                     ^
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from gap.cpp:2:
/usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/include/c++/7/bits/stl_algobase.h:219:5: note:   template argument deduction/substitution failed:
gap.cpp:34:69: note:   candidate expects 2 arguments, 1 provided
         forinc(i,1,h.size()-1) ret=max({ret,h[i]-h[i-1],t[i-1]-t[i]});
                                                                     ^
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from gap.cpp:2:
/usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/7/bits/stl_algobase.h:265:5: note:   template argument deduction/substitution failed:
gap.cpp:34:69: note:   candidate expects 3 arguments, 1 provided
         forinc(i,1,h.size()-1) ret=max({ret,h[i]-h[i-1],t[i-1]-t[i]});
                                                                     ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from gap.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
/usr/include/c++/7/bits/stl_algo.h:3462:5: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/7/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
gap.cpp:9:32: warning: unused variable 'longa' [-Wunused-variable]
 #define forinc(a,b,c) for(long longa=b,_c=c;a<=_c;++a)
                                ^
gap.cpp:34:9: note: in expansion of macro 'forinc'
         forinc(i,1,h.size()-1) ret=max({ret,h[i]-h[i-1],t[i-1]-t[i]});
         ^~~~~~
gap.cpp:25:14: warning: unused variable 'longl' [-Wunused-variable]
         long longl=0,r=1e18,ret;
              ^~~~~
gap.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^