Problem | candles |
---|---|
User | username |
Submission Time | 2023-11-25 14:13:35 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
candles.cpp: In function ‘void runtc()’:
candles.cpp:20:36: error: no matching function for call to ‘abs(int&, int&)’
20 | ans=min(ans,abs(arr[i],arr[i-k+1])+abs(arr[i]-arr[i-k+1));
| ^
In file included from /usr/include/c++/9/bits/std_abs.h:38,
from /usr/include/c++/9/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from candles.cpp:1:
/usr/include/stdlib.h:840:12: note: candidate: ‘int abs(int)’
840 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:840:12: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/9/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from candles.cpp:1:
/usr/include/c++/9/bits/valarray_after.h:445:5: note: candidate: ‘template<class _Tp>