You are playing Pacman and you want to eat the power pellet to defeat the pesky ghosts.
Pacman moves one cell to the left, right, top or bottom every second. What is the minimum time needed for him to eat the power pellet?
The first line of input contains two integers, $$$n, m$$$ ($$$1 \le n,m \le 100$$$, $$$nm \ge 2$$$). The next $$$n$$$ lines of input contains $$$m$$$ characters. Each character is one of the following: #, ., P or O. P denotes Pacman, O denotes the power pellet, . denotes an empty cell and # denotes a blocked cell.
Output the minimum number of seconds required for Pacman to eat the power pellet. If the task is impossible, output $$$-1$$$.
You get $$$100$$$ points if and only if you passed all testcases.
1 2 OP
1
3 5 ##### #O..P ###..
3
3 5 #.#.# O#.P# .##.#
-1
The input consists of a string $$$s$$$ ($$$1 \le |s| \le 10$$$), where all characters are the same and can either be A, B or C.
There are $$$25$$$ possible tests excluding samples. Getting a test correct will give you $$$4$$$ points (for a total of $$$100$$$ points).
AAAA
273/275
B
272/300
CCCCCCCCC
36/149
AAA
221/225
A
317/323
You have learned about polynomial hashing recently. Firstly, you choose a prime $$$MOD$$$ and a large enough integer $$$C$$$. Then, for every string $$$s = s_{n-1}s_{n-2}\cdots s_{1}s_{0}$$$ of lowercase English letters, you hash it to the value $$$\displaystyle\sum_{i=0}^{n-1}val(s_{i}) \cdot C^{i} \pmod{MOD}$$$, where val(a) = 1, val(b) = 2, ..., val(z) = 26.
You tested this algorithm by hashing $$$10000$$$ random strings of length $$$50$$$. You choose $$$MOD = 10^{9}+9$$$ because that's your favourite prime. However, you realized halfway that you are not using the same value of $$$C$$$ to hash every string! More precisely, for every string, you chose either $$$C = 115381398$$$ or $$$C = 276147934$$$ uniformly randomly and hash the string using this value of $$$C$$$.
You wonder if there is a way to tell which value of $$$C$$$ you used to hash each string. Can you solve this task?
Sample implementation of the hash function in C++: https://ideone.com/xYGvdD
The first line of input contains a single integer, $$$t$$$ ($$$t = 10000$$$).
Each of the next $$$t$$$ lines contain a single integer, $$$x_i$$$ ($$$0 \le x_i \lt 10^{9}+9$$$), denoting the hash value of the $$$i$$$-th string.
There are more lines in the input but they are meant to be used for the checker only and it is guaranteed that you do not need to use them to get full score.
Output $$$t$$$ lines, each containing a single integer. If you think $$$x_i$$$ is generated by $$$C = 115381398$$$, output $$$1$$$ on the $$$i$$$-th line. Otherwise, output $$$0$$$ on the $$$i$$$-th line.
You get more points if you get more testcases correct. You will get positive score if and only if you get at least half the testcases correct.
2 923051192 596459381
1 0
Note that the sample shown is not a valid input based on the constraints, because $$$t \neq 10000$$$.
zscoder needs to complete his math homework, but he is out of time. Can you help him?
Note: Apparently his homework problems are written in a different language. I hope this won't stop you from solving the problems.
The samples cover all possible types of inputs. Please check them out.
Output a single real number, the answer to the homework problem. Your answer will be accepted if it is close enough to the actual answer (i.e. $$$10^{-4}$$$ relative or absolute error).
It is guaranteed that the answer fits in a C++ long double type in all the hidden testcases.
There are $$$13$$$ hidden tests, $$$11$$$ of which are worth $$$6$$$ points each and $$$2$$$ of which are worth $$$17$$$ points (for a total of $$$100$$$ points).
fallocest(1.2345)*fallocest(1.2345)+sploop(1.2345)*sploop(1.2345)
1.000000000000000
strustate(12)
39916800.000000000000000
fabrate(tudefy(10000000000000000))
4.000000000000000
tudefy(fabrate(10000000000000000))
8.000000000000000
chaness(fallocest(4.1))*strustate(0.5)
1.018848917625599
ensalex(fabrate(3)-sploop(1.23))
0.668343826109546
holofy(1)+quendle(1)
3.560982621408760
ensalex(holofy(1))+fallocest(strustate(1))
1.758585210885417
chaness(-10)/holofy(quendle(0.2))
8.003528474734495
strustate(sploop(0.5))
1.847498857994100
strustate(ensalex(0.49))
1.943784695029594
fabrate(2)+ensalex(2)+fallocest(2)+sploop(2)+strustate(2)+holofy(2)+quendle(2)+tudefy(2)+chaness(2)
14.699921230059308
This problem was created a long time ago. However, since I don't think it was seriously attempted, here it is again.
duckmoon is solving trivial problems on new online judges again. duckmoon99 is browsing the source codes that were submitted by duckmoon. One of the codes caught his attention. Here's the problem statement :
modulo 109 + 7.There are t testcases in each input file.
The first line of input contains the integer t.
Each testcase consists of two lines. The first line contains the integer n. The second line contains n integers, denoting a1, a2, ..., an.
Output the correct answer for each testcase on a new line.
Here's his submission to the problem : https://ideone.com/uRM2Po
duckmoon99 immediately contacted duckmoon and told him that his code is wrong. duckmoon said : "But the constraints for n is small enough for the O(tn2) solution to pass. How else could my code possibly be wrong?"
duckmoon99 shakes his head and constructed some testcases for which duckmoon's code will get the wrong answer. Can you find such testcases?
The first line of input contains three integers T, N, MAX (T = 2000, N = 100, MAX = 1000).
This means that in your testcase 1 ≤ t ≤ T, 2 ≤ n ≤ N, 1 ≤ ai ≤ MAX for all 1 ≤ i ≤ n. If any of your testcases are invalid, you get 0 points.
Additionally, all the t testcases must be distinct. Two testcases are distinct if either their values of n are distinct, or there exist an integer that has a different number of occurences in the two sequences of n integers. For example, (2, 3, 2) and (3, 2, 2) are not distinct but (2, 3, 2) and (3, 3, 2) are distinct. If not all t testcases are distinct, you get 0 points.
The first line of output should contain a single integer t (1 ≤ t ≤ T), denoting the number of testcases.
Each testcase consists of two lines. The first line contains the integer n (1 ≤ n ≤ N). The second line contains n space-separated integers, denoting a1, a2, ..., an (1 ≤ ai ≤ MAX).
All t testcases must make duckmoon's code produce a wrong output.
Here's an example of an output if T = 2, N = 1500, MAX = 1000 (that will not be accepted because the code prints the correct answer)
2
5
2 4 1 1000 3
4
5 3 81 191
Note that the output of the program is
10035
17662
which is correct.
If any of the t testcases make duckmoon's code produce a correct output, you get 0 points.
Assume that the total score is 100 points.
Let N0 be the minimum positive integer such that there exist a testcase that fails duckmoon's solution with n = N0.
There are two modes of scoring depending on your testcases :
Mode 1 : When all t testcases satisfy n = N0.
Then, your score for this problem is
.
Mode 2 : Not all t testcases satisfy n = N0.
Suppose X of the t testcases satisfy n ≤ 50. Your score for this problem is min(30, 10 + X).
This problem requires interaction with a custom Discord bot.
There are $$$5$$$ mysterious subproblems in this problem. A mysterious bot has already solved this problem, and now it's your turn!
You may provide test inputs to the bot, and it will automatically tell you the correct result! If only you can just let it solve the problem for you......
Anyway, you can find the bot in this Discord server: https://discord.gg/JJxwuSbyuE
Use the command m!help to access the help menu for the bot. Use m!ask <problem number> <input> to learn the output for your given input.
Technical Note: Strings starting with an integer such as 1aa is judged as an integer in the bot but will never appear in the test data, so don't worry about it.
The first line of input contains two integers, $$$t$$$ and $$$k$$$ ($$$1 \le t \le 50000$$$, $$$1 \le k \le 5$$$). $$$t$$$ denotes the number of testcases, whereas $$$k$$$ denotes the problem number.
Then, $$$t$$$ lines follow, where each line contains a valid input to problem $$$k$$$.
Output $$$t$$$ lines, where the $$$i$$$-th line contains the correct output for the $$$i$$$-th input.
Each test passed will contribute to your points.
Problem $$$1$$$ is worth $$$3$$$ points overall.
Problem $$$2$$$ is worth $$$16$$$ points overall.
Problem $$$3$$$ is worth $$$30$$$ points overall.
Problem $$$4$$$ is worth $$$25$$$ points overall.
Problem $$$5$$$ is worth $$$26$$$ points overall.
Maximum score for this problem is thus $$$100$$$ points.
5 4 5 8 9 50 100
r n n r a
Unlike other problems, this problem is worth 200 points.
This problem requires interaction with a custom Discord bot.

This problem is comprised of $$$10$$$ mini subtasks, each of which is worth $$$20$$$ points and corresponds to a Hololive character. The list of tasks are (in no particular order):
You should play around with the bot and submit your score using the token generated by h!claim. Please do not share the token with anyone. If your score in the bot is higher than your score here, then your points might be nullified.
You do not need to hack or exploit the bot in any way for this problem (so please don't do it).
You can use h!help to find the list of commands of the bot. You can find the bot in the Discord server: https://discord.gg/JJxwuSbyuE
Details on the tasks and how to use the bot can be found here: https://docs.google.com/document/d/1EOfsjlG_8WlFAhsO98eGDiHmJc6W0lXLero6QLsAzvw/edit?usp=sharing
There is no input.
Output a token that certifies your score. See Scoring.
Use h!claim to generate a token which will allow you to claim your current score from the bot. Submit the token (or more precisely, a code that outputs that token) to get the points.