#include <bits/stdc++.h>
#define fre freopen("in","r",stdin),freopen("out","w",stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) (x.begin()) , (x.end())
#define fi first
#define se second
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define pq(t) priority_queue<t>
#define pb push_back
#define sz(x) x.size()
#define ppb pop_back
#define endl '\n'
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define fr front
#define mt make_tuple
#define bitcnt __builtin_popcount
typedef long long ll;
using namespace std;
int A,B;
int a,b,c;
int pr;
int32_t main ()
{
//fre;
fast_io;
cin >> A >> B;
for(int i=1;pr<B;i++,cout << ' ')
{
if(__builtin_popcount(i) > 15) continue;
pr++;
for(int k=0;(1<<k)<=i;k++)
if(i&(1<<k))
cout << char('a' + k);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
2 ms |
364 KB |
Output is correct |
6 |
Correct |
8 ms |
492 KB |
Output is correct |
7 |
Correct |
35 ms |
1260 KB |
Output is correct |
8 |
Correct |
47 ms |
1260 KB |
Output is correct |
9 |
Correct |
36 ms |
1260 KB |
Output is correct |
10 |
Correct |
41 ms |
1260 KB |
Output is correct |