Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
34414 lance [acwing]找数字 C++ 通过 0 MS 256 KB 358 2024-01-07 11:42:01

Tests(10/10):


#include <bits/stdc++.h> using namespace std; int t[105]; int main(){ int m,s; cin>>m>>s; int x=s; if(m*9<s||(s==0&&m>1))cout<<"-1 -1"; else { for(int i=m-1;i>0;i--){ t[i]=min(9,s-1); s-=t[i]; } t[0]=s; for(int i=0;i<m;i++)cout<<t[i]; cout<<" "; for(int i=1;i<=m;i++){ cout<<min(9,x); x-=min(9,x); } } }


测评信息: