跳到正文

题解

题解:CF2241B Good times Good times

YHW12345约 1 分钟
原文
文章信息与版本

文章信息

发布
2026年7月4日
收录
2026年7月6日
更新
2026年10月27日
篇幅
约 1 分钟
获赞
3
题目
CF2241B

版本

  1. v1当前

被 cloudflare 卡了

思路

注意到 1≤x≤108,2≤y≤1091\le x\le 10^8,2\le y\le 10^9,yy 的上限刚好是 xx 的上限的 1010 倍,所以我们可以构造:一个 11 加若干个 00 再加一个 11 这样一个数,其中 00 的个数是 xx 的长度减一,那么这样原数是好数,乘起来的数则是 xx 重复两遍,仍然是好数。

submission

C++
#include <bits/stdc++.h>
#define int long long
#define inf 0x3f3f3f3f3f3f3f3f
#define elif else if
using namespace std;
int x;
void solve(){
	cin>>x;
	cout<<1;
	x/=10;
	while(x){
		cout<<0;
		x/=10;
	}
	cout<<"1\n";
}
signed main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int Case=1;
	cin>>Case;
	while(Case--)solve();
}
原文