题意:给定n与m,要求构造两个长度不超过2230的数字x,y使得x,y各自的数位和>=n,x+y的数位和<=n
思路:
1 #include<cstdio> 2 #include<cstring> 3 #include<string> 4 #include<cmath> 5 #include<iostream> 6 #include<algorithm> 7 #include<map> 8 #include<set> 9 #include<queue> 10 #include<vector> 11 using namespace std; 12 typedef long long ll; 13 typedef unsigned int uint; 14 typedef unsigned long long ull; 15 typedef pair<int,int> PII; 16 typedef vector<int> VI; 17 #define fi first 18 #define se second 19 #define MP make_pair 20 #define N 2100000 21 #define MOD 1000000007 22 #define eps 1e-8 23 #define pi acos(-1) 24 25 26 27 28 int read() 29 { 30 int v=0,f=1; 31 char c=getchar(); 32 while(c<48||57<c) {if(c=='-') f=-1; c=getchar();} 33 while(48<=c&&c<=57) v=(v<<3)+v+v+c-48,c=getchar(); 34 return v*f; 35 } 36 37 void swap(int &x,int &y) 38 { 39 int t=x;x=y;y=t; 40 } 41 42 43 int main() 44 { 45 // freopen("cf1028B.in","r",stdin); 46 // freopen("cf1028B.out","w",stdout); 47 int n,m; 48 scanf("%d%d",&n,&m); 49 for(int i=1;i<=2230;i++) printf("8"); 50 printf(" "); 51 for(int i=1;i<=2229;i++) printf("1"); 52 printf("2"); 53 return 0; 54 }