segments.cpp:5:18: error: 'll' was not declared in this scope
5 | typedef pair<int,ll> ii;
| ^~
segments.cpp:5:20: error: template argument 2 is invalid
5 | typedef pair<int,ll> ii;
| ^
segments.cpp: In function 'int main()':
segments.cpp:17:19: error: expression list treated as compound expression in functional cast [-fpermissive]
17 | dp[0] = ii(0,0);
| ^
segments.cpp:17:16: warning: left operand of comma operator has no effect [-Wunused-value]
17 | dp[0] = ii(0,0);
| ^
segments.cpp:3:12: error: request for member 'second' in 'dp[j]', which is of non-class type 'ii' {aka 'int'}
3 | #define se second
| ^~~~~~
segments.cpp:20:36: note: in expansion of macro 'se'
20 | if (p[i]-p[j] >= dp[j].se){
| ^~
segments.cpp:2:12: error: request for member 'first' in 'dp[i]', which is of non-class type 'ii' {aka 'int'}
2 | #define fi first
| ^~~~~
segments.cpp:21:27: note: in expansion of macro 'fi'
21 | if (dp[i].fi < dp[j].fi+1 || (dp[i].fi == dp[j].fi+1 && dp[i].se > p[i]-p[j]) ){
| ^~
segments.cpp:2:12: error: request for member 'first' in 'dp[j]', which is of non-class type 'ii' {aka 'int'}
2 | #define fi first
| ^~~~~
segments.cpp:21:38: note: in expansion of macro 'fi'
21 | if (dp[i].fi < dp[j].fi+1 || (dp[i].fi == dp[j].fi+1 && dp[i].se > p[i]-p[j]) ){
| ^~
segments.cpp:2:12: error: request for member 'first' in 'dp[i]', which is of non-class type 'ii' {aka 'int'}
2 | #define fi first
| ^~~~~
segments.cpp:21:53: note: in expansion of macro 'fi'
21 | if (dp[i].fi < dp[j].fi+1 || (dp[i].fi == dp[j].fi+1 && dp[i].se > p[i]-p[j]) ){
| ^~
segments.cpp:2:12: error: request for member 'first' in 'dp[j]', which is of non-class type 'ii' {aka 'int'}
2 | #define fi first
| ^~~~~
segments.cpp:21:65: note: in expansion of macro 'fi'
21 | if (dp[i].fi < dp[j].fi+1 || (dp[i].fi == dp[j].fi+1 && dp[i].se > p[i]-p[j]) ){
| ^~
segments.cpp:3:12: error: request for member 'second' in 'dp[i]', which is of non-class type 'ii' {aka 'int'}
3 | #define se second
| ^~~~~~
segments.cpp:21:79: note: in expansion of macro 'se'
21 | if (dp[i].fi < dp[j].fi+1 || (dp[i].fi == dp[j].fi+1 && dp[i].se > p[i]-p[j]) ){
| ^~
segments.cpp:2:12: error: request for member 'first' in 'dp[j]', which is of non-class type 'ii' {aka 'int'}
2 | #define fi first
| ^~~~~
segments.cpp:22:36: note: in expansion of macro 'fi'
22 | dp[i] = {dp[j].fi+1, p[i]-p[j]};
| ^~
segments.cpp:22:51: error: cannot convert '<brace-enclosed initializer list>' to 'ii' {aka 'int'} in assignment
22 | dp[i] = {dp[j].fi+1, p[i]-p[j]};
| ^
segments.cpp:2:12: error: request for member 'first' in 'dp[n]', which is of non-class type 'ii' {aka 'int'}
2 | #define fi first
| ^~~~~
segments.cpp:27:25: note: in expansion of macro 'fi'
27 | printf("%d\n",dp[n].fi);
| ^~
segments.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
12 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
segments.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
14 | scanf("%d",&a[i]);
| ~~~~~^~~~~~~~~~~~