Codeforces 1335 B. Construct the String_子串

题意:

求一个 Codeforces 1335 B. Construct the String_子串_02 长度的字符串,要求每 Codeforces 1335 B. Construct the String_子串_03 个长度的子串中要有 Codeforces 1335 B. Construct the String_字符串_04

直接按照 长度为 Codeforces 1335 B. Construct the String_子串_03

AC代码:

const int N = 1e4 + 10;
char s[N];

int main()
{
int t;
sd(t);
while (t--)
{
int a, b, n;
sddd(n, a, b);
rep(i, 1, a - b + 1)
s[i] = 'a';
char c = 'b';
rep(i, a - b + 2, a)
s[i] = c++;
int pos = 0;
rep(i, 1, n)
{
pos++;
if (pos > a)
pos = 1;
printf("%c", s[pos]);
}
printf("\n");
}
return 0;
}