fish2.cpp: In function 'item operator+(item, item)':
fish2.cpp:31:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
31 | for (i = 0; i < b.pref.size() && b.pref[i].need <= res.pref.back().sum; ++i)
| ~~^~~~~~~~~~~~~~~
fish2.cpp:33:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for (; i < b.pref.size(); ++i) {
| ~~^~~~~~~~~~~~~~~
fish2.cpp:35:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
35 | if (i + 1 == b.pref.size()) res.pref.back().cnt = 0;
| ~~~~~~^~~~~~~~~~~~~~~~
fish2.cpp:40:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
40 | for (i = 0; i < a.suf.size() && a.suf[i].need <= res.suf.back().sum; ++i)
| ~~^~~~~~~~~~~~~~
fish2.cpp:42:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
42 | for (; i < a.suf.size(); ++i) {
| ~~^~~~~~~~~~~~~~
fish2.cpp:44:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
44 | if (i + 1 == a.suf.size()) res.suf.back().cnt = 0;
| ~~~~~~^~~~~~~~~~~~~~~
fish2.cpp:52:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
52 | if (i == a.suf.size()) break;
| ~~^~~~~~~~~~~~~~~
fish2.cpp:58:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
58 | if (i == b.pref.size()) break;
| ~~^~~~~~~~~~~~~~~~
fish2.cpp:65:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
65 | if (j < a.suf.size() && s >= a.suf[j].need) {
| ~~^~~~~~~~~~~~~~
fish2.cpp:68:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
68 | } else if (k < b.pref.size() && s >= b.pref[k].need) {
| ~~^~~~~~~~~~~~~~~
fish2.cpp:73:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
73 | if (j == a.suf.size()) {
| ~~^~~~~~~~~~~~~~~
fish2.cpp:74:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
74 | if (k == b.pref.size()) {
| ~~^~~~~~~~~~~~~~~~
fish2.cpp:82:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<info>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
82 | } else if (k == b.pref.size()) {
| ~~^~~~~~~~~~~~~~~~
fish2.cpp: In function 'void build(int, int, int)':
fish2.cpp:95:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
95 | int m = tl + tr >> 1;
| ~~~^~~~
fish2.cpp:97:17: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
97 | build(v + (tr - tl & ~1), m, tr);
| ~~~^~~~
fish2.cpp:98:31: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
98 | t[v] = t[v + 1] + t[v + (tr - tl & ~1)];
| ~~~^~~~
fish2.cpp: In function 'void update(int, int, int, int, int)':
fish2.cpp:105:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
105 | int m = tl + tr >> 1;
| ~~~^~~~
fish2.cpp:107:29: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
107 | else update(i, x, v + (tr - tl & ~1), m, tr);
| ~~~^~~~
fish2.cpp:108:31: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
108 | t[v] = t[v + 1] + t[v + (tr - tl & ~1)];
| ~~~^~~~
fish2.cpp: In function 'item query(int, int, int, int, int)':
fish2.cpp:115:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
115 | int m = tl + tr >> 1;
| ~~~^~~~
fish2.cpp:116:57: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
116 | return query(l, r, v + 1, tl, m) + query(l, r, v + (tr - tl & ~1), m, tr);
| ~~~^~~~
fish2.cpp: In function 'int main()':
fish2.cpp:120:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
120 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
fish2.cpp:121:35: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
121 | for (int i = 0; i < n; ++i) scanf("%d", a + i);
| ~~~~~^~~~~~~~~~~~~
fish2.cpp:123:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
123 | scanf("%d", &q);
| ~~~~~^~~~~~~~~~
fish2.cpp:126:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
126 | scanf("%d", &type);
| ~~~~~^~~~~~~~~~~~~
fish2.cpp:129:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
129 | scanf("%d%d", &i, &x);
| ~~~~~^~~~~~~~~~~~~~~~
fish2.cpp:133:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
133 | scanf("%d%d", &l, &r);
| ~~~~~^~~~~~~~~~~~~~~~