Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
34419 | 通过 | [acwing]找数字 | C++ | 通过 | 0 MS | 252 KB | 356 | 2024-01-07 11:45:54 |
#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); } } }