Problem shoes
User lyq
Submission Time 2024-12-06 15:20:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

shoes.cpp: In function ‘int count_swaps(std::vector<int>*)’:
shoes.cpp:54:26: error: no matching function for call to ‘abs(std::vector<int>&)’
54 | if(!mark[abs(s[i])]){
| ^
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 shoes.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:21: note: no known conversion for argument 1 from ‘std::vector<int>’ to ‘int’
840 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ~~~~^~~
In file included from /usr/include/c++/9/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++