1 条题解
-
0
Let be the number of digits of , and choose . The number contains only the digits and , so is good. Also,
Since , multiplying by simply shifts by positions. Therefore, is exactly the decimal concatenation of with itself. Hence, the set of digits appearing in is the same as in . Since is good, is good as well.
Thus, for every test case, one of the possible answers is simply
The construction always satisfies .
Time Complexity: .
设 为 的位数,并选取 。数字 仅包含数字 和 ,因此 是好的。此外,
由于 ,乘以 相当于将 向左移动 位。因此, 恰好是 与其自身的十进制拼接。于是, 中出现的数字集合与 中的相同。由于 是好的, 也是好的。
因此,对于每个测试用例,其中一个可能的答案就是
该构造始终满足 。
时间复杂度:。
Solution
#include<bits/stdc++.h> using namespace std; int main(){ int tt; cin >> tt; while(tt--){ int x; cin >> x; int y = 1; while(x > 0){ y *= 10; x /= 10; } cout << y + 1 << '\n'; } return 0; }
信息
- ID
- 3
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- (无)
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 上传者