#150 I forgot to write a problem-solving report last time, but I want to go back and try again recently because of the poor performance.
#152 what I did last night is also very bad. Recently I stayed up late and couldn't help it.
Write this article first and complete the Code. This is a reminder.
Round #150
A. It's too watery.
B.
[Cpp]
Ll n;
Set <int> ss;
Void dfs (ll x, int y, int z) // x is the constructed number, and y and z are two numbers, respectively, x is constructed by using two numbers, y and z.
{
If (x> n) return;
Ss. insert (x );
If (x = 0 & y = 0 & z = 0) return;
If (x = 0 & y = 0 ))
{
Dfs (x + z, y, z );
}
Else if (x = 0 & z = 0)
{
Dfs (x + y, y, z );
}
Else
{
Dfs (x * 10 + y, y, z );
Dfs (x * 10 + z, y, z );
}
}
Void solveB ()
{
Cin> n;
For (int I = 0; I <10; I ++)
For (int j = 0; j <10; j ++)
Dfs (0, I, j );
Cout <ss. size ()-1 <endl;
}
C
D
E
Round #152
A. Water question.
B. At first, I thought it was a JAVA attack. Because it was a maximum of 210 loops, I thought it could be done. I didn't expect it to be TLE, because it was too time-consuming to calculate the large numbers of JAVA. A pow (10 ^ 5) times out.
Then we typed a table with 4-bits and found that the last three bits have cyclic segments. These values are 200,110, 80, and respectively.
The next step is simple.
[Cpp]
String aa [] = {"50", "80", "170", "20", "200", "110 "};
Void solveB ()
{
Int n;
Cin> n;
If (n <= 2)
Cout <-1 <endl;
Else
{
If (n = 3)
Cout <210 <endl;
Else
{
Int l = n-1-aa [(n-4) % 6]. size ();
Cout <1;
For (int I = 0; I <l; I ++)
Cout <0;
Cout <aa [(n-4) % 6] <endl;
}
}
}
C
D
E
Too much water, so I have to answer other question...