Cod sursa(job #3375866)

Utilizator 20r50Gheorghies Robert 20r50 Data 14 noiembrie 2026 10:39:18
Problema Submultimi Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 1.77 kb
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define i27 __int128
using namespace std;
const ll NMAX=1e6+5;
const ll NMAX2=1+5;
const double eps=1e-8;
const ll TIME_MAX=9e8+5;
const ll MOD=1999999973;
const ll PLUS=1e5;
const ll K=300;
ll get_time(){
    return chrono::steady_clock::now().time_since_epoch().count();
}
/*vector<int> v;
bitset<NMAX> c;
void ciur(){
    c[0]=c[1]=1;
    for(ll i=2;i<NMAX;i++){
        if(c[i]==0){
            v.push_back(i);
            for(ll j=i*i;j<NMAX;j+=i){
                c[j]=1;
            }
        }
    }
}*/
ll binPow(ll a,ll p){
    ll ans=1;
    while(p){
        if(p&1){
            ans*=a;
            ans%=MOD;
        }
        a*=a;
        a%=MOD;
        p/=2;
    }
    return ans;
}
bool good(ll n, ll p){
    while(n){
        p-=n/5;
        n/=5;
    }
    return (p<=0);
}
int v[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
void probleme(){
    //ciur();
    ll n;
    cin>>n;
    ll x=(1<<n);
    for(ll msk=1;msk<x;msk++){
        for(ll i=0;i<n;i++){
            if(msk&(1<<i)){
                cout<<v[i]<<' ';
            }
        }
        cout<<'\n';
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("thing2.in","r",stdin);
    freopen("thing2.out","w",stdout);
#else
    freopen("submultimi.in","r",stdin);
    freopen("submultimi.out","w",stdout);
#endif
    ll start=get_time();
    //ll t; cin>>t; while(t--)
    probleme();
    ll x=get_time()-start;
    cerr<<"------>secunde - "<<x/1000000000<<'\n';
    cerr<<"-->milisecunde - "<<x/1000000%1000<<'\n';
    cerr<<"->microsecunde - "<<x/1000%1000<<'\n';
    cerr<<"-->nanosecunde - "<<x%1000;
    return 0;
}