Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
168692 | A班石婧予 | Jam的计数法 | C++ | 通过 | 100 | 0 MS | 256 KB | 487 | 2024-08-20 13:15:56 |
#include<bits/stdc++.h> char ch[35],m[35]={0,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q', 'r','s','t','u','v','w','x','y','z'}; int s,t,w; int main() { scanf("%d%d%d",&s,&t,&w); scanf("%s",ch+1); for(int i=1;i<=5;i++) for(int j=w;j>0;j--) if(ch[j]+1<=m[t-(w-j)]) { ch[j]++; for(int k=j+1;k<=w;k++) ch[k]=ch[k-1]+1; for(int k=1;k<=w;k++) printf("%c",ch[k]); printf("\n"); break; } fclose(stdin); fclose(stdout); return 0; }