Submission #206868

#TimeUsernameProblemLanguageResultExecution timeMemory
206868Sho10Arranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
/*
ID: Sho10
LANG: C++
*/
#include "shoes.h"
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
vector<ll>v;
ll count_swaps(std::vector<int> S){
    v=S;
    ll ans=0;
if(v[0]<0){
    ans=0;
}else ans=1;
return ans;
}


Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:27:7: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'std::vector<int>')
     v=S;
       ^
In file included from /usr/include/c++/7/vector:69:0,
                 from shoes.h:5,
                 from shoes.cpp:5:
/usr/include/c++/7/bits/vector.tcc:179:5: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]
     vector<_Tp, _Alloc>::
     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/vector.tcc:179:5: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::vector<long long int>&'
In file included from /usr/include/c++/7/vector:64:0,
                 from shoes.h:5,
                 from shoes.cpp:5:
/usr/include/c++/7/bits/stl_vector.h:461:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]
       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:461:7: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<long long int>&&'
/usr/include/c++/7/bits/stl_vector.h:482:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]
       operator=(initializer_list<value_type> __l)
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:482:7: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::initializer_list<long long int>'