horses.cpp: In function 'long long int calc()':
horses.cpp:70:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
70 | int last = n+1;
| ~^~
horses.cpp:76:15: error: invalid type argument of unary '*' (have 'int')
76 | int idx = -(*it);
| ^~~
horses.cpp:78:29: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
78 | vec.push_back({1,get(1,1,n,idx+1,last-1)});
| ^
horses.cpp:86:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
86 | for(int i = 1;i<vec.size();i++){
| ~^~~~~~~~~~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:108:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
108 | update(1,1,n,i,b[i]);
| ^
horses.cpp:108:21: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
108 | update(1,1,n,i,b[i]);
| ~~~^
horses.cpp:114:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
114 | return calc();
| ~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:126:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
126 | return calc();
| ~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:132:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
132 | update(1,1,n,pos+1,b[pos+1]);
| ^
horses.cpp:132:28: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
132 | update(1,1,n,pos+1,b[pos+1]);
| ~~~~~~~^
horses.cpp:134:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
134 | return calc();
| ~~~~^~