# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
604412 | inksamurai | Esej (COCI15_esej) | C++17 | 298 ms | 16988 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |