prog.cpp:9:22: error: expected ';' at end of member declaration
#define i64 unsigned __int64
^
prog.cpp:15:5: note: in expansion of macro 'i64'
i64 minV,maxV;
^
prog.cpp:15:9: error: 'minV' does not name a type
i64 minV,maxV;
^
prog.cpp:18:5: error: expected initializer before 'res'
i64 res[maxN+2];
^
prog.cpp:10:25: error: wrong number of template arguments (1, should be 2)
#define pii pair<i64,i64>
^
prog.cpp:19:9: note: in expansion of macro 'pii'
vector <pii> bridges;
^
In file included from /usr/include/c++/4.9/utility:70:0,
from /usr/include/c++/4.9/algorithm:60,
from /usr/include/i386-linux-gnu/c++/4.9/bits/stdc++.h:64,
from prog.cpp:1:
/usr/include/c++/4.9/bits/stl_pair.h:96:12: error: provided for 'template<class _T1, class _T2> struct std::pair'
struct pair
^
prog.cpp:19:12: error: template argument 1 is invalid
vector <pii> bridges;
^
prog.cpp:19:12: error: template argument 2 is invalid
prog.cpp:19:21: error: invalid type in declaration before ';' token
vector <pii> bridges;
^
prog.cpp:21:5: error: expected initializer before 'n'
i64 n,m,x,y;
^
prog.cpp: In function 'int compBridges(const void*, const void*)':
prog.cpp:10:25: error: wrong number of template arguments (1, should be 2)
#define pii pair<i64,i64>
^
prog.cpp:24:18: note: in expansion of macro 'pii'
return ( (*(pii*)a).F-(*(pii*)b).F );
^
In file included from /usr/include/c++/4.9/utility:70:0,
from /usr/include/c++/4.9/algorithm:60,
from /usr/include/i386-linux-gnu/c++/4.9/bits/stdc++.h:64,
from prog.cpp:1:
/usr/include/c++/4.9/bits/stl_pair.h:96:12: error: provided for 'template<class _T1, class _T2> struct std::pair'
struct pair
^
prog.cpp:24:22: error: expected primary-expression before ')' token
return ( (*(pii*)a).F-(*(pii*)b).F );
^
prog.cpp:24:23: error: expected ')' before 'a'
return ( (*(pii*)a).F-(*(pii*)b).F );
^
prog.cpp:24:42: error: expected ')' before ';' token
return ( (*(pii*)a).F-(*(pii*)b).F );
^
prog.cpp: In function 'int compIslands(const void*, const void*)':
prog.cpp:29:11: error: 'struct pairIsland' has no member named 'minV'
if (x.minV<y.minV) return -1;
^
prog.cpp:29:18: error: 'struct pairIsland' has no member named 'minV'
if (x.minV<y.minV) return -1;
^
prog.cpp:30:16: error: 'struct pairIsland' has no member named 'minV'
else if (x.minV>y.minV) return 1;
^
prog.cpp:30:23: error: 'struct pairIsland' has no member named 'minV'
else if (x.minV>y.minV) return 1;
^
prog.cpp:31:16: error: 'struct pairIsland' has no member named 'maxV'
else if (x.maxV<y.maxV) return -1;
^
prog.cpp:31:23: error: 'struct pairIsland' has no member named 'maxV'
else if (x.maxV<y.maxV) return -1;
^
prog.cpp:32:16: error: 'struct pairIsland' has no member named 'maxV'
else if (x.maxV>y.maxV) return 1;
^
prog.cpp:32:23: error: 'struct pairIsland' has no member named 'maxV'
else if (x.maxV>y.maxV) return 1;
^
prog.cpp: At global scope:
prog.cpp:35:28: error: expected ',' or '...' before 'val'
int isOk(pairIsland pi,i64 val) {
^
prog.cpp: In function 'int isOk(pairIsland, unsigned int)':
prog.cpp:36:9: error: 'val' was not declared in this scope
if (val<=pi.maxV && val>=pi.minV) return 0;
^
prog.cpp:36:17: error: 'struct pairIsland' has no member named 'maxV'
if (val<=pi.maxV && val>=pi.minV) return 0;
^
prog.cpp:36:33: error: 'struct pairIsland' has no member named 'minV'
if (val<=pi.maxV && val>=pi.minV) return 0;
^
prog.cpp:37:21: error: 'struct pairIsland' has no member named 'minV'
else if (val<pi.minV) return -1;
^
prog.cpp:38:21: error: 'struct pairIsland' has no member named 'maxV'
else if (val>pi.maxV) return 1;
^
prog.cpp: In function 'int searchInd(pairIsland)':
prog.cpp:41:23: error: request for member 'size' in 'bridges', which is of non-class type 'int'
int l=0,r=bridges.size()-1;
^
prog.cpp:43:13: error: expected initializer before 'mid'
i64 mid = (l+r)/2;
^
prog.cpp:44:13: error: 'mid' was not declared in this scope
if (mid==0) {
^
prog.cpp:45:41: error: invalid types 'int[int]' for array subscript
int comp = isOk(pi,bridges[0].F);
^
prog.cpp:53:13: error: expected initializer before 'num1'
i64 num1 = bridges[mid].F,
^
prog.cpp:55:29: error: 'num1' was not declared in this scope
int comp1 = isOk(pi,num1),
^
prog.cpp:57:27: error: 'comp2' was not declared in this scope
if (comp1 == 0 && comp2 == 0) r=mid-1;
^
prog.cpp:57:41: error: 'mid' was not declared in this scope
if (comp1 == 0 && comp2 == 0) r=mid-1;
^
prog.cpp:58:52: error: 'mid' was not declared in this scope
else if (comp1 == 0 && comp2 == -1) return mid;
^
prog.cpp:59:46: error: 'mid' was not declared in this scope
else if (comp1 == 0 && comp2 == 1) r=mid-1;
^
prog.cpp:60:32: error: 'mid' was not declared in this scope
else if (comp1 == 1) r=mid-1;
^
prog.cpp:61:33: error: 'mid' was not declared in this scope
else if (comp1 == -1) l=mid+1;
^
prog.cpp: In function 'int main()':
prog.cpp:70:9: error: expected initializer before 'x'
i64 x,y,lastX,lastY;
^
prog.cpp:71:25: error: 'n' was not declared in this scope
scanf("%I64d%I64d",&n,&m);
^
prog.cpp:71:28: error: 'm' was not declared in this scope
scanf("%I64d%I64d",&n,&m);
^
prog.cpp:73:30: error: 'x' was not declared in this scope
scanf("%I64d %I64d",&x,&y);
^
prog.cpp:73:33: error: 'y' was not declared in this scope
scanf("%I64d %I64d",&x,&y);
^
prog.cpp:74:29: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
if (i>0) islands.pb({i,x-lastY,y-lastX});
^
prog.cpp:74:34: error: 'lastY' was not declared in this scope
if (i>0) islands.pb({i,x-lastY,y-lastX});
^
prog.cpp:74:42: error: 'lastX' was not declared in this scope
if (i>0) islands.pb({i,x-lastY,y-lastX});
^
prog.cpp:74:48: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
if (i>0) islands.pb({i,x-lastY,y-lastX});
^
prog.cpp:74:48: error: no matching function for call to 'std::vector<pairIsland>::push_back(<brace-enclosed initializer list>)'
prog.cpp:74:48: note: candidate is:
In file included from /usr/include/c++/4.9/vector:64:0,
from /usr/include/c++/4.9/queue:61,
from /usr/include/i386-linux-gnu/c++/4.9/bits/stdc++.h:85,
from prog.cpp:1:
/usr/include/c++/4.9/bits/stl_vector.h:913:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = pairIsland; _Alloc = std::allocator<pairIsland>; std::vector<_Tp, _Alloc>::value_type = pairIsland]
push_back(const value_type& __x)
^
/usr/include/c++/4.9/bits/stl_vector.h:913:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const pairIsland&}'
prog.cpp:75:9: error: 'lastX' was not declared in this scope
lastX = x;
^
prog.cpp:76:9: error: 'lastY' was not declared in this scope
lastY = y;
^
prog.cpp:79:24: error: 'x' was not declared in this scope
scanf("%I64d",&x);
^
prog.cpp:4:12: error: request for member 'push_back' in 'bridges', which is of non-class type 'int'
#define pb push_back
^
prog.cpp:80:17: note: in expansion of macro 'pb'
bridges.pb({x,i+1});
^
prog.cpp:80:20: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
bridges.pb({x,i+1});
^
prog.cpp:83:21: error: invalid types 'int[int]' for array subscript
qsort(&bridges[0],m,sizeof(pii),compBridges);
^
prog.cpp:10:25: error: wrong number of template arguments (1, should be 2)
#define pii pair<i64,i64>
^
prog.cpp:83:32: note: in expansion of macro 'pii'
qsort(&bridges[0],m,sizeof(pii),compBridges);
^
In file included from /usr/include/c++/4.9/utility:70:0,
from /usr/include/c++/4.9/algorithm:60,
from /usr/include/i386-linux-gnu/c++/4.9/bits/stdc++.h:64,
from prog.cpp:1:
/usr/include/c++/4.9/bits/stl_pair.h:96:12: error: provided for 'template<class _T1, class _T2> struct std::pair'
struct pair
^
prog.cpp:85:14: error: expected ';' before 'i'
for (i64 i=0;i<n-1;i++) {
^
prog.cpp:85:14: error: name lookup of 'i' changed for ISO 'for' scoping [-fpermissive]
prog.cpp:85:14: note: (if you use '-fpermissive' G++ will accept your code)
prog.cpp:85:23: error: expected ')' before ';' token
for (i64 i=0;i<n-1;i++) {
^
prog.cpp:85:27: error: expected ';' before ')' token
for (i64 i=0;i<n-1;i++) {
^
prog.cpp:96:1: error: expected '}' at end of input
}
^