Submission #583209

#TimeUsernameProblemLanguageResultExecution timeMemory
583209AGEZapina (COCI20_zapina)C++14
0 / 110
1 ms256 KiB
#include<bits/stdc++.h> #define F first #define S second #define pb push_back #define int long long using namespace std; const int N=1e6,M=2e3,mod=1e9+7; int cnt=0,n,vis[10]; set<vector<int>>st; void bt(int index) { if(index==n) { int ok=0; for(int j=1; j<=n; j++) { if(vis[j]>=j) ok=1; } vector<int>v; for(int j=1; j<=n; j++) v.pb(vis[j]); if(ok==1) cnt++,st.insert(v); return ; } for(int i=1; i<=n; i++) { vis[i]++; bt(index+1); vis[i]--; } } main() { cin>>n; bt(0); cout<<st.size()<<endl; return 0; }

Compilation message (stderr)

zapina.cpp:43:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   43 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...