Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
171978 陈熙峻B班 Jam的计数法 C++ 通过 100 1 MS 244 KB 749 2024-08-20 21:08:14

Tests(10/10):


#include <bits/stdc++.h> #define inf 0x3f3f3f3f typedef long long ll; char ss[50]; int a[50]; using namespace std; int main() { int s,t,w,i,j,x; scanf("%d%d%d%s",&s,&t,&w,ss+1); for(i=1;i<=w;i++) a[i]=ss[i]-'a'+1; for(i=1;i<=5;i++) { x=-1; for(j=w;j>=1;j--) { if(a[j]!=t-w+j) { x=j; break; } } if(x<0) break; a[x]++; for(j=x+1;j<=w;j++) { a[j]=a[j-1]+1; } for(j=1;j<=w;j++) { printf("%c",a[j]+'a'-1); } printf("\n"); } return 0; }


测评信息: