-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdataset.jsonl
More file actions
16 lines (16 loc) · 16.7 KB
/
dataset.jsonl
File metadata and controls
16 lines (16 loc) · 16.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{"description": "Write a function to convert the given set into ordered tuples.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains 5 integers, one per line", "output_spec": "Print the result as space-separated integers", "notes": "This problem is based on implementing the set_to_tuple function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["1\n2\n3\n4\n5", "6\n7\n8\n9\n10\n11", "12\n13\n14\n15\n16"], "sample_outputs": ["1 2 3 4 5", "6 7 8 9 10 11", "12 13 14 15 16"], "tags": ["data structures"], "src_uid": "mbpp_341", "difficulty": 300}
{"description": "Write a function to count bidirectional tuple pairs.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains 6 pairs of integers, each pair separated by a space on a separate line", "output_spec": "Print the result as a single integer", "notes": "This problem is based on implementing the count_bidirectional function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["5 6\n1 2\n6 5\n9 1\n6 5\n2 1", "5 6\n1 3\n6 5\n9 1\n6 5\n2 1", "5 6\n1 2\n6 5\n9 2\n6 5\n2 1"], "sample_outputs": ["3", "2", "4"], "tags": ["counting", "data structures"], "src_uid": "mbpp_438", "difficulty": 300}
{"description": "Write a function to find the maximum sum of increasing subsequence from prefix till ith index and also including a given kth element which is after i, i.e., k > i .", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The first line of the input contains n integers separated by spaces, the second line contains a single integer n, the third line contains a single integer index, the last line contains a single integer k", "output_spec": "Print the result as an integer", "notes": "This problem is based on implementing the max_sum_increasing_subseq function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["1 101 2 3 100 4 5\n7\n4\n6", "1 101 2 3 100 4 5\n7\n2\n5", "11 15 19 21 26 28 31\n7\n2\n4"], "sample_outputs": ["11", "7", "71"], "tags": ["implementation"], "src_uid": "mbpp_306", "difficulty": 300}
{"description": "Write a function to count array elements having modular inverse under given prime number p equal to itself.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains 3 lines. The first line contains the array of integers separated by spaces, the second line is the number N, the third line is a single integer P", "output_spec": "Print the result as an integer", "notes": "This problem is based on implementing the modular_inverse function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["1 6 4 5\n4\n7", "1 3 8 12 12\n5\n13", "2 3 4 5\n4\n6"], "sample_outputs": ["2", "3", "1"], "tags": ["counting", "arrays", "math"], "src_uid": "mbpp_288", "difficulty": 300}
{"description": "Write a function to substract the contents of one tuple with corresponding index of other tuple.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains two lines, where each line is a tuple of 3 integers separated by spaces", "output_spec": "Print the result as space-separated integers", "notes": "This problem is based on implementing the substract_elements function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["10 4 5\n2 5 18", "11 2 3\n24 45 16", "7 18 9\n10 11 12"], "sample_outputs": ["8 -1 -13", "-13 -43 -13", "-3 7 -3"], "tags": ["data structures"], "src_uid": "mbpp_273", "difficulty": 300}
{"description": "Write a function to find out the minimum no of swaps required for bracket balancing in the given string.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains a string of brackets which may not be balanced", "output_spec": "Print the result as an integer", "notes": "This problem is based on implementing the swap_count function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["[]][][", "[[][]]", "[[][]]]["], "sample_outputs": ["2", "0", "1"], "tags": ["strings", "greedy"], "src_uid": "mbpp_386", "difficulty": 300}
{"description": "Write a function to find the first maximum length of even word.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains a string of words separated by spaces", "output_spec": "Print the result word that is the first maximum length of even word, or -1 if there is no even word", "notes": "This problem is based on implementing the find_Max_Len_Even function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["python language", "maximum even length", "eve"], "sample_outputs": ["language", "length", "-1"], "tags": ["implementation"], "src_uid": "mbpp_315", "difficulty": 300}
{"description": "Write a function to count hexadecimal numbers for a given range.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains 2 values separated by spaces", "output_spec": "Print the result as an integer", "notes": "This problem is based on implementing the count_Hexadecimal function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["10 15", "2 4", "15 16"], "sample_outputs": ["6", "0", "1"], "tags": ["counting", "math"], "src_uid": "mbpp_107", "difficulty": 300}
{"description": "Write a function to check the given decimal with a precision of 2 by using regex.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains a string", "output_spec": "Print the result as an integer", "notes": "This problem is based on implementing the is_decimal function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["123.11", "0.21", "123.1214"], "sample_outputs": ["True", "True", "False"], "tags": ["strings"], "src_uid": "mbpp_208", "difficulty": 300}
{"description": "Write a function to find the sum of absolute differences in all pairs of the given array.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The input contains n+1 integers, one per line (first n values are the array, last value is the array length)", "output_spec": "Print the result as an integer", "notes": "This problem is based on implementing the sum_Pairs function. The program should read input from stdin and print the result to stdout.", "sample_inputs": ["1\n8\n9\n15\n16\n5", "1\n2\n3\n4\n4", "1\n2\n3\n4\n5\n7\n9\n11\n14\n9"], "sample_outputs": ["74", "10", "188"], "tags": ["arrays"], "src_uid": "mbpp_144", "difficulty": 300}
{"description": "Captain Bill the Hummingbird and his crew recieved an interesting challenge offer. Some stranger gave them a map, potion of teleportation and said that only this potion might help them to reach the treasure. Bottle with potion has two values x and y written on it. These values define four moves which can be performed using the potion: Map shows that the position of Captain Bill the Hummingbird is (x1, y1) and the position of the treasure is (x2, y2).You task is to tell Captain Bill the Hummingbird whether he should accept this challenge or decline. If it is possible for Captain to reach the treasure using the potion then output \"YES\", otherwise \"NO\" (without quotes).The potion can be used infinite amount of times.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The first line contains four integer numbers x1, y1, x2, y2 ( - 105 ≤ x1, y1, x2, y2 ≤ 105) — positions of Captain Bill the Hummingbird and treasure respectively. The second line contains two integer numbers x, y (1 ≤ x, y ≤ 105) — values on the potion bottle.", "output_spec": "Print \"YES\" if it is possible for Captain to reach the treasure using the potion, otherwise print \"NO\" (without quotes).", "notes": "NoteIn the first example there exists such sequence of moves: — the first type of move — the third type of move ", "sample_inputs": ["0 0 0 6\n2 3", "1 1 3 6\n1 5"], "sample_outputs": ["YES", "NO"], "tags": ["math", "number theory", "implementation"], "src_uid": "1c80040104e06c9f24abfcfe654a851f", "difficulty": 1200}
{"description": "Pak Chanek plans to build a garage. He wants the garage to consist of a square and a right triangle that are arranged like the following illustration. Define $$$a$$$ and $$$b$$$ as the lengths of two of the sides in the right triangle as shown in the illustration. An integer $$$x$$$ is suitable if and only if we can construct a garage with assigning positive integer values for the lengths $$$a$$$ and $$$b$$$ ($$$a<b$$$) so that the area of the square at the bottom is exactly $$$x$$$. As a good friend of Pak Chanek, you are asked to help him find the $$$N$$$-th smallest suitable number.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "128 megabytes", "input_spec": "The only line contains a single integer $$$N$$$ ($$$1 \\leq N \\leq 10^9$$$).", "output_spec": "An integer that represents the $$$N$$$-th smallest suitable number.", "notes": "NoteThe $$$3$$$-rd smallest suitable number is $$$7$$$. A square area of $$$7$$$ can be obtained by assigning $$$a=3$$$ and $$$b=4$$$.", "sample_inputs": ["3"], "sample_outputs": ["7"], "tags": ["geometry", "math", "binary search"], "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "difficulty": 1500}
{"description": "Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word \"hello\". For example, if Vasya types the word \"ahhellllloou\", it will be considered that he said hello, and if he types \"hlelo\", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.", "output_spec": "If Vasya managed to say hello, print \"YES\", otherwise print \"NO\".", "notes": null, "sample_inputs": ["ahhellllloou", "hlelo"], "sample_outputs": ["YES", "NO"], "tags": ["strings", "greedy"], "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "difficulty": 1000}
{"description": "Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last character of the word to the beginning of the word. He calls this a cyclic shift. He can apply cyclic shift many times. For example, consecutively applying cyclic shift operation to the word \"abracadabra\" Hongcow will get words \"aabracadabr\", \"raabracadab\" and so on.Hongcow is now wondering how many distinct words he can generate by doing the cyclic shift arbitrarily many times. The initial string is also counted.", "input_from": "standard input", "output_to": "standard output", "time_limit": 2.0, "memory_limit": "256 megabytes", "input_spec": "The first line of input will be a single string s (1 ≤ |s| ≤ 50), the word Hongcow initially learns how to spell. The string s consists only of lowercase English letters ('a'–'z').", "output_spec": "Output a single integer equal to the number of distinct strings that Hongcow can obtain by applying the cyclic shift arbitrarily many times to the given string.", "notes": "NoteFor the first sample, the strings Hongcow can generate are \"abcd\", \"dabc\", \"cdab\", and \"bcda\".For the second sample, no matter how many times Hongcow does the cyclic shift, Hongcow can only generate \"bbb\".For the third sample, the two strings Hongcow can generate are \"yzyz\" and \"zyzy\".", "sample_inputs": ["abcd", "bbb", "yzyz"], "sample_outputs": ["4", "1", "2"], "tags": ["strings", "implementation"], "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "difficulty": 900}
{"description": "You can not just take the file and send it. When Polycarp trying to send a file in the social network \"Codehorses\", he encountered an unexpected problem. If the name of the file contains three or more \"x\" (lowercase Latin letters \"x\") in a row, the system considers that the file content does not correspond to the social network topic. In this case, the file is not sent and an error message is displayed.Determine the minimum number of characters to remove from the file name so after that the name does not contain \"xxx\" as a substring. Print 0 if the file name does not initially contain a forbidden substring \"xxx\".You can delete characters in arbitrary positions (not necessarily consecutive). If you delete a character, then the length of a string is reduced by $$$1$$$. For example, if you delete the character in the position $$$2$$$ from the string \"exxxii\", then the resulting string is \"exxii\".", "input_from": "standard input", "output_to": "standard output", "time_limit": 1.0, "memory_limit": "256 megabytes", "input_spec": "The first line contains integer $$$n$$$ $$$(3 \\le n \\le 100)$$$ — the length of the file name. The second line contains a string of length $$$n$$$ consisting of lowercase Latin letters only — the file name.", "output_spec": "Print the minimum number of characters to remove from the file name so after that the name does not contain \"xxx\" as a substring. If initially the file name dost not contain a forbidden substring \"xxx\", print 0.", "notes": "NoteIn the first example Polycarp tried to send a file with name contains number $$$33$$$, written in Roman numerals. But he can not just send the file, because it name contains three letters \"x\" in a row. To send the file he needs to remove any one of this letters.", "sample_inputs": ["6\nxxxiii", "5\nxxoxx", "10\nxxxxxxxxxx"], "sample_outputs": ["1", "0", "8"], "tags": ["strings", "greedy"], "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "difficulty": 800}
{"description": "Little Johnny Bubbles enjoys spending hours in front of his computer playing video games. His favorite game is Bubble Strike, fast-paced bubble shooting online game for two players.Each game is set in one of the N maps, each having different terrain configuration. First phase of each game decides on which map the game will be played. The game system randomly selects three maps and shows them to the players. Each player must pick one of those three maps to be discarded. The game system then randomly selects one of the maps that were not picked by any of the players and starts the game.Johnny is deeply enthusiastic about the game and wants to spend some time studying maps, thus increasing chances to win games played on those maps. However, he also needs to do his homework, so he does not have time to study all the maps. That is why he asked himself the following question: \"What is the minimum number of maps I have to study, so that the probability to play one of those maps is at least $$$P$$$\"?Can you help Johnny find the answer for this question? You can assume Johnny's opponents do not know him, and they will randomly pick maps.", "input_from": "standard input", "output_to": "standard output", "time_limit": 0.5, "memory_limit": "256 megabytes", "input_spec": "The first line contains two integers $$$N$$$ ($$$3$$$ $$$\\leq$$$ $$$N$$$ $$$\\leq$$$ $$$10^{3}$$$) and $$$P$$$ ($$$0$$$ $$$\\leq$$$ $$$P$$$ $$$\\leq$$$ $$$1$$$) – total number of maps in the game and probability to play map Johnny has studied. $$$P$$$ will have at most four digits after the decimal point.", "output_spec": "Output contains one integer number – minimum number of maps Johnny has to study.", "notes": null, "sample_inputs": ["7 1.0000"], "sample_outputs": ["6"], "tags": ["combinatorics", "binary search", "ternary search", "probabilities", "math"], "src_uid": "788ed59a964264bd0e755e155a37e14d", "difficulty": 2000}