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 'long long int subtask4(std::vector<int>, int)':
books.cpp:47:15: warning: unused variable 'move' [-Wunused-variable]
47 | long long move = 0;
| ^~~~
books.cpp: In function 'std::tuple<int, int, long long int> extend(std::vector<int>, int, int, int, int, int)':
books.cpp:64:35: warning: value computed is not used [-Wunused-value]
64 | if (l > max(lmost,0)) idx == --l;
| ~~~~^~~~~~
books.cpp:65:42: warning: value computed is not used [-Wunused-value]
65 | else if (r < min(rmost,n-1)) idx == ++r;
| ~~~~^~~~~~
books.cpp: In function 'long long int fulltask(std::vector<int>, int)':
books.cpp:79:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
79 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:79:33: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
79 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:79:42: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=]
79 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:79:52: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long long int' [-Wformat=]
79 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:79:62: warning: format '%d' expects argument of type 'int', but argument 6 has type 'long long int' [-Wformat=]
79 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:82:73: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
82 | if(right <= n-1 && (left < 0 || moveR < moveL || moveR == moveL && right <= rightmost)) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
books.cpp:91:78: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
91 | else if(0 <= left && (right > n-1 || moveR > moveL || moveR == moveL && right > rightmost)) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
books.cpp:101:20: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
101 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:101:29: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
101 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:101:38: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=]
101 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~
| | |
| int long long int
| %lld
books.cpp:101:48: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long long int' [-Wformat=]
101 | printf("total=%d, sumL=%d, sumR=%d, moveL=%d, moveR=%d\n",total,sumL,sumR,moveL,moveR);
| ~^ ~~~~~
| | |
| int long long int
| %lld
books.cpp:101:58: warning: format '%d' expects argument of type 'int', but argument 6 has type 'long long int' [-Wformat=]
101 | 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:66:26: warning: 'idx' is used uninitialized in this function [-Wuninitialized]
66 | move += abs(p[idx]-idx);
| ^