Submission #1320207

#TimeUsernameProblemLanguageResultExecution timeMemory
1320207ezzzayBinaria (CCO23_day1problem1)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back #define int long long const int N=3e6+5; int a[N]; bool fs[N]; int x[N]; vector<pair<int,int>>sm,df; signed main(){ int n,k; cin>>n>>k; n=min() for(int i=1;i<=n-k+1;i++){ cin>>x[i]; } int cnt=0; for(int i=0;i<(1<<k);i++){ deque<int>dq; for(int j=0;j<k;j++){ if(i & (1<<j))dq.pb(1); else dq.pb(0); } bool u=1; for(int j=1;j<=n-k+1;j++){ int s=0; for(auto p:dq)s+=p; if(s!=x[j])u=0; if(x[j]!=x[j+1]){ dq.pb(dq[0]^1); } else{ dq.pb(dq[0]); } dq.pop_front(); } cnt+=u; } cout<<cnt; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:15:10: error: no matching function for call to 'min()'
   15 |     n=min()
      |       ~~~^~
In file included from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from Main.cpp:1:
/usr/include/c++/13/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
Main.cpp:15:10: note:   candidate expects 2 arguments, 0 provided
   15 |     n=min()
      |       ~~~^~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
Main.cpp:15:10: note:   candidate expects 3 arguments, 0 provided
   15 |     n=min()
      |       ~~~^~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5775:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
Main.cpp:15:10: note:   candidate expects 1 argument, 0 provided
   15 |     n=min()
      |       ~~~^~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note:   template argument deduction/substitution failed:
Main.cpp:15:10: note:   candidate expects 2 arguments, 0 provided
   15 |     n=min()
      |       ~~~^~
Main.cpp:16:17: error: 'i' was not declared in this scope
   16 |     for(int i=1;i<=n-k+1;i++){
      |                 ^