Submission #1151662

#TimeUsernameProblemLanguageResultExecution timeMemory
1151662arkanefuryMouse (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 = 256+5; int n,m,k,tt,ans,sum=0,l, r, x, y, cnt, block = 448; void solve(int n){ vector<int>q, v; FOR(i, 1, n, 1){ q.pb(i); } random_shuffle(q); FOR(i, 1, 5040, 1){ next_permutation(all(q)); ans = query(q); if(ans == n){ return; } } } /* 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:20:19: error: no matching function for call to 'random_shuffle(std::vector<int>&)'
   20 |     random_shuffle(q);
      |     ~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/11/string:52,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from mouse.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:4568:5: note: candidate: 'template<class _RAIter> void std::random_shuffle(_RAIter, _RAIter)'
 4568 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
/usr/include/c++/11/bits/stl_algo.h:4568:5: note:   template argument deduction/substitution failed:
mouse.cpp:20:19: note:   candidate expects 2 arguments, 1 provided
   20 |     random_shuffle(q);
      |     ~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/11/string:52,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from mouse.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:4603:5: note: candidate: 'template<class _RAIter, class _Generator> void std::random_shuffle(_RAIter, _RAIter, _Generator&&)'
 4603 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~~~~~~~~~~~
/usr/include/c++/11/bits/stl_algo.h:4603:5: note:   template argument deduction/substitution failed:
mouse.cpp:20:19: note:   candidate expects 3 arguments, 1 provided
   20 |     random_shuffle(q);
      |     ~~~~~~~~~~~~~~^~~