books.cpp: In function 'long long int subtask3(std::vector<int>, int, int, int)':
books.cpp:18:25: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
18 | for(int i=s; dir==1 && i<=e || dir==-1 && i>=e; i += dir) {
| ~~~~~~~^~~~~~~
books.cpp: In function 'std::tuple<int, int, long long int> extend(std::vector<int>, int, int, int, int, int)':
books.cpp:30:35: warning: value computed is not used [-Wunused-value]
30 | if (l > max(lmost,0)) idx == --l;
| ~~~~^~~~~~
books.cpp:31:42: warning: value computed is not used [-Wunused-value]
31 | else if (r < min(rmost,n-1)) idx == ++r;
| ~~~~^~~~~~
books.cpp: In function 'long long int subtask4(std::vector<int>, int)':
books.cpp:76:15: warning: unused variable 'move' [-Wunused-variable]
76 | long long move = 0;
| ^~~~
books.cpp: In function 'long long int fulltask(std::vector<int>, int)':
books.cpp:99:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
99 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:99:33: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
99 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:99:42: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=]
99 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:99:52: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long long int' [-Wformat=]
99 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:99:62: warning: format '%d' expects argument of type 'int', but argument 6 has type 'long long int' [-Wformat=]
99 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:102:73: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
102 | if(right <= n-1 && (left < 0 || moveR < moveL || moveR == moveL && right <= rightmost)) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
books.cpp:111:78: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
111 | else if(0 <= left && (right > n-1 || moveR > moveL || moveR == moveL && right > rightmost)) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
books.cpp:121:20: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
121 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:121:29: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
121 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:121:38: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=]
121 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:121:48: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long long int' [-Wformat=]
121 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:121:58: warning: format '%d' expects argument of type 'int', but argument 6 has type 'long long int' [-Wformat=]
121 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp: In function 'std::tuple<int, int, long long int> extend(std::vector<int>, int, int, int, int, int)':
books.cpp:32:26: warning: 'idx' is used uninitialized in this function [-Wuninitialized]
32 | move += abs(p[idx]-idx);
| ^