I need to translate C++ code of my friends to say Perl/Haskell code to avoid getting detected by cheating checker of codeforces. Google translate doesn't work :( Can anyone suggest any alternative ? Thanks in advance
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
I need to translate C++ code of my friends to say Perl/Haskell code to avoid getting detected by cheating checker of codeforces. Google translate doesn't work :( Can anyone suggest any alternative ? Thanks in advance
How to solve this : link
I am pretty new unfortunately. So this is the question i just can't figure out how to solve.
Statement:
Sveta loves chocolates. More specifically she loves to have Gems chocolates. In PET most people love numbers, so here the different types of Gems are distinguished by numbers(unlike the boring blue/green/red colors).
As you already know, PET is a magical place. So every Wednesday, the Gems in the packet mysteriously increase in quantity. While most people never bothered to find out the reason, Sveta, being a smart girl, decoded the pattern in which this weird phenomenon occurred. She noticed that if the Gem had a number N, it would split into Gems with numbers in range of 2 to N-1 if the numbers were a factor of N. This splitting would go on until there was no way to split any remaining Gems in this manner.
Now Puru wants to know the final sum of numbers of the Gems after magical transformation in order to impress Sveta. Help him out.
Input:
First line contains T number of testcases
Next line contains N, the number of Gems in the packet Sveta has bought
Next line contains N integers, denoting the number assigned to each gem.
Output:
Print the sum of numbers of all gems after the magical transformation has taken place.
Constraints:
1 <= T <= 1000
1 <= N <= 40
2 <= number assigned to gems <= 10^4
Sample:
Input:
1
2
2 12
Output:
14
Explanation:
Now the first gem with value 2 can't divide as per the rules, so it stays as it is. Gem with number 12 divides into 4 gems with numbers 2,3,4 and 6. Now gems 2 and 3 cant divide, however gems 4 and 6 can divide into gems 2 and gems 2,3 respectively. Now the gems can't divide anymore and the magical transformation ends. So the result is 2 + 2+3 + 2 + 2+3 = 14
By first finding depth of each node using BFS, then selecting nodes with maximum depth, we can implement Dijsktra to find the path. Once you get the path, just look at the path for 15 seconds else you'll get WA. Then look at cats in path. Also look at hawks , snipers, terrorists as well, since they can easily kill a parrot.
Then do headshot snipers and use cats to kill the hawks.
After doing all this, use BrainF**k to submit your code
Have a nice Day
Is it really hard ?
Name |
---|