Technocup 2017 - Elimination Round 1
I recently participated in Hackx_FDU held by Fudan University, and I gained a lot~ I saw many great people, and I was amazed that a group of people can write such wonderful code in a short time.
I played this Technocup for two hours during the Hackx competition without eating dinner. . . However, the effect is very bad. . . My head felt sleepy, and I was also quite anxious. . . Question B is about accuracy. . . Question C has also been brain-dead for a long time. . . Just got out. . .
Title link and Code link
A Transformation: from A to B
A number can be multiplied by $2$ or $10+1$. Ask about the solution from $A$ to $B$.
Wide search.
B Bill Total Value
The meaning of the question is to give a string containing the price of each item. If there are two digits after the decimal point, it means it is a decimal. If it has three digits, it is an integer. Ask for the total price.
The accuracy is inexplicably stuck. . . It runs OK locally and is always WA when submitted. Next, multiply this situation directly by 100 and replace it with integer operation. . .
1 | char x[maxn]; |
C Guess the Array
The meaning of the question is that for an array with a length of $N$, you can ask the sum between two elements of $N$. Finally output this array.
Also retarded. . . The idea has always been dead, asking 1 2/2 3/3 4/../n..1, but in fact this can be deduced in the end, which means there are many solutions. . So directly find 12/ 2 3/ 3 1. After the first three elements are removed, the remaining elements will also come out. . Really retarded. . . WA 5 times, finally got it.
D T-shirts Distribution
Everyone can have a fixed size of clothes, or they can choose between two models (the two models must be adjacent). Now give the quantities of 6 types of clothes and ask about the distribution of clothes.
Water question. . Start greedy directly from the smallest one. .
E Games on a CD
The length of each name is equal. Now $g$ strings are given. Select $n$ from these $g$ strings. If you go clockwise, you can form the given characters. .
AC automata, because the lengths are equal, cannot be covered, so just run it again to see if there are repetitions + enough quantity in the end.
F Polycarp’s problems
Given an array $a_i$ with a length of $n$, and then the starting value is $b_i$, it is required that when the starting value is $b_i$, when it encounters a $a_i$, it is added, but it cannot be less than or equal to 0. How many values should be removed in the end. Now there are m queries, and for each $b_i$, the minimum quantity to be removed is required.
Divide into two parts to get the minimum value required from $1$ to $n$, and then divide it into two parts again in the result.