#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b;
cin >> a >> b;
vector<string> v;
for(int i = 1; i < (1 << 16); i++) {
string s = "";
for(int j = 0; j < 16; j++) {
if((i >> j) % 2 == 1) s += (char)(j + 'a');
}
if(s.size() <= 15) v.push_back(s);
}
cout << v.size() << '\n';
for(int i = 0; i < (b + 1) / 2; i++) {
cout << v[i] << ' ';
}
for(int i = 0; i < b - (b + 1) / 2; i++) {
cout << v[i] << ' ' ;
}
cout << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |