messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 1
value |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAny resemblance to any real championship and sport is accidental.\n\nThe Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local champi... | [{"type": "stdin_stdout", "input": "MYCXFLPTHVGWDSRXCOI BERLAND 5:9\nSPSHVVQLXQNRUB BERLAND 0:5\nSPSHVVQLXQNRUB MYCXFLPTHVGWDSRXCOI 4:6\nZPIIZCGCLCHNLIXCPBRM MYCXFLPTHVGWDSRXCOI 7:5\nZPIIZCGCLCHNLIXCPBRM SPSHVVQLXQNRUB 3:9\n", "output": "1:0"}, {"type": "stdin_stdout", "input": "VJWNNQCMHKJVXAPRVAD BERLAND 9:3\nVJWNNQC... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has recently bought some land and decided to surround it with a wooden fence.\n\nHe went to a company called \"Wooden board\" that produces wooden boards for fences. Vasya read in the catalog of products that the co... | [{"type": "stdin_stdout", "input": "100 3000\n1 4\n2 1\n3 3\n1 1\n5 4\n4 1\n2 1\n5 4\n1 1\n3 3\n4 3\n3 4\n4 2\n2 4\n1 2\n3 4\n5 3\n1 4\n2 4\n4 5\n1 2\n5 2\n2 2\n3 2\n4 4\n1 4\n5 5\n3 4\n4 1\n3 3\n5 2\n3 3\n4 1\n1 5\n4 3\n5 3\n4 2\n3 3\n3 5\n5 1\n5 1\n3 3\n4 3\n1 3\n4 1\n2 3\n1 3\n1 2\n5 5\n5 2\n1 5\n4 2\n1 1\n1 1\n1 2\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy-known detective. Now he does not investigate any case and is eating chocolate out of boredom.\n\nA bar of chocolate can be presented as an n Γ n table, where each cell represents one piece... | [{"type": "stdin_stdout", "input": "20 10\n10 11 U\n12 9 U\n6 15 L\n17 4 U\n11 10 L\n7 14 L\n4 17 U\n2 19 L\n8 13 L\n14 7 U\n", "output": "11\n9\n6\n4\n1\n7\n2\n2\n8\n7\n"}, {"type": "stdin_stdout", "input": "10 10\n5 6 U\n4 7 U\n8 3 L\n8 3 L\n1 10 U\n9 2 U\n10 1 L\n10 1 L\n8 3 U\n8 3 U\n", "output": "6\n7\n3\n0\n10\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most. Would you succeed with the same task if you... | [{"type": "stdin_stdout", "input": "925819493 47350513 28377591 119226256 49881078\n", "output": "510796638\n"}, {"type": "stdin_stdout", "input": "930064129 32726326 25428197 158103592 64501049\n", "output": "355994758\n"}, {"type": "stdin_stdout", "input": "930064129 32726326 25428197 83013449 64501049\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.\n... | [{"type": "stdin_stdout", "input": "25\n26668 10412 12658\n25216 11939 10247\n28514 22515 5833\n4955 19029 22405\n12552 6903 19634\n12315 1671 505\n20848 9175 6060\n12990 5827 16433\n9184 30621 25596\n31818 7826 11221\n18090 4476 30078\n30915 11014 16950\n3119 29529 21390\n775 4290 11723\n29679 14840 3566\n4491 29480 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string s and m queries. For each query delete the K-th occurence of a character x.\n\nInput:\nThe first line contains the string s followed by an integer m.\nThe string consists of lowercase letters.\nAfter that m... | [{"type": "stdin_stdout", "input": "bcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacab\n40\n37 c\n21 a\n18 a\n5 b\n1 a\n8 c\n9 a\n38 c\n10 b\n12 c\n18 a\n23 a\n20 c\n7 b\n33 c\n4 c\n22 c\n28 c\n9 a\n12 a\n22 a\n1 b\n6 a\n31 c\n19 b\n19 a\n15 a\n6 c\n11 c\n18 b\n19 c\n24... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a grid with n rows and m columns. Every cell of the grid should be colored either blue or yellow.\n\nA coloring of the grid is called stupid if every row has exactly one segment of blue cells and every column has... | [{"type": "stdin_stdout", "input": "1848 1937\n", "output": "337952422\n"}, {"type": "stdin_stdout", "input": "2000 2000\n", "output": "111024599\n"}, {"type": "stdin_stdout", "input": "2021 2021\n", "output": "138387540\n"}, {"type": "stdin_stdout", "input": "1001 1000\n", "output": "450544063\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe three friends, Kuro, Shiro, and Katie, met up again! It's time for a party...\n\nWhat the cats do when they unite? Right, they have a party. Since they wanted to have as much fun as possible, they invited all their fr... | [{"type": "stdin_stdout", "input": "1000 843\n", "output": "157\n"}, {"type": "stdin_stdout", "input": "1000 488\n", "output": "488\n"}, {"type": "stdin_stdout", "input": "1000 843\n", "output": "157\n"}, {"type": "stdin_stdout", "input": "1000 488\n", "output": "488\n"}, {"type": "stdin_stdout", "input": "1000 733\n",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a mysterious language (codenamed \"Secret\") available in \"Custom Invocation\" tab. Figure out what this language is and write a program which prints its name. Note that the program must be written in this ... | [{"type": "stdin_stdout", "input": "-111\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-165\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-137\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-116\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-14\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce at a team training Vasya, Petya and Sasha got a problem on implementing linear search in an array.\n\nAccording to the boys, linear search works as follows. The array elements in a pre-selected order are in turn comp... | [{"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 9 2 9 2 10 9 8\n", "output": "40 59\n"}, {"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n3 1 9 2 9 2 10 9 8\n", "output": "43 56\n"}, {"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 6 2 9 2 10 9 8\n", "output": "42 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each co... | [{"type": "stdin_stdout", "input": "-841 -205\n590 -205\n-1000 -1000\n-364 1385\n-682 113\n-841 -1000\n-1000 -205\n908 1067\n", "output": "YES\n2 4 5 8 \n1 3 6 7 \n"}, {"type": "stdin_stdout", "input": "-850 -1000\n-475 -325\n1025 800\n-325 575\n-325 -850\n-1000 -475\n-100 -775\n1250 -550\n", "output": "YES\n1 2 5 6 \n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently, Masha was presented with a chessboard with a height of $n$ and a width of $m$.\n\nThe rows on the chessboard are numbered from $1$ to $n$ from bottom to top. The columns are numbered from $1$ to $m$ from left to... | [{"type": "stdin_stdout", "input": "5\n2 2\n1 1 2 2\n1 1 2 2\n3 4\n2 2 3 3\n3 1 4 3\n1 5\n1 1 3 1\n3 1 5 1\n6 4\n1 1 4 2\n1 3 4 4\n3 4\n1 2 4 2\n2 1 3 3\n", "output": "0 4\n4 8\n2 3\n12 12\n4 8\n"}, {"type": "stdin_stdout", "input": "5\n2 2\n1 1 2 2\n1 1 2 2\n3 5\n2 2 3 2\n3 1 4 3\n1 5\n1 1 5 1\n3 1 5 1\n4 4\n1 1 4 2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGoa'uld Apophis captured Jack O'Neill's team again! Jack himself was able to escape, but by that time Apophis's ship had already jumped to hyperspace. But Jack knows on what planet will Apophis land. In order to save his ... | [{"type": "stdin_stdout", "input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n7 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n5 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel... | [{"type": "stdin_stdout", "input": "25\n1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976\n", "output": "999975\n"}, {"type": "stdin_stdout", "input": "25\n58115 794098 753382 484882 238434 6742... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled \"a\" to \"z\", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos bein... | [{"type": "stdin_stdout", "input": "xulsyfkuizjauadjjopu\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "cskgsxywlvfeicoueglr\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "gggggggggggggggggggg\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "qdqdddqddqqddqddqdqd\n", "output": "526\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKarafs is some kind of vegetable in shape of an 1 Γ h rectangle. Tavaspolis people love Karafs and they use Karafs in almost any kind of food. Tavas, himself, is crazy about Karafs.\n\n<image>\n\nEach Karafs has a positiv... | [{"type": "stdin_stdout", "input": "469 128038 4\n143 914502 747\n74 1244223 74477\n835 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "469 128038 4\n82 914502 747\n80 1244223 74477\n1360 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHexadecimal likes drawing. She has drawn many graphs already, both directed and not. Recently she has started to work on a still-life Β«interesting graph and applesΒ». An undirected graph is called interesting, if each of i... | [{"type": "stdin_stdout", "input": "50 21\n27 16\n42 35\n15 28\n46 17\n30 39\n47 18\n35 25\n26 24\n24 30\n28 41\n40 38\n11 21\n33 20\n43 10\n37 14\n1 43\n32 49\n49 6\n10 45\n21 50\n39 3\n", "output": "YES\n29\n1 2\n2 3\n4 5\n4 6\n5 7\n7 8\n8 9\n9 11\n12 13\n12 14\n13 15\n16 17\n18 19\n19 20\n22 23\n22 25\n23 26\n27 29\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA priority queue is a data structure which maintains a set $S$ of elements, each of with an associated value (key), and supports the following operations:\n\n* $insert(S, k)$: insert an element $k$ into the set $S$\n* $ex... | [{"type": "stdin_stdout", "input": "insert 8\ninsert -1\nextract\ninsert 12\nextract\ninsert 11\nextract\nextract\nend", "output": "8\n12\n11\n-1\n"}, {"type": "stdin_stdout", "input": "insert 9\ninsert -1\nextract\ninsert 12\nextract\ninsert 11\nextract\nextract\nend", "output": "9\n12\n11\n-1\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA ticket is a string consisting of six digits. A ticket is considered lucky if the sum of the first three digits is equal to the sum of the last three digits. Given a ticket, output if it is lucky or not. Note that a tick... | [{"type": "stdin_stdout", "input": "5\n213132\n973894\n045207\n000000\n055776\n", "output": "YES\nNO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "2\n193758\n123456\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n192758\n123456\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "1\n11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer $n$ ($n \\ge 0$) represented with $k$ digits in base (radix) $b$. So,\n\n$$n = a_1 \\cdot b^{k-1} + a_2 \\cdot b^{k-2} + \\ldots a_{k-1} \\cdot b + a_k.$$\n\nFor example, if $b=17, k=3$ and $a=[11... | [{"type": "stdin_stdout", "input": "97 100\n93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSergei B., the young coach of Pokemons, has found the big house which consists of n flats ordered in a row from left to right. It is possible to enter each flat from the street. It is possible to go out from each flat. Al... | [{"type": "stdin_stdout", "input": "100\nfAfhfNNNhfffAfNffNANhffNffffffNfffffhNfffNfefNfffNfNNNffNfffNfhNNNffffNfNfffAffNffNffNNfhfffNhNffNNN\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "100\nfAfhfNNNhfffAfNffNANhffNffffffNfffffhNfffNfffNfffNfNNNffNfffNfhNNNffffNfNfffAffNffNffNNfhfffNhNffNNN\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer found N rectangle lying on the table, each with height 1.\nIf we consider the surface of the desk as a two-dimensional plane, the i-th rectangle i(1β€iβ€N) covers the vertical range of [i-1,i] and the hori... | [{"type": "stdin_stdout", "input": "5\n999999999 1000000000\n1 2\n314 315\n500000 500001\n999999999 1000000000\n", "output": "1999999680\n"}, {"type": "stdin_stdout", "input": "5\n999999999 1000001000\n1 -1\n269 106\n500000 500001\n999999999 1000000000", "output": "1999999892\n"}, {"type": "stdin_stdout", "input": "5\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup ... | [{"type": "stdin_stdout", "input": "4\n-71868244 -24941524 -24941524 -24941524 -24941524 -24941524 -24941524 -6170836 21985196 21985196 21985196 21985196 40755884 40755884 40755884 68911916\n", "output": "12858032\n-24941524 -71868244 68911916 40755884\n21985196 40755884 -24941524 -24941524\n40755884 21985196 -24941524... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCurrently, people's entertainment is limited to programming contests. The activity of the entertainment club of a junior high school to which she belongs is to plan and run a programming contest. Her job is not to create ... | [{"type": "stdin_stdout", "input": "1 2 1 1 1 0\n1 2 1 0 0 -1\n1 0 0 0 1 1\n3 -1 0 0 2 0\n3 1 0 1 3 1\n0 2 0 2 -1 0\n0 0 1 1 0 7\n2 0 0 1 0 0\n0 0 0 0 0 0", "output": "1\n0\n1\n1\n3\n0\n2\n1\n"}, {"type": "stdin_stdout", "input": "1 2 1 1 1 0\n1 2 1 0 0 -1\n1 0 0 0 1 1\n3 -1 0 0 2 0\n3 0 0 1 3 1\n0 2 0 2 -1 0\n0 0 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nM-kun is a student in Aoki High School, where a year is divided into N terms.\nThere is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:\n\n* F... | [{"type": "stdin_stdout", "input": "15 1\n4 1 4 0 6 9 2 6 5 3 5 7 9 1 9", "output": "No\nYes\nNo\nYes\nYes\nNo\nYes\nNo\nNo\nYes\nYes\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "15 1\n3 0 8 1 6 9 1 6 5 5 9 7 2 7 16", "output": "No\nYes\nNo\nYes\nYes\nNo\nYes\nNo\nNo\nYes\nNo\nNo\nYes\nYes\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA plurality of trampolines are arranged in a line at 10 m intervals. Each trampoline has its own maximum horizontal distance within which the jumper can jump safely. Starting from the left-most trampoline, the jumper jump... | [{"type": "stdin_stdout", "input": "4\n163\n51\n2\n32", "output": "yes\n"}, {"type": "stdin_stdout", "input": "4\n001\n103\n-1\n0", "output": "no\n"}, {"type": "stdin_stdout", "input": "4\n001\n136\n-1\n0", "output": "no\n"}, {"type": "stdin_stdout", "input": "4\n001\n155\n-1\n0", "output": "no\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnn has recently started commuting by subway. We know that a one ride subway ticket costs a rubles. Besides, Ann found out that she can buy a special ticket for m rides (she can buy it several times). It costs b rubles. A... | [{"type": "stdin_stdout", "input": "1000 1 1000 1000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "1000 1 1000 1000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "1000 3 1000 1000\n", "output": "334000\n"}, {"type": "stdin_stdout", "input": "1000 3 1000 1000\n", "output": "334000\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order.\n\n-----Constraints-----\n - C is a lowercase English letter that is not z.\n\n-----Input-----\nInput is given fr... | [{"type": "stdin_stdout", "input": "a\n", "output": "b\n"}, {"type": "stdin_stdout", "input": "y\n", "output": "z\n"}, {"type": "stdin_stdout", "input": "c\n", "output": "d\n"}, {"type": "stdin_stdout", "input": "p\n", "output": "q\n"}, {"type": "stdin_stdout", "input": "d\n", "output": "e\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are an integer N and four characters c_{\\mathrm{AA}}, c_{\\mathrm{AB}}, c_{\\mathrm{BA}}, and c_{\\mathrm{BB}}.\nHere, it is guaranteed that each of those four characters is A or B.\nSnuke has a string s, which is ... | [{"type": "stdin_stdout", "input": "1000\nB\nA\nA\nA\n", "output": "589888339\n"}, {"type": "stdin_stdout", "input": "1000\nA\nB\nA\nA\n", "output": "336052903\n"}, {"type": "stdin_stdout", "input": "1000\nB\nB\nA\nA\n", "output": "336052903\n"}, {"type": "stdin_stdout", "input": "1000\nB\nA\nB\nA\n", "output": "336052... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn autumn sports festival is held. There are four events: foot race, ball-carrying, obstacle race, and relay. There are n teams participating, and we would like to commend the team with the shortest total time in this 4th... | [{"type": "stdin_stdout", "input": "8\n65541 3 20 3 8 6 27 2 25\n20941 3 5 2 41 7 19 2 42\n90585 4 8 3 12 11 46 2 34\n92201 3 28 2 47 6 37 2 58\n10001 3 50 2 42 7 12 4 54\n63812 4 11 3 11 6 98 2 22\n54092 3 33 2 54 6 18 2 19\n25012 3 44 2 58 6 45 2 46\n4\n1 3 23 1 23 1 34 4 69\n2 5 12 2 12 3 41 2 29\n3 5 24 1 24 2 0 3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given nonnegative integers a and b (a β€ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\n-----Constraints-----\n - 0 β€ a β€ b β€ 10^{18}\n - 1 β€ x β€ 10^{1... | [{"type": "stdin_stdout", "input": "1 1000000000000000000 3\n", "output": "333333333333333333\n"}, {"type": "stdin_stdout", "input": "-1 1010010100000100000 4", "output": "252502525000025001\n"}, {"type": "stdin_stdout", "input": "-1 1010010110000100000 3", "output": "336670036666700001\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou were dreaming that you are traveling to a planet named Planetforces on your personal spaceship. Unfortunately, its piloting system was corrupted and now you need to fix it in order to reach Planetforces.\n\nSpace can ... | [{"type": "stdin_stdout", "input": "6\n10 5\nRRRRRRRRRRUUUUU\n1 -1\nUDDDRLLL\n-3 -5\nLDLDLDDDR\n-1 2\nUULLLL\n6 -2\nRDULRLLDR\n-1 6\nRUDURUUUUR\n", "output": "YES\nYES\nYES\nYES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "6\n10 5\nRRRRRRRRRRUUUUU\n1 -1\nUDDDRLLL\n-3 -5\nLDLDLDDDR\n0 2\nUULLLL\n6 -2\nRDULRLLDR\n-1 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter his wife's tragic death, Eurydice, Orpheus descended to the realm of death to see her. Reaching its gates was uneasy, but passing through them proved to be even more challenging. Mostly because of Cerberus, the thre... | [{"type": "stdin_stdout", "input": "7\nbabba\nabaac\ncodeforces\nzeroorez\nabcdcba\nbbbbbbb\na\n", "output": "\n1\n1\n0\n1\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "7\nbabba\nabaac\ncodeforces\nzeroorez\nabcdcba\nbbbbbbb\na\n", "output": "1\n1\n0\n1\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "7\nabbab\nabaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYet another round on DecoForces is coming! Grandpa Maks wanted to participate in it but someone has stolen his precious sofa! And how can one perform well with such a major loss?\n\nFortunately, the thief had left a note ... | [{"type": "stdin_stdout", "input": "6\n10 10\n3 6 3 7\n4 9 5 9\n5 4 5 3\n7 1 8 1\n9 10 8 10\n7 7 7 8\n0 5 2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n10 10\n3 6 3 7\n4 9 5 9\n5 4 5 3\n7 1 8 1\n9 10 8 10\n7 7 7 8\n0 5 2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n4 6\n4 3 3 3\n4 2 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nn evenly spaced points have been marked around the edge of a circle. There is a number written at each point. You choose a positive real number k. Then you may repeatedly select a set of 2 or more points which are evenly ... | [{"type": "stdin_stdout", "input": "488\n453349582488862562152454328120974624021885842759505659322561694358728150516204337664755243733316681382547751353198982127441183878962690095592236469807087207161691714104527568781618875688104415243715506909284770554256616642020503116458540489226220383015748323400356936736149732496... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program which solve a simultaneous equation:\n\nax + by = c\ndx + ey = f\n\nThe program should print x and y for given a, b, c, d, e and f (-1,000 β€ a, b, c, d, e, f β€ 1,000). You can suppose that given equation h... | [{"type": "stdin_stdout", "input": "3 -1 -3 1 0 -3\n2 -1 -3 -9 18 27", "output": "-3.000 -6.000\n-1.000 1.000\n"}, {"type": "stdin_stdout", "input": "3 -2 -3 1 0 -3\n2 -1 -3 -9 18 27", "output": "-3.000 -3.000\n-1.000 1.000\n"}, {"type": "stdin_stdout", "input": "3 -1 -3 1 0 -3\n2 -1 -3 -9 13 27", "output": "-3.000 -6.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string $a$, consisting of $n$ characters, $n$ is even. For each $i$ from $1$ to $n$ $a_i$ is one of 'A', 'B' or 'C'.\n\nA bracket sequence is a string containing only characters \"(\" and \")\". A regular ... | [{"type": "stdin_stdout", "input": "28\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nAABBAC\nCACA\n", "output": "YES\nYES\nNO\nNO\nYES\nYES\nNO\nNO\nYES\nYES\nNO\nNO\nYES\nYES\nNO\nNO... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLee just became Master in Codeforces, and so, he went out to buy some gifts for his friends. He bought $n$ integers, now it's time to distribute them between his friends rationally...\n\nLee has $n$ integers $a_1, a_2, \\... | [{"type": "stdin_stdout", "input": "3\n4 2\n1 13 7 17\n1 3\n6 2\n10 10 10 10 11 11\n3 3\n4 4\n1000000000 1000000000 1000000000 1000000000\n1 1 1 1\n", "output": "48\n42\n8000000000\n"}, {"type": "stdin_stdout", "input": "3\n4 2\n1 13 12 1\n1 3\n6 2\n10 10 10 10 11 11\n3 3\n4 4\n1000000000 1000000000 1000000000 10000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nM-kun is a competitor in AtCoder, whose highest rating is X.\nIn this site, a competitor is given a kyu (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given:\n\n* Fr... | [{"type": "stdin_stdout", "input": "1359", "output": "4\n"}, {"type": "stdin_stdout", "input": "1855", "output": "1\n"}, {"type": "stdin_stdout", "input": "1485", "output": "3\n"}, {"type": "stdin_stdout", "input": "1125", "output": "5\n"}, {"type": "stdin_stdout", "input": "1764", "output": "2\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers. Each $a_i$ is one of the six following numbers: $4, 8, 15, 16, 23, 42$.\n\nYour task is to remove the minimum number of elements to make this array good.\n\nAn array ... | [{"type": "stdin_stdout", "input": "100\n4 42 23 23 16 42 16 23 42 16 42 8 4 23 4 4 23 42 16 42 23 23 23 42 4 42 8 8 16 23 15 23 16 4 42 15 15 23 16 15 16 4 4 15 23 42 42 15 8 23 8 23 4 15 16 15 42 8 23 16 15 42 23 8 4 16 15 16 23 16 16 4 23 16 8 23 16 15 23 4 4 8 15 4 4 15 8 23 23 4 4 8 8 4 42 15 4 4 42 16\n", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nManao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it either stays pressed into the... | [{"type": "stdin_stdout", "input": "2000\n", "output": "1333335000\n"}, {"type": "stdin_stdout", "input": "1999\n", "output": "1331335999\n"}, {"type": "stdin_stdout", "input": "1837\n", "output": "1033182073\n"}, {"type": "stdin_stdout", "input": "2000\n", "output": "1333335000\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe next lecture in a high school requires two topics to be discussed. The $i$-th topic is interesting by $a_i$ units for the teacher and by $b_i$ units for the students.\n\nThe pair of topics $i$ and $j$ ($i < j$) is cal... | [{"type": "stdin_stdout", "input": "14\n137698508 528184026 54130884 239033739 1038011779 720680829 605286542 89272810 284191042 179359950 186766648 570400677 107541072 25121211\n195343970 709242622 422954170 980941827 265963618 812646456 943660193 344102432 295006337 221455256 203711937 632473368 334173424 49206958\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt has been noted that if some ants are put in the junctions of the graphene integer lattice then they will act in the following fashion: every minute at each junction (x, y) containing at least four ants a group of four ... | [{"type": "stdin_stdout", "input": "30000 39\n2650 -1515\n-3169 4818\n-1896 2727\n1323 -2335\n-387 901\n-4299 1481\n-2114 4435\n3654 -2730\n4569 3801\n-3815 -3355\n4777 1749\n4486 -780\n-3936 -158\n717 -3518\n4765 -909\n-3032 3726\n-2970 3346\n2067 -1560\n-521 -1331\n-4953 -2098\n-849 580\n-4941 4018\n1338 -2629\n-1444... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a list of numbers from $1$ to $n$ written from left to right on the blackboard.\n\nYou perform an algorithm consisting of several steps (steps are $1$-indexed). On the $i$-th step you wipe the $i$-th number (cons... | [{"type": "stdin_stdout", "input": "2\n1000000000 1\n1000000000 500000000\n", "output": "2\n1000000000\n"}, {"type": "stdin_stdout", "input": "2\n1000000000 1\n1000000000 500000000\n", "output": "2\n1000000000\n"}, {"type": "stdin_stdout", "input": "3\n3 1\n4 2\n69 6\n", "output": "2\n4\n12\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '$\\sqrt{}$' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels ... | [{"type": "stdin_stdout", "input": "6723\n", "output": "2\n17\n46\n97\n176\n289\n442\n641\n892\n1201\n1574\n2017\n2536\n3137\n3826\n4609\n5492\n6481\n7582\n8801\n10144\n11617\n13226\n14977\n16876\n18929\n21142\n23521\n26072\n28801\n31714\n34817\n38116\n41617\n45326\n49249\n53392\n57761\n62362\n67201\n72284\n77617\n8320... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the State of Takahashi in AtCoderian Federation, there are N cities, numbered 1, 2, ..., N.\nM bidirectional roads connect these cities.\nThe i-th road connects City A_i and City B_i.\nEvery road connects two distinct ... | [{"type": "stdin_stdout", "input": "10 39\n7 2\n7 1\n5 6\n5 8\n9 10\n2 8\n8 7\n3 10\n10 1\n8 10\n2 3\n7 4\n3 9\n4 10\n3 4\n6 1\n6 7\n9 5\n9 7\n6 9\n9 4\n4 6\n7 5\n8 3\n2 5\n9 2\n10 7\n8 6\n8 9\n7 3\n5 3\n4 5\n6 3\n2 10\n5 10\n4 2\n6 2\n8 4\n10 6\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "10 39\n7 2\n7 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe will call a non-negative integer increasing if, for any two adjacent digits in its decimal representation, the digit to the right is greater than or equal to the digit to the left. For example, 1558, 11, 3 and 0 are al... | [{"type": "stdin_stdout", "input": "3704579452095997258280591217784156184311155893966777597430447796450532", "output": "32\n"}, {"type": "stdin_stdout", "input": "4271374355872521214646189206931447259915557225329718337053006899386612", "output": "33\n"}, {"type": "stdin_stdout", "input": "463636595558318557723662913943... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.\n\nThe interior of the square is consider... | [{"type": "stdin_stdout", "input": "-17 -91 -17 -27 -81 -27 -81 -91\n-48 -21 -12 -57 -48 -93 -84 -57\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-100 -100 -100 -99 -99 -99 -99 -100\n-10 -10 -9 -9 -10 -8 -11 -9\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-100 -100 -100 100 100 100 100 -100\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe following sorting operation is repeated for the stacked blocks as shown in Fig. A.\n\n1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step ... | [{"type": "stdin_stdout", "input": "6\n1 4 1 3 2 4\n5\n1 2 5 4 5\n10\n1 1 1 1 1 1 1 1 1 1\n9\n1 1 1 1 1 1 1 1 1\n12\n1 4 1 3 2 4 3 3 2 1 2 2\n1\n5050\n3\n10000 10000 100\n0", "output": "24\n-1\n10\n-1\n48\n5049\n-1\n"}, {"type": "stdin_stdout", "input": "6\n1 4 1 3 2 4\n5\n1 2 5 4 5\n10\n1 1 1 1 1 1 1 1 1 1\n9\n1 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTranslator's note: in Russia's most widespread grading system, there are four grades: 5, 4, 3, 2, the higher the better, roughly corresponding to A, B, C and F respectively in American grading system.\n\nThe term is comin... | [{"type": "stdin_stdout", "input": "100\n3 2 4 3 3 3 4 2 3 5 5 2 5 2 3 2 4 4 4 5 5 4 2 5 4 3 2 5 3 4 3 4 2 4 5 4 2 4 3 4 5 2 5 3 3 4 2 2 4 4 4 5 4 3 3 3 2 5 2 2 2 3 5 4 3 2 4 5 5 5 2 2 4 2 3 3 3 5 3 2 2 4 5 5 4 5 5 4 2 3 2 2 2 2 5 3 5 2 3 4\n", "output": "40\n"}, {"type": "stdin_stdout", "input": "100\n2 2 2 2 2 2 2 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCompute A \\times B.\n\n-----Constraints-----\n - 1 \\leq A \\leq 100\n - 1 \\leq B \\leq 100\n - All values in input are integers.\n\n-----Input-----\nInput is given from Standard Input in the following format:\nA B\n\n-... | [{"type": "stdin_stdout", "input": "100 100\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "101 110", "output": "11110\n"}, {"type": "stdin_stdout", "input": "101 111", "output": "11211\n"}, {"type": "stdin_stdout", "input": "101 101", "output": "10201\n"}, {"type": "stdin_stdout", "input": "100 110", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTonio has a keyboard with only two letters, \"V\" and \"K\".\n\nOne day, he has typed out a string s with only these two letters. He really likes it when the string \"VK\" appears, so he wishes to change at most one lette... | [{"type": "stdin_stdout", "input": "VVKKVKKVVKKVKKVKVVKKVKKVVKKVKVVKKVKKVKVVKKVVKKVKVVKKVKVVKKVVKVVKKVKKVKKVKKVKKVKVVKKVKKVKKVKKVKKVVKVK\n", "output": "32\n"}, {"type": "stdin_stdout", "input": "VVVVVKKVKVKVKVVKVVKKVVKVKKKKKKKVKKKVVVVVVKKVVVKVKVVKVKKVVKVVVKKKKKVVVVVKVVVVKVVVKKVKKVKKKVKKVKKVVKKV\n", "output": "25\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecutive parts (the prefix and the suffix) so that the sum of all elements in the first part equals to th... | [{"type": "stdin_stdout", "input": "100\n27 95 57 29 91 85 83 36 72 86 39 5 79 61 78 93 100 97 73 23 82 66 41 92 38 92 100 96 48 23 66 47 5 32 69 13 95 23 46 62 99 83 57 66 98 82 81 57 37 37 81 64 45 76 72 43 99 76 86 22 37 39 93 80 99 36 53 83 3 32 52 9 78 34 47 100 33 72 19 40 29 56 77 32 79 72 15 88 100 98 56 50 22 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya thinks that lucky tickets are the tickets whose numbers are divisible by 3. He gathered quite a large collection of such tickets but one day his younger brother Leonid was having a sulk and decided to destroy the co... | [{"type": "stdin_stdout", "input": "10\n146767769 71795210 50866429 35232438 22664883 56785812 91050433 75677099 84393937 43832346\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n146767769 71795210 50866429 35232438 22664883 56785812 91050433 75677099 18053121 43832346\n", "output": "4\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\nGiven an integer N, determine whether it is a Harshad number.\n\n-----Constraints-----\... | [{"type": "stdin_stdout", "input": "12\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "148\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "112", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "224", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "133", "output": "Yes\n"}, {"type": "st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn army of n droids is lined up in one row. Each droid is described by m integers a_1, a_2, ..., a_{m}, where a_{i} is the number of details of the i-th type in this droid's mechanism. R2-D2 wants to destroy the sequence ... | [{"type": "stdin_stdout", "input": "49 2 1971\n794 866\n401 575\n341 83\n103 208\n352 134\n260 878\n497 931\n630 570\n885 464\n23 663\n60 1461\n416 870\n955 405\n392 961\n530 258\n73 404\n736 923\n44 436\n594 314\n904 138\n980 163\n76 720\n879 809\n81 838\n263 599\n218 139\n659 493\n1044 754\n679 302\n490 7\n204 530\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a game called Packet Monster. A game that catches, raises, fights and exchanges monsters, and is very popular all over Japan. Of course, in my class. That's why I also raise monsters so that I can play with every... | [{"type": "stdin_stdout", "input": "10\n4 17 1 9 5 18 2 3 2 1\n8 12 6 5 10 5 4 4 7 6\n5\n4 3 2 1 1\n2 4 4 4 4\n4\n1 1 3 2\n5 3 2 1\n0", "output": "1\nNA\nNA\n"}, {"type": "stdin_stdout", "input": "10\n4 17 1 9 5 18 2 3 2 1\n8 12 6 5 10 5 4 4 7 6\n5\n4 3 2 1 1\n2 4 4 4 4\n4\n2 1 3 2\n5 3 2 1\n0", "output": "1\nNA\nNA\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNew Year is coming! Vasya has prepared a New Year's verse and wants to recite it in front of Santa Claus.\n\nVasya's verse contains $n$ parts. It takes $a_i$ seconds to recite the $i$-th part. Vasya can't change the order... | [{"type": "stdin_stdout", "input": "1\n50 1\n2 1 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter Vitaly was expelled from the university, he became interested in the graph theory.\n\nVitaly especially liked the cycles of an odd length in which each vertex occurs at most once.\n\nVitaly was wondering how to solv... | [{"type": "stdin_stdout", "input": "5 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1\n"}, {"type": "stdin_stdout", "input": "6 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1\n"}, {"type": "stdin_stdout", "input": "9 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1\n"}, {"type": "stdin_stdout", "input": "100000 0\n", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a simple connected undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M.\n\nEdge i connects Vertex a_i and b_i bidirectionally.\n\nDeterm... | [{"type": "stdin_stdout", "input": "18 27\n17 9\n12 15\n18 17\n13 18\n13 1\n5 7\n12 1\n14 5\n15 11\n14 6\n1 9\n5 1\n18 16\n4 6\n7 2\n7 11\n6 3\n12 14\n5 3\n10 5\n5 8\n10 15\n3 15\n9 8\n7 15\n2 16\n18 15", "output": "No\n"}, {"type": "stdin_stdout", "input": "18 15\n17 9\n12 15\n18 17\n13 18\n13 1\n5 7\n12 1\n14 5\n15 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself.\n\nThe total income A of his kingdom during 0-th year is known, as wel... | [{"type": "stdin_stdout", "input": "-1 -512 10\n", "output": "No solution\n"}, {"type": "stdin_stdout", "input": "-3 -768 13\n", "output": "No solution\n"}, {"type": "stdin_stdout", "input": "-173 373 3\n", "output": "No solution\n"}, {"type": "stdin_stdout", "input": "-521 526 1\n", "output": "No solution\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nXenia the vigorous detective faced n (n β₯ 2) foreign spies lined up in a row. We'll consider the spies numbered from 1 to n from left to right. \n\nSpy s has an important note. He has to pass the note to spy f. Xenia inte... | [{"type": "stdin_stdout", "input": "100000 1 11500 86289\n1 86 75626\n", "output": "XRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Aizu prefecture, we decided to create a new town to increase the population. To that end, we decided to cultivate a new rectangular land and divide this land into squares of the same size. The cost of developing this l... | [{"type": "stdin_stdout", "input": "10 29 10", "output": "2900\n"}, {"type": "stdin_stdout", "input": "10 29 13", "output": "3770\n"}, {"type": "stdin_stdout", "input": "4 -1 104", "output": "-416\n"}, {"type": "stdin_stdout", "input": "20 -1 18", "output": "-360\n"}, {"type": "stdin_stdout", "input": "12 -1 14", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnfisa the monkey learns to type. She is yet unfamiliar with the \"space\" key and can only type in lower-case Latin letters. Having typed for a fairly long line, Anfisa understood that it would be great to divide what sh... | [{"type": "stdin_stdout", "input": "200 1 200\nlycjpjrpkgxrkfvutlcwglghxadttpihmlpphwfttegfpimjxintjdxgqfhzrmxfcfojnxruhyfynlzgpxjeobjyxarsfxaqeogxfzvdlwsimupkwujudtfenryulzvsiazneyibqtweeuxpzrbumqqswjasliyjnnzfzuvthhzcsgfljikkajqkpjftztrzpjneaxqg\n", "output": "l\ny\nc\nj\np\nj\nr\np\nk\ng\nx\nr\nk\nf\nv\nu\nt\nl\nc\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe famous global economic crisis is approaching rapidly, so the states of Berman, Berance and Bertaly formed an alliance and allowed the residents of all member states to freely pass through the territory of any of them.... | [{"type": "stdin_stdout", "input": "10 10\n##.#..#.#2\n...###....\n#..#....##\n.....#....\n.#........\n.....#####\n...#..#...\n....###...\n###.##...#\n.#...1#.3.\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 10\n#...33.#.#\n#.#.33.#1.\n2.....#.11\n222#.#.#..\n####...#.#\n#.........\n.#....#...\n..#..#.##... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs a New Year's gift, Dolphin received a string s of length 19.\n\nThe string s has the following format: [five lowercase English letters],[seven lowercase English letters],[five lowercase English letters].\n\nDolphin wan... | [{"type": "stdin_stdout", "input": "happy,newyear,enjoy\n", "output": "happy newyear enjoy\n"}, {"type": "stdin_stdout", "input": "haiku,atcoder,tasks\n", "output": "haiku atcoder tasks\n"}, {"type": "stdin_stdout", "input": "abcde,fghihgf,edcba\n", "output": "abcde fghihgf edcba\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the year of $30XX$ participants of some world programming championship live in a single large hotel. The hotel has $n$ floors. Each floor has $m$ sections with a single corridor connecting all of them. The sections are... | [{"type": "stdin_stdout", "input": "10 10 1 8 4\n10\n2 3 4 5 6 7 8 9\n10\n1 1 3 1\n2 1 7 1\n2 1 15 1\n7 1 4 1\n10 1 7 1\n2 1 7 1\n3 1 2 1\n5 1 2 1\n10 1 5 1\n6 1 9 1\n", "output": "3\n4\n6\n3\n3\n4\n3\n3\n4\n3\n"}, {"type": "stdin_stdout", "input": "10 10 1 8 4\n10\n2 3 4 5 6 7 8 9\n10\n1 1 3 1\n2 1 7 1\n2 1 15 1\n7 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have N items that you want to put them into a knapsack. Item i has value vi and weight wi.\n\nYou want to find a subset of items to put such that:\n\n* The total value of the items is as large as possible.\n* The item... | [{"type": "stdin_stdout", "input": "1 10\n15 4\n0 3\n4 1\n13 3", "output": "15\n"}, {"type": "stdin_stdout", "input": "1 10\n27 4\n0 0\n6 1\n13 3", "output": "27\n"}, {"type": "stdin_stdout", "input": "1 10\n39 4\n1 0\n6 1\n13 3", "output": "39\n"}, {"type": "stdin_stdout", "input": "1 10\n24 4\n0 3\n5 1\n13 5", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nzscoder has a deck of $n+m$ custom-made cards, which consists of $n$ cards labelled from $1$ to $n$ and $m$ jokers. Since zscoder is lonely, he wants to play a game with himself using those cards. \n\nInitially, the deck ... | [{"type": "stdin_stdout", "input": "2000000 2000000\n", "output": "507914970\n"}, {"type": "stdin_stdout", "input": "1999922 1999943\n", "output": "255234262\n"}, {"type": "stdin_stdout", "input": "1999968 1999941\n", "output": "499830706\n"}, {"type": "stdin_stdout", "input": "1999913 1999918\n", "output": "667185390\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn McD's Burger, n hungry burger fans are ordering burgers. The ith order is placed by the ith fan at ti time and it takes di time to procees. What is the order in which the fans will get their burgers?\n\nInput Format\n\... | [{"type": "stdin_stdout", "input": "867\n490317 691111\n887872 411997\n656114 768604\n1027 17196\n982834 242480\n429255 61218\n513761 775074\n983667 410967\n412679 463744\n239690 278648\n559213 257757\n898250 192154\n795524 339490\n492066 774265\n713302 493367\n877920 234682\n500217 919598\n161118 441563\n816297 891191... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSagheer is working at a kindergarten. There are n children and m different toys. These children use well-defined protocols for playing with the toys:\n\n * Each child has a lovely set of toys that he loves to play with. ... | [{"type": "stdin_stdout", "input": "13 18 27 13\n1 1\n1 2\n1 3\n1 4\n1 17\n2 5\n2 1\n3 6\n3 2\n5 14\n5 3\n4 4\n6 9\n6 3\n7 8\n7 3\n8 7\n8 9\n10 11\n10 14\n11 10\n11 15\n11 11\n9 12\n9 11\n12 10\n13 15\n6 8\n6 14\n6 1\n6 17\n6 18\n11 12\n11 1\n11 1\n11 17\n1 18\n1 12\n1 7\n1 14\n", "output": "3\n0\n0\n0\n0\n4\n0\n0\n0\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a of n positive integers.\n\nYou can use the following operation as many times as you like: select any integer 1 β€ k β€ n and do one of two things: \n\n * decrement by one k of the first elements of... | [{"type": "stdin_stdout", "input": "4\n3\n1 2 1\n5\n11 14 9 10 8\n5\n0 3 1 4 1\n4\n5 2 1 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 1\n5\n11 14 9 6 10\n5\n0 3 1 2 1\n4\n5 2 1 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n0 2 1\n5\n11 14 9 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA new airplane SuperPuperJet has an infinite number of rows, numbered with positive integers starting with 1 from cockpit to tail. There are six seats in each row, denoted with letters from 'a' to 'f'. Seats 'a', 'b' and ... | [{"type": "stdin_stdout", "input": "1000000000000000000d\n", "output": "3999999999999999994\n"}, {"type": "stdin_stdout", "input": "1000000000000000000a\n", "output": "3999999999999999995\n"}, {"type": "stdin_stdout", "input": "1000000000000000000e\n", "output": "3999999999999999993\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNikephoros and Polycarpus play rock-paper-scissors. The loser gets pinched (not too severely!).\n\nLet us remind you the rules of this game. Rock-paper-scissors is played by two players. In each round the players choose o... | [{"type": "stdin_stdout", "input": "1457057352\nR\nPSRSRSSRPSRRSSSRSRRPRSPPSPPRPSRRPPRSRRSPPSPPSPRPRPRPSSRPRPRRPSSSSSPSRRRPSRSPPSPSRRSPSSRSRPSPRRRSRRRPSPRPPRPPPPPRPPRRRRRRPPRRSPSPSSPSSPRPRSPPRRRPSPSRSRRRRRPPPSRPRSPPSSRRRRPRPPRSPSSPRRRPPPPPRRSRSPRPPSRPRSRSRRPRRRPRSRSPRRRSRSSRPPPRRSRRSSRRPSRPPRSPSPRPRSSSRSSRRPSRRRRPSRRPP... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY invented a new message encryption method and now wants to check its performance. Checking it manually is long and tiresome, so he decided to ask the ABBYY Cup contestants for help.\n\nA message... | [{"type": "stdin_stdout", "input": "80 6 99\n48 97 9 77 73 21 86 78 48 5 71 16 42 67 90 27 30 52 41 86 53 4 60 17 66 38 94 46 51 51 70 11 1 16 74 53 17 12 82 95 51 33 83 70 45 27 90 57 67 2 68 15 20 61 47 90 11 5 95 33 69 35 79 51 95 45 10 17 12 88 93 43 31 31 85 68 85 81 70 43\n47 92 59 85 73 38\n", "output": "95 38 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a tree T with non-negative weight, find the height of each node of the tree. For each node, the height is the distance to the most distant leaf from the node.\n\nConstraints\n\n* 1 β€ n β€ 10,000\n* 0 β€ wi β€ 1,000\n\n... | [{"type": "stdin_stdout", "input": "4\n0 2 2\n1 2 2\n2 3 12", "output": "14\n14\n12\n14\n"}, {"type": "stdin_stdout", "input": "4\n0 2 2\n1 2 2\n2 3 21", "output": "23\n23\n21\n23\n"}, {"type": "stdin_stdout", "input": "4\n0 2 2\n1 2 2\n2 3 31", "output": "33\n33\n31\n33\n"}, {"type": "stdin_stdout", "input": "4\n0 2 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.\n\nOnce he thought about a string of length n consisting of zeroes and ones. Consider the foll... | [{"type": "stdin_stdout", "input": "9\n011111101\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n011111111\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "9\n011101111\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n011101101\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "9\n0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this problem, we use the 24-hour clock.\n\nTakahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.) He has decided to study for K consecutive... | [{"type": "stdin_stdout", "input": "17 -4 435 10 -1", "output": "25095\n"}, {"type": "stdin_stdout", "input": "17 -4 722 10 -1", "output": "42315\n"}, {"type": "stdin_stdout", "input": "-1 -3 436 11 -1", "output": "26235\n"}, {"type": "stdin_stdout", "input": "-1 -3 239 11 -1", "output": "14415\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn elementary school student Takahashi has come to a variety store.\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\nNote that he lives in T... | [{"type": "stdin_stdout", "input": "1977 001 1111", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1977 011 1111", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1977 011 1110", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1977 011 0110", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a square grid with $n$ rows and $n$ columns, where each cell has a non-negative integer written in it. There is a chip initially placed at the top left cell (the cell with coordinates $(1, 1)$). You need to ... | [{"type": "stdin_stdout", "input": "7\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1 1000000000\n1000000000 1000000000 1000000000 1000000000 1 1000000000 1000000000\n1000000000 1000000000 1000000000 1 1000000000 1000000000 1000000000\n10000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day little Vasya found mom's pocket book. The book had n names of her friends and unusually enough, each name was exactly m letters long. Let's number the names from 1 to n in the order in which they are written.\n\nA... | [{"type": "stdin_stdout", "input": "30 10\nUTNTGOKZYJ\nQHOUHNYZVW\nLTVGHJRZVW\nMZHYHOLZYJ\nERYEUEPZYE\nUZDBFTURYJ\nRVSMQTIZGW\nWDJQHMIRYY\nKCORHQPZYE\nRRPLFOZZVY\nJTXMFNNNYJ\nMVTGGOZZVV\nEHAFFNUZVF\nLBRNWJZNYE\nJVMOHTPZYJ\nWTARFJLZVV\nLVJCWOURVW\nLCLQFJYRVV\nQVBVGNJRYF\nNTZGHOLRYE\nMGQKHOUPYJ\nRRSSBXPZYJ\nRYCRGTLZYJ\nJ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program that extracts n different numbers from the numbers 0 to 100 and outputs the number of combinations that add up to s. Each n number is from 0 to 100, and the same number cannot be used in one combination. F... | [{"type": "stdin_stdout", "input": "4 133\n-1 0\n0 0", "output": "15011\n0\n"}, {"type": "stdin_stdout", "input": "4 102\n-1 0\n0 0", "output": "7153\n0\n"}, {"type": "stdin_stdout", "input": "8 80\n2 -2\n0 0", "output": "37638\n0\n"}, {"type": "stdin_stdout", "input": "3 133\n-1 0\n0 0", "output": "1202\n0\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe capital of Berland looks like a rectangle of size n Γ m of the square blocks of same size.\n\nFire!\n\nIt is known that k + 1 blocks got caught on fire (k + 1 β€ nΒ·m). Those blocks are centers of ignition. Moreover pos... | [{"type": "stdin_stdout", "input": "1000000000 1010000000 10\n668983398 843926244\n730038846 389721428\n400508549 779159281\n683648123 559948749\n105869012 181419826\n391396726 503295408\n248489591 686114055\n102102370 108241714\n610800354 28286278\n587730768 379340837\n", "output": "331016602\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA string is called bracket sequence if it does not contain any characters other than \"(\" and \")\". A bracket sequence is called regular (shortly, RBS) if it is possible to obtain correct arithmetic expression by insert... | [{"type": "stdin_stdout", "input": "20\n(())(()()())(())()()\n", "output": "01100111111001100000\n"}, {"type": "stdin_stdout", "input": "20\n(()()()())(()())()()\n", "output": "01111111100111100000\n"}, {"type": "stdin_stdout", "input": "20\n(())(())(())()(())()\n", "output": "01100110011000011000\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are many freight trains departing from Kirnes planet every day. One day on that planet consists of $h$ hours, and each hour consists of $m$ minutes, where $m$ is an even number. Currently, there are $n$ freight trai... | [{"type": "stdin_stdout", "input": "10 24 60 8\n10 59\n21 56\n0 42\n21 27\n5 24\n5 53\n16 5\n5 22\n10 11\n10 46\n", "output": "1 5\n1 \n"}, {"type": "stdin_stdout", "input": "10 24 60 8\n10 59\n21 56\n0 42\n21 27\n5 24\n5 53\n16 5\n5 22\n10 11\n10 46\n", "output": "1 5\n1 \n"}, {"type": "stdin_stdout", "input": "9 24 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's well known that the best way to distract from something is to do one's favourite thing. Job is such a thing for Leha.\n\nSo the hacker began to work hard in order to get rid of boredom. It means that Leha began to ha... | [{"type": "stdin_stdout", "input": "15 17\n1 10 8\n5 19 1\n12 14 6\n9 19 8\n6 7 3\n5 11 9\n7 12 5\n17 20 8\n6 12 6\n11 19 4\n3 14 1\n15 19 10\n3 20 5\n5 19 9\n10 18 10\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "15 17\n1 10 8\n5 19 1\n12 14 6\n9 19 8\n6 7 3\n5 11 9\n7 12 5\n17 20 8\n6 12 6\n11 19 4\n3 14 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInternational Carpenters Professionals Company (ICPC) is a top construction company with a lot of expert carpenters. What makes ICPC a top company is their original language.\n\nThe syntax of the language is simply given ... | [{"type": "stdin_stdout", "input": "3\n-1 ( 10\n10 ) 5\n10 ) 5", "output": "No\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "3\n-1 ( 0\n10 ) 4\n20 ( 4", "output": "Yes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "3\n-1 ) 10\n10 ( 12\n10 ( 7", "output": "No\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "3\n-1 ( ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a program that outputs the surface area S of a square cone with a height of h, with a square with one side x as the base. However, assume that the line segment connecting the apex and the center of the base is orth... | [{"type": "stdin_stdout", "input": "6\n5\n-1\n2\n0\n0", "output": "105.971422738\n-3.12310562562\n"}, {"type": "stdin_stdout", "input": "6\n5\n14\n4\n0\n0", "output": "105.971422738\n421.743216952\n"}, {"type": "stdin_stdout", "input": "6\n5\n14\n3\n0\n0", "output": "105.971422738\n409.241646964\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is p... | [{"type": "stdin_stdout", "input": "18 1 -1\n2 -1 1\n5 2 1\n1 1 4\n5 2 0\n2 0 12", "output": "18\n"}, {"type": "stdin_stdout", "input": "10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n", "output": "64\n"}, {"type": "stdin_stdout", "input": "10 10 5\n1 14 1\n4 1 1\n6 4 4\n9 0 2\n3 2 4", "output": "10\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ robots driving along an OX axis. There are also two walls: one is at coordinate $0$ and one is at coordinate $m$.\n\nThe $i$-th robot starts at an integer coordinate $x_i~(0 < x_i < m)$ and moves either left... | [{"type": "stdin_stdout", "input": "1\n20 170\n4 6 8 9 10 13 14 16 18 20 23 28 30 32 33 38 42 43 45 46\nL L L L L L L L L L R R R L L R R L R R\n", "output": "5 5 9 11 9 11 15 15 19 19 5 137 1 1 5 137 126 169 169 126\n"}, {"type": "stdin_stdout", "input": "1\n20 170\n4 1 8 9 10 13 14 16 18 20 23 28 30 32 33 38 42 43 45... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKuriyama Mirai has killed many monsters and got many (namely n) stones. She numbers the stones from 1 to n. The cost of the i-th stone is v_{i}. Kuriyama Mirai wants to know something about these stones so she will ask yo... | [{"type": "stdin_stdout", "input": "56\n43 100 44 66 65 11 26 75 96 77 5 15 75 96 11 44 11 97 75 53 33 26 32 33 90 26 68 72 5 44 53 26 33 88 68 25 84 21 25 92 1 84 21 66 94 35 76 51 11 95 67 4 61 3 34 18\n27\n1 20 38\n1 11 46\n2 42 53\n1 8 11\n2 11 42\n2 35 39\n2 37 41\n1 48 51\n1 32 51\n1 36 40\n1 31 56\n1 18 38\n2 9 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn a public bath, there is a shower which emits water for T seconds when the switch is pushed.\n\nIf the switch is pushed when the shower is already emitting water, from that moment it will be emitting water for T seconds... | [{"type": "stdin_stdout", "input": "4 1000000000\n0 1100 1000000 1000000000", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "4 1000000000\n0 1100 1000000 1010000000", "output": "2001000000\n"}, {"type": "stdin_stdout", "input": "4 1000010000\n0 1000 1000000 1000000000", "output": "2000010000\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is an undirected tree of $n$ vertices, connected by $n-1$ bidirectional edges. There is also a snake stuck inside of this tree. Its head is at vertex $a$ and its tail is at vertex $b$. The snake's body occupies all ... | [{"type": "stdin_stdout", "input": "4\n8 4 7\n1 2\n2 3\n1 4\n4 5\n4 6\n1 7\n7 8\n4 3 2\n4 3\n1 2\n2 3\n9 3 5\n1 2\n2 3\n3 4\n1 5\n5 6\n6 7\n1 8\n8 9\n16 15 12\n1 2\n2 3\n1 4\n4 5\n5 6\n6 7\n4 8\n10 9\n8 13\n10 11\n11 12\n11 13\n13 14\n10 15\n15 16\n", "output": "YES\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTo become the king of Codeforces, Kuroni has to solve the following problem.\n\nHe is given $n$ numbers $a_1, a_2, \\dots, a_n$. Help Kuroni to calculate $\\prod_{1\\le i<j\\le n} |a_i - a_j|$. As result can be very big, ... | [{"type": "stdin_stdout", "input": "140 149\n124 109 136 123 83 121 53 37 111 105 75 224 99 87 51 45 131 83 18 76 99 29 115 96 16 89 88 69 81 100 120 90 141 48 83 97 26 27 51 94 53 25 32 27 4 139 81 140 137 95 94 89 116 32 85 155 68 12 107 10 124 96 110 32 135 126 2 146 79 14 132 136 110 16 130 98 109 191 2 18 52 27 13... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells a_{i} theorems during the i-th minute.\n\nMishka is really interested in calculus, though it is so hard to stay awake for all t... | [{"type": "stdin_stdout", "input": "10 5\n1 1 1 1 1 1 1 1 10000 1\n1 1 1 1 1 1 1 1 0 1\n", "output": "10009\n"}, {"type": "stdin_stdout", "input": "10 5\n1 1 1 1 1 1 1 1 10000 1\n1 1 1 1 1 1 1 1 0 1\n", "output": "10009\n"}, {"type": "stdin_stdout", "input": "10 5\n1 1 1 1 1 1 1 1 10000 1\n1 1 1 0 1 1 1 1 0 1\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToad Zitz has an array of integers, each integer is between $0$ and $m-1$ inclusive. The integers are $a_1, a_2, \\ldots, a_n$.\n\nIn one operation Zitz can choose an integer $k$ and $k$ indices $i_1, i_2, \\ldots, i_k$ s... | [{"type": "stdin_stdout", "input": "100 1000\n980 755 745 448 424 691 210 545 942 979 555 783 425 942 495 741 487 514 752 434 187 874 372 617 414 505 659 445 81 397 243 986 441 587 31 350 831 801 194 103 723 166 108 182 252 846 328 905 639 690 738 638 986 340 559 626 572 808 442 410 179 549 880 153 449 99 434 945 163 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Cybernetics Failures (CF) organisation made a prototype of a bomb technician robot. To find the possible problems it was decided to carry out a series of tests. At the beginning of each test the robot prototype will b... | [{"type": "stdin_stdout", "input": "15 17 8 9\nURRDLUULLDDDRRURR\n", "output": "1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 241\n"}, {"type": "stdin_stdout", "input": "15 17 8 9\nURRDLUULLDDDRRURR\n", "output": "1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 241 "}, {"type": "stdin_stdout", "input": "15 17 7 9\nURRDLUULLDDDRRURR\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour favorite music streaming platform has formed a perfectly balanced playlist exclusively for you. The playlist consists of $n$ tracks numbered from $1$ to $n$. The playlist is automatic and cyclic: whenever track $i$ f... | [{"type": "stdin_stdout", "input": "100\n7585 5510 1017 4329 2840 8171 5089 1873 7308 9656 6833 7578 4914 6658 4408 7122 5265 1204 9800 3150 2151 6906 6041 3973 931 7239 4421 4211 156 8655 4266 3543 9752 3117 2731 6052 8950 9391 6367 996 9973 629 9489 4912 9226 9301 5166 4889 3710 6794 618 9155 2462 1120 5499 5861 3177... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAccording to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. She said that at some time n snacks of distinct sizes will fall on the city, and the residents s... | [{"type": "stdin_stdout", "input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe life goes up and down, just like nice sequences. Sequence t_1, t_2, ..., t_{n} is called nice if the following two conditions are satisfied: t_{i} < t_{i} + 1 for each odd i < n; t_{i} > t_{i} + 1 for each even i <... | [{"type": "stdin_stdout", "input": "50\n11836 28308 72527 92281 139289 93797 134555 148444 40866 111317 21564 87813 65466 20541 99238 2287 74647 128071 18163 61672 39766 55589 138385 147443 138100 142683 60703 15444 52566 72976 147412 116006 115986 110545 79993 100440 9876 71470 75209 62443 64906 88987 72232 2246 63160... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.