Submission #653553

#TimeUsernameProblemLanguageResultExecution timeMemory
653553ertoArt Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "art.h" typedef long long int ll; typedef long double ld; #define INF (int)(1e9 + 7) #define INF2 998244353 #define N (ll)(2e5 + 5) //#define f first //#define s second #define int ll #define lsb(x) (x & (-x)) using namespace std; int n, m, g, h; int st[N], en[N]; void solve(int n){ vector<int> v; for(int i=1; i<=n; i++)v.push_back(i); do{ int t = publish(v); if(t)break; } while(next_permutation(v)); answer(v); }

Compilation message (stderr)

art.cpp: In function 'void solve(ll)':
art.cpp:22:25: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   22 |         int t = publish(v);
      |                         ^
      |                         |
      |                         vector<long long int>
art.cpp:25:29: error: no matching function for call to 'next_permutation(std::vector<long long int>&)'
   25 |     while(next_permutation(v));
      |                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from art.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:2971:5: note: candidate: 'template<class _BIter> bool std::next_permutation(_BIter, _BIter)'
 2971 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_algo.h:2971:5: note:   template argument deduction/substitution failed:
art.cpp:25:29: note:   candidate expects 2 arguments, 1 provided
   25 |     while(next_permutation(v));
      |                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from art.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3004:5: note: candidate: 'template<class _BIter, class _Compare> bool std::next_permutation(_BIter, _BIter, _Compare)'
 3004 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_algo.h:3004:5: note:   template argument deduction/substitution failed:
art.cpp:25:29: note:   candidate expects 3 arguments, 1 provided
   25 |     while(next_permutation(v));
      |                             ^
art.cpp:26:12: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   26 |     answer(v);
      |            ^
      |            |
      |            vector<long long int>
interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~