题解:P14683 [ICPC 2025 Yokohama R] Decompose and Concatenate
_upper_bound · · 题解
简单贪心题。
首先我们肯定是要让新数的位数更多,这样新数才会更大。
结合这题给的样例,我们可以大概找到这么一个规律。新数的后缀总是有
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n;cin>>n;
ll t=log10(n);t=pow(10,t);
if(n-t<t/10) t/=10;
cout<<n-t<<t;
return 0;
}