Submission #604412

#TimeUsernameProblemLanguageResultExecution timeMemory
604412inksamuraiEsej (COCI15_esej)C++17
80 / 80
298 ms16988 KiB
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define sz(a) (int)a.size()
#define vec(...) vector<__VA_ARGS__>
#define _3Pxrs5V ios::sync_with_stdio(0),cin.tie(0)
typedef long long ll;
using pii=pair<int,int>;
using vi=vector<int>;
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}
//e 

vec(string) basis;

void fill_basis(string s){
	if(sz(s)>4){
		return;
	}
	if(sz(s)){
		basis.pb(s);
	}
	rep(ch,26){
		s+=(char)(ch+'a');
		fill_basis(s);
		s.pop_back();
	}
}

signed main(){
_3Pxrs5V;
	fill_basis("");
	int l,r;
	cin>>l>>r;
	while(sz(basis)>r){
		basis.pop_back();
	}
	for(auto s:basis){
		cout<<s<<" ";
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...