Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
62139 | Masterxuan | 新数 | C++ | 通过 | 0 MS | 244 KB | 295 | 2025-03-09 15:17:16 |
#include <bits/stdc++.h> using namespace std; string fun(string s) { string x=s; prev_permutation(x.begin(), x.end()); if(x>s){ return "-1"; } else{ return x; } } int main() { string n; cin >> n;; cout<<fun(n); return 0; }