# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
583209 | AGE | Zapina (COCI20_zapina) | C++14 | 1 ms | 256 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |