Problem - 1511B - Codeforces

解析:
首先构造 z,可以构造成 10^(c - 1) 次方,这样一定满足c位
然后构造x和y,显然x和y除以10^(c - 1)需要互质,直接找两个符合条件位数的质数即可。
#include<bits/stdc++.h>
using namespace std;
#define int long long
int t,a,b,c;
int x[100]={0,2,11,101,1009,10007,100003,1000003,10000019,100000007,1000000007};
int y[100]={0,3,13,103,1013,10009,100019,1000033,10000079,100000037,1000000009};
int f(int n){
	int cnt=0;
	while(n) cnt++,n/=10;
	return cnt;
}
signed main(){
	scanf("%lld",&t);
	while(t--){
		scanf("%lld%lld%lld",&a,&b,&c);
		int t=pow(10,c-1);
		int p,q;
		for(int i=1;i<=10;i++) if(f(x[i]*t)==a){
			p=x[i]*t;
			break;
		}
		for(int i=1;i<=10;i++) if(f(y[i]*t)==b){
			q=y[i]*t;
			break;
		}
		printf("%lld %lld\n",p,q);
	}
	return 0;
}






![[java进阶]——线程池的使用,自定义线程池](https://img-blog.csdnimg.cn/8541a96139ba46ee8a312797614a5a14.png)











