繁华模拟赛 vicent的字符串

时间:2023-03-08 20:48:31
繁华模拟赛 vicent的字符串

繁华模拟赛 vicent的字符串

繁华模拟赛 vicent的字符串

#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn = ;
int n,k,a[maxn];
char cmd;
int main(){
freopen("str.in","r",stdin);
freopen("str.out","w",stdout);
ios::sync_with_stdio(false);
cin>>n>>k;
if(k == && n == ){
cout<<"a";
return ;
}
if(k == || k > n){
cout<<-;
return ;
}
int cnt = n;
for(int i = k;i >= ;i--){
a[cnt] = i;
cnt--;
}
for(int i = ;i <= cnt;i++){
if(i&) a[i] = ;
else a[i] = ;
}
for(int i = ;i <= n;i++){
cmd = 'a' - + a[i];
cout<<cmd;
}
return ;
}