Submission #1151650

#TimeUsernameProblemLanguageResultExecution timeMemory
1151650arkanefuryMouse (info1cup19_mouse)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.h" #define pb push_back using namespace std; #define F first #define sz size() #define S second #define in insert #define all(v) v.begin(), v.end() #define FOR(x, n, m, d) for(int x = n; x <= m; x += d) #define FORR(x, n) for(int i = x; i >= n; i --) #define nikita ios_base::sync_with_stdio(0), cin.tie(0); const int N = 1e6+5; int n,m,k,tt,ans,sum=0,l, r, x, y, cnt, block = 448; int pref[N], b[N],a[N]; void solve(int n){ vector<int>q, v; FOR(i, 1, n, 1){ q.pb(i); } FOR(i, 1, 1040, 1){ v = query(q); FOR(j, 0, v.sz-1, 1){ a[b[j]] = q[b[j]-1]; } } FOR(i, 1, n, 1)cout << b[i] << ' '; } /* signed main() { nikita tt = 1; if(!tt)cin >> tt; FOR(i, 1, tt, 1){ solve(); } } */

Compilation message (stderr)

mouse.cpp: In function 'void solve(int)':
mouse.cpp:22:20: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   22 |         v = query(q);
      |                    ^
In file included from /usr/include/c++/11/vector:72,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from mouse.cpp:1:
/usr/include/c++/11/bits/vector.tcc:198:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  198 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/vector.tcc:199:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  199 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/11/vector:67,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from mouse.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:709:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:709:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:730:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  730 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:730:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  730 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~