candies.cpp: In function 'int main()':
candies.cpp:24:52: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll* {aka long long int*}' [-Wformat=]
for(int i = 1; i<= n; i++) scanf("%d", &cost[i]);
~~~~~~~~^
candies.cpp:41:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if(val(succ[succ[u]])) pred[succ[succ[u]]] = u; succ[u] = succ[succ[u]];
^~
candies.cpp:41:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
if(val(succ[succ[u]])) pred[succ[succ[u]]] = u; succ[u] = succ[succ[u]];
^~~~
candies.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
candies.cpp:24:37: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i = 1; i<= n; i++) scanf("%d", &cost[i]);
~~~~~^~~~~~~~~~~~~~~~