| SBC Brazilian Phase Zero 2025 |
|---|
| Finished |
The SBC (Brazilian Computer Society) is developing various models of architectures for quantum computers, with the goal of making them accessible to everyone in the future. One of the main challenges faced by the development teams is quantum decoherence, which occurs when a qubit in superposition (simultaneously representing states $$$0$$$ and $$$1$$$) collapses to $$$0$$$ or $$$1$$$ due to environmental interference.
For each model developed, the rate of quantum decoherence will be analyzed. To do this, the qubits will be observed in an isolated state and under normal temperature and pressure conditions. The rate of quantum decoherence is the ratio between the number of qubits that collapsed under normal temperature and pressure conditions and the number of qubits that were in superposition in the isolated state.
Since there are several models, you have been asked to develop a program that calculates this rate. After all, you need extracurricular hours to graduate, right?!
The first line contains an integer $$$N$$$ ($$$10 \leq N \leq 10^5$$$) indicating the number of qubits in the computer. The next two lines contain the strings $$$S$$$ (isolated state) and $$$T$$$ (normal conditions), respectively, each of size $$$N$$$, composed of the characters $$$\{0, 1, *\}$$$, where $$$*$$$ indicates a qubit in superposition.
It is guaranteed that:
The output should contain the rate of quantum decoherence in decimal form, with exactly two decimal places.
10 0*1**100*1 0110*100*1
0.50
13 *1*01*100*01* 01*0101001011
0.80
25 *10*1*110*01*011100*110*0 *1011*110001*011100*110*0
0.29
| Name |
|---|


