AIM Tech Round 5 (rated, Div. 1 + Div. 2) B. Unnatural Conditions

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Light2Chasers/article/details/82141533
  1. problem link:here!!
  2. 题意:s(x)=x的所有组成数字之和。依题意需满足s(a)>=n,s(b)>=n,s(a+b)<=m.。只需构造得到s(a)最大s(a+b)最小即可。
  3. AC code:
#include<bits/stdc++.h>
using namespace std;
const int N=2e2;
string a,b;
int main(){
    for(int i=1;i<=N;i++)a.push_back('9'),b.push_back('0');
    b[0]='1';for(int i=1;i<=N;i++)b.push_back('9');
    reverse(a.begin(),a.end());reverse(b.begin(),b.end());
    cout<<a<<endl<<b<<endl;
}

猜你喜欢

转载自blog.csdn.net/Light2Chasers/article/details/82141533