Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
45538 | 徐若宸 | 新数 | C++ | Accepted | 0 MS | 248 KB | 171 | 2024-04-14 20:39:45 |
#include<bits/stdc++.h> using namespace std; int main(){ string n; cin>>n; if(prev_permutation(n.begin(),n.end())&&n[0]!=0){ cout<<n; } else cout<<"-1"; }