mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
|
#include <stdio.h>
|
|||
|
#include <string.h>
|
|||
|
/*
|
|||
|
Jam<EFBFBD>Ǹ<EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>СдӢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷḻ<EFBFBD><EFBFBD><EFBFBD>ʡ<EFBFBD>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>ģ<EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>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<EFBFBD>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>Jam<EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><EFBFBD>Jam<EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD>Jam<EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>м<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
|
|||
|
char a[100];
|
|||
|
char fro;
|
|||
|
int size;
|
|||
|
size_t len;
|
|||
|
|
|||
|
bool dfs(size_t idx) {
|
|||
|
if(a[idx] >= fro + size - len + idx) {
|
|||
|
printf("a[idx] >= fro + size.\n");
|
|||
|
return dfs(idx - 1);
|
|||
|
}
|
|||
|
a[idx]++;
|
|||
|
for(size_t i = idx; i < len; i++){
|
|||
|
a[i] = (char) (a[i - 1] + 1);
|
|||
|
if(a[i] >= fro + size){
|
|||
|
return dfs(idx - 1);
|
|||
|
}
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
/*for(size_t i = len - 1; i >= 0; i--){
|
|||
|
if(a[i] >= fro + size){
|
|||
|
//
|
|||
|
}
|
|||
|
}*/
|
|||
|
int main(int argc, char** argv){
|
|||
|
int s, t, w;
|
|||
|
scanf("%i%i%i", &s, &t, &w);
|
|||
|
scanf("%s", a);
|
|||
|
size = t - s;
|
|||
|
len = strlen(a);
|
|||
|
fro = (char) ('a' - 1 + s);
|
|||
|
|
|||
|
for(int i = 0; i < 5 && dfs(len - 1); i++) {
|
|||
|
printf("%s\n", a);
|
|||
|
}
|
|||
|
// printf("%c", fro);
|
|||
|
// while(1);
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|