Submission #583209

# Submission time Handle Problem Language Result Execution time Memory
583209 2022-06-25T05:25:09 Z AGE Zapina (COCI20_zapina) C++14
0 / 110
1 ms 256 KB
#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

zapina.cpp:43:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   43 | main()
      | ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -