Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
173560 简晨希1314 Jam的计数法 C++ 无测评数据 0 0 MS 0 KB 658 2024-08-20 21:32:44

Tests(0/0):


#include<iostream> #include<algorithm> using namespace std; int s, t, w; char str[26],pre; int main() { cin >> s >> t >> w >> str; for(int i = 0 ; i < 5; i ++){ if (str[0] == 'a' + t - w) break; for(int j = w -1 ; j >= 0; j --){ if(str[j] == 'a' + t - w + j) continue; pre = ++ str[j]; for(int k = j + 1; k < w; k ++){ str[k] = ++ pre; } for(int k = 0; k < w; k ++) cout << str[k]; cout << endl; break; } } return 0; }