# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
469370 | ala2 | Esej (COCI15_esej) | C++14 | 104 ms | 9156 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>
#define int long long
using namespace std;
int n,m;
int g=0;
char v;
map<string ,int>mm;
void f(int i,char w,string s)
{
if(g==n)
return ;
if(w>'z')
return ;
if(i==10)
{
if(mm[s])
return ;
cout<<s<<" ";
mm[s]=1;
g++;
return ;
}
string c=s;
w='a'-1;
c+=w;
while(w<'z'){
c.pop_back();
w++;
c+=w;
f(i+1,w,c);
}
}
signed main()
{
cin>>n>>m;
n=min(n,m);
v='a';
f(0,'a',"");
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |