sequence.cpp:9: warning: "ll" redefined
9 | #define ll inf = -1e18;
|
sequence.cpp:7: note: this is the location of the previous definition
7 | #define ll long long
|
sequence.cpp:9:12: error: 'inf' was not declared in this scope; did you mean 'ynf'?
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:11:6: note: in expansion of macro 'll'
11 | pair<ll, int> dp[mxN][mxK];
| ^~
sequence.cpp:9:19: error: wrong number of template arguments (1, should be 2)
9 | #define ll inf = -1e18;
| ^~~~
sequence.cpp:11:6: note: in expansion of macro 'll'
11 | pair<ll, int> dp[mxN][mxK];
| ^~
In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
from /usr/include/c++/13/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
from sequence.cpp:1:
/usr/include/c++/13/bits/stl_pair.h:187:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
187 | struct pair
| ^~~~
sequence.cpp:11:8: error: expected unqualified-id before ',' token
11 | pair<ll, int> dp[mxN][mxK];
| ^
sequence.cpp:11:10: error: expected unqualified-id before 'int'
11 | pair<ll, int> dp[mxN][mxK];
| ^~~
sequence.cpp:9:12: error: 'inf' does not name a type; did you mean 'int'?
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:12:1: note: in expansion of macro 'll'
12 | ll pref[mxN];
| ^~
sequence.cpp:12:4: error: 'pref' does not name a type
12 | ll pref[mxN];
| ^~~~
sequence.cpp:9:12: error: 'inf' does not name a type; did you mean 'int'?
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:15:13: note: in expansion of macro 'll'
15 | mutable ll k, m, p, idx;
| ^~
sequence.cpp:15:16: error: 'k' does not name a type
15 | mutable ll k, m, p, idx;
| ^
sequence.cpp: In member function 'bool Line::operator<(const Line&) const':
sequence.cpp:16:56: error: 'const struct Line' has no member named 'k'
16 | bool operator<(const Line& o) const { return k < o.k; }
| ^
sequence.cpp:16:56: error: 'const struct Line' has no member named 'k'
sequence.cpp:16:56: error: 'const struct Line' has no member named 'k'
sequence.cpp:16:56: error: 'const struct Line' has no member named 'k'
sequence.cpp:16:56: error: 'const struct Line' has no member named 'k'
sequence.cpp:16:50: error: 'k' was not declared in this scope
16 | bool operator<(const Line& o) const { return k < o.k; }
| ^
sequence.cpp:16:56: error: 'const struct Line' has no member named 'k'
16 | bool operator<(const Line& o) const { return k < o.k; }
| ^
sequence.cpp: In member function 'bool Line::operator<(int) const':
sequence.cpp:17:42: error: 'p' was not declared in this scope
17 | bool operator<(int x) const { return p < x; }
| ^
sequence.cpp: At global scope:
sequence.cpp:9:12: error: 'inf' does not name a type; did you mean 'int'?
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:21:18: note: in expansion of macro 'll'
21 | static const ll inf = LLONG_MAX;
| ^~
sequence.cpp:21:21: error: 'inf' does not name a type; did you mean 'int'?
21 | static const ll inf = LLONG_MAX;
| ^~~
| int
sequence.cpp:9:12: error: 'inf' does not name a type; did you mean 'int'?
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:22:5: note: in expansion of macro 'll'
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^~
sequence.cpp:9:12: error: 'inf' has not been declared
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:22:12: note: in expansion of macro 'll'
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^~
sequence.cpp:9:23: error: expected ')' before ';' token
9 | #define ll inf = -1e18;
| ^
sequence.cpp:22:12: note: in expansion of macro 'll'
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^~
sequence.cpp:22:11: note: to match this '('
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^
sequence.cpp:22:8: error: ISO C++ forbids declaration of 'div' with no type [-fpermissive]
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^~~
sequence.cpp:22:15: error: 'a' does not name a type
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^
sequence.cpp:22:21: error: 'b' does not name a type
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^
sequence.cpp:9:12: error: 'inf' has not been declared
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:29:14: note: in expansion of macro 'll'
29 | void add(ll k, ll m, int idx) {
| ^~
sequence.cpp:9:23: error: expected ')' before ';' token
9 | #define ll inf = -1e18;
| ^
sequence.cpp:29:14: note: in expansion of macro 'll'
29 | void add(ll k, ll m, int idx) {
| ^~
sequence.cpp:29:13: note: to match this '('
29 | void add(ll k, ll m, int idx) {
| ^
sequence.cpp:29:17: error: 'k' does not name a type
29 | void add(ll k, ll m, int idx) {
| ^
sequence.cpp:29:23: error: 'm' does not name a type; did you mean 'tm'?
29 | void add(ll k, ll m, int idx) {
| ^
| tm
sequence.cpp:9:12: error: 'inf' was not declared in this scope; did you mean 'ynf'?
9 | #define ll inf = -1e18;
| ^~~
sequence.cpp:36:10: note: in expansion of macro 'll'
36 | pair<ll, int> query(ll x) {
| ^~
sequence.cpp:9:19: error: wrong number of template arguments (1, should be 2)
9 | #define ll inf = -1e18;
| ^~~~
sequence.cpp:36:10: note: in expansion of macro 'll'
36 | pair<ll, int> query(ll x) {
| ^~
/usr/include/c++/13/bits/stl_pair.h:187:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
187 | struct pair
| ^~~~
sequence.cpp:36:12: error: expected unqualified-id before ',' token
36 | pair<ll, int> query(ll x) {
| ^
sequence.cpp:36:28: error: 'x' does not name a type
36 | pair<ll, int> query(ll x) {
| ^
sequence.cpp:9:18: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+18' to '-2147483648' [-Woverflow]
9 | #define ll inf = -1e18;
| ^~~~~
sequence.cpp:22:12: note: in expansion of macro 'll'
22 | ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
| ^~
sequence.cpp:9:18: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+18' to '-2147483648' [-Woverflow]
9 | #define ll inf = -1e18;
| ^~~~~
sequence.cpp:29:14: note: in expansion of macro 'll'
29 | void add(ll k, ll m, int idx) {
| ^~
sequence.cpp: In member function 'bool LineContainer::isect(std::multiset<Line, std::less<void> >::iterator, std::multiset<Line, std::less<void> >::iterator)':
sequence.cpp:24:30: error: 'const struct Line' has no member named 'p'
24 | if (y == end()) { x->p = inf; return false; }
| ^
sequence.cpp:24:34: error: 'inf' was not declared in this scope; did you mean 'ynf'?
24 | if (y == end()) { x->p = inf; return false; }
| ^~~
| ynf
sequence.cpp:25:16: error: 'const struct Line' has no member named 'k'
25 | if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
| ^
sequence.cpp:25:24: error: 'const struct Line' has no member named 'k'
25 | if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
| ^
sequence.cpp:25:30: error: 'const struct Line' has no member named 'p'
25 | if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
| ^
sequence.cpp:25:37: error: 'const struct Line' has no member named 'm'
25 | if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
| ^
sequence.cpp:25:44: error: 'const struct Line' has no member named 'm'
25 | if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
| ^
sequence.cpp:25:48: error: 'inf' was not declared in this scope; did you mean 'ynf'?
25 | if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
| ^~~
| ynf
sequence.cpp:26:17: error: 'const struct Line' has no member named 'p'
26 | else x->p = div(y->m - x->m, x->k - y->k);
| ^
sequence.cpp:26:28: error: 'const struct Line' has no member named 'm'
26 | else x->p = div(y->m - x->m, x->k - y->k);
| ^
sequence.cpp:26:35: error: 'const struct Line' has no member named 'm'
26 | else x->p = div(y->m - x->m, x->k - y->k);
| ^
sequence.cpp:26:41: error: 'const struct Line' has no member named 'k'
26 | else x->p = div(y->m - x->m, x->k - y->k);
| ^
sequence.cpp:26:48: error: 'const struct Line' has no member named 'k'
26 | else x->p = div(y->m - x->m, x->k - y->k);
| ^
sequence.cpp:27:19: error: 'const struct Line' has no member named 'p'
27 | return x->p >= y->p;
| ^
sequence.cpp:27:27: error: 'const struct Line' has no member named 'p'
27 | return x->p >= y->p;
| ^
sequence.cpp: In function 'int main()':
sequence.cpp:52:16: error: 'pref' was not declared in this scope
52 | cin >> pref[i];
| ^~~~
sequence.cpp:58:13: error: 'dp' was not declared in this scope; did you mean 'dup'?
58 | dp[i][j] = {inf, 0};
| ^~
| dup
sequence.cpp:58:25: error: 'inf' was not declared in this scope; did you mean 'ynf'?
58 | dp[i][j] = {inf, 0};
| ^~~
| ynf
sequence.cpp:62:38: error: 'dp' was not declared in this scope; did you mean 'dup'?
62 | for (int i = 1; i <= n + 1; i++) dp[i][0] = {0, i};
| ^~
| dup
sequence.cpp:67:21: error: 'pref' was not declared in this scope
67 | cht.add(pref[j], (long long) dp[j+1][k - 1].first - pref[j] * pref[j], j);
| ^~~~
sequence.cpp:67:42: error: 'dp' was not declared in this scope; did you mean 'dup'?
67 | cht.add(pref[j], (long long) dp[j+1][k - 1].first - pref[j] * pref[j], j);
| ^~
| dup
sequence.cpp:68:35: error: 'struct LineContainer' has no member named 'query'
68 | auto [val, idx] = cht.query((long long) pref[n] + pref[j-1]);
| ^~~~~
sequence.cpp:73:13: error: 'dp' was not declared in this scope; did you mean 'dup'?
73 | cout << dp[1][K].first << "\n";
| ^~
| dup