QOJ.ac

QOJ

実行時間制限: 6 s - 12 s メモリ制限: 1024 MB 満点: 41

#5874. 神秘正方形

統計

我写下了一个很大的二进制完全平方数,然后将其中的一些数字替换成了问号。你能找出我原来的数字是什么吗?

输入格式

输入的第一行包含测试用例的数量 $T$。接下来有 $T$ 行,每行包含一个字符串 $S$:一个用二进制表示的完全平方数,其中一些数字被替换成了问号。

输出格式

对于每个测试用例,输出一行 "Case #x: $N$",其中 $x$ 是测试用例编号(从 1 开始),$N$ 是通过将 $S$ 中的每个 '?' 字符替换为 '0' 或 '1' 而得到的二进制完全平方数。

样例

输入格式 1

3
1???
1
10??110??00??1000??

输出格式 1

Case #1: 1001
Case #2: 1
Case #3: 1011110110000100001

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.