{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s426060344", "group_id": "codeNet:p00001", "input_text": " 0){\n fscanf(STDIN, \"%d %d %d\", $a, $b, $c);\n $a *= $a;\n $b *= $b;\n $c *= $c;\n if($a + $b == $c || $a + $c == $b || $b + $c == $a){\n echo \"YES\\n\";\n }\n else{\n echo \"NO\\n\";\n }\n}", "language": "PHP", "metadata": {"date": 1410476358, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00003.html", "problem_id": "p00003", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00003/input.txt", "sample_output_relpath": "derived/input_output/data/p00003/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00003/PHP/s910346002.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s910346002", "user_id": "u642549559"}, "prompt_components": {"gold_output": "YES\nNO\nNO\n", "input_to_evaluate": " 0){\n fscanf(STDIN, \"%d %d %d\", $a, $b, $c);\n $a *= $a;\n $b *= $b;\n $c *= $c;\n if($a + $b == $c || $a + $c == $b || $b + $c == $a){\n echo \"YES\\n\";\n }\n else{\n echo \"NO\\n\";\n }\n}", "problem_context": "Is it a Right Triangle?\n\nWrite a program which judges wheather given length of three side form a right triangle. Print \"YES\" if the given sides (integers) form a right triangle, \"NO\" if not so.\n\nInput\n\nInput consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.\n\nConstraints\n\n1 ≤ length of the side ≤ 1,000\n\nN ≤ 1,000\n\nOutput\n\nFor each data set, print \"YES\" or \"NO\".\n\nSample Input\n\n3\n4 3 5\n4 3 6\n8 8 8\n\nOutput for the Sample Input\n\nYES\nNO\nNO", "sample_input": "3\n4 3 5\n4 3 6\n8 8 8\n"}, "reference_outputs": ["YES\nNO\nNO\n"], "source_document_id": "p00003", "source_text": "Is it a Right Triangle?\n\nWrite a program which judges wheather given length of three side form a right triangle. Print \"YES\" if the given sides (integers) form a right triangle, \"NO\" if not so.\n\nInput\n\nInput consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.\n\nConstraints\n\n1 ≤ length of the side ≤ 1,000\n\nN ≤ 1,000\n\nOutput\n\nFor each data set, print \"YES\" or \"NO\".\n\nSample Input\n\n3\n4 3 5\n4 3 6\n8 8 8\n\nOutput for the Sample Input\n\nYES\nNO\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 256, "cpu_time_ms": 10, "memory_kb": 6532}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s447717388", "group_id": "codeNet:p00003", "input_text": "", "language": "PHP", "metadata": {"date": 1488174482, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00003.html", "problem_id": "p00003", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00003/input.txt", "sample_output_relpath": "derived/input_output/data/p00003/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00003/PHP/s816922027.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s816922027", "user_id": "u064980217"}, "prompt_components": {"gold_output": "YES\nNO\nNO\n", "input_to_evaluate": "", "problem_context": "Is it a Right Triangle?\n\nWrite a program which judges wheather given length of three side form a right triangle. Print \"YES\" if the given sides (integers) form a right triangle, \"NO\" if not so.\n\nInput\n\nInput consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.\n\nConstraints\n\n1 ≤ length of the side ≤ 1,000\n\nN ≤ 1,000\n\nOutput\n\nFor each data set, print \"YES\" or \"NO\".\n\nSample Input\n\n3\n4 3 5\n4 3 6\n8 8 8\n\nOutput for the Sample Input\n\nYES\nNO\nNO", "sample_input": "3\n4 3 5\n4 3 6\n8 8 8\n"}, "reference_outputs": ["YES\nNO\nNO\n"], "source_document_id": "p00003", "source_text": "Is it a Right Triangle?\n\nWrite a program which judges wheather given length of three side form a right triangle. Print \"YES\" if the given sides (integers) form a right triangle, \"NO\" if not so.\n\nInput\n\nInput consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.\n\nConstraints\n\n1 ≤ length of the side ≤ 1,000\n\nN ≤ 1,000\n\nOutput\n\nFor each data set, print \"YES\" or \"NO\".\n\nSample Input\n\n3\n4 3 5\n4 3 6\n8 8 8\n\nOutput for the Sample Input\n\nYES\nNO\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 322, "cpu_time_ms": 10, "memory_kb": 14952}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s445059103", "group_id": "codeNet:p00003", "input_text": "", "language": "PHP", "metadata": {"date": 1488179204, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00006.html", "problem_id": "p00006", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00006/input.txt", "sample_output_relpath": "derived/input_output/data/p00006/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00006/PHP/s230729683.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s230729683", "user_id": "u064980217"}, "prompt_components": {"gold_output": "admin23w\n", "input_to_evaluate": "", "problem_context": "Reverse Sequence\n\nWrite a program which reverses a given string str.\n\nInput\n\nstr (the size of str ≤ 20) is given in a line.\n\nOutput\n\nPrint the reversed str in a line.\n\nSample Input\n\nw32nimda\n\nOutput for the Sample Input\n\nadmin23w", "sample_input": "w32nimda\n"}, "reference_outputs": ["admin23w\n"], "source_document_id": "p00006", "source_text": "Reverse Sequence\n\nWrite a program which reverses a given string str.\n\nInput\n\nstr (the size of str ≤ 20) is given in a line.\n\nOutput\n\nPrint the reversed str in a line.\n\nSample Input\n\nw32nimda\n\nOutput for the Sample Input\n\nadmin23w", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 86, "cpu_time_ms": 10, "memory_kb": 15180}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s453323363", "group_id": "codeNet:p00008", "input_text": "", "language": "PHP", "metadata": {"date": 1424245549, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00008.html", "problem_id": "p00008", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00008/input.txt", "sample_output_relpath": "derived/input_output/data/p00008/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00008/PHP/s453323363.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s453323363", "user_id": "u544156467"}, "prompt_components": {"gold_output": "4\n4\n", "input_to_evaluate": "", "problem_context": "Sum of 4 Integers\n\nWrite a program which reads an integer n and identifies the number of combinations of a, b, c and d (0 ≤ a, b, c, d ≤ 9) which meet the following equality:\n\na + b + c + d = n\n\nFor example, for n = 35, we have 4 different combinations of (a, b, c, d): (8, 9, 9, 9), (9, 8, 9, 9), (9, 9, 8, 9), and (9, 9, 9, 8).\n\nInput\n\nThe input consists of several datasets. Each dataset consists of n (1 ≤ n ≤ 50) in a line. The number of datasets is less than or equal to 50.\n\nOutput\n\nPrint the number of combination in a line.\n\nSample Input\n\n35\n1\n\nOutput for the Sample Input\n\n4\n4", "sample_input": "35\n1\n"}, "reference_outputs": ["4\n4\n"], "source_document_id": "p00008", "source_text": "Sum of 4 Integers\n\nWrite a program which reads an integer n and identifies the number of combinations of a, b, c and d (0 ≤ a, b, c, d ≤ 9) which meet the following equality:\n\na + b + c + d = n\n\nFor example, for n = 35, we have 4 different combinations of (a, b, c, d): (8, 9, 9, 9), (9, 8, 9, 9), (9, 9, 8, 9), and (9, 9, 9, 8).\n\nInput\n\nThe input consists of several datasets. Each dataset consists of n (1 ≤ n ≤ 50) in a line. The number of datasets is less than or equal to 50.\n\nOutput\n\nPrint the number of combination in a line.\n\nSample Input\n\n35\n1\n\nOutput for the Sample Input\n\n4\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 254, "cpu_time_ms": 50, "memory_kb": 6548}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s465432109", "group_id": "codeNet:p00009", "input_text": " $m) {\n if ($n < $m) {\n break;\n }\n $cnt++;\n }\n echo $cnt, PHP_EOL;\n}", "language": "PHP", "metadata": {"date": 1422855532, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00009.html", "problem_id": "p00009", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00009/input.txt", "sample_output_relpath": "derived/input_output/data/p00009/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00009/PHP/s465432109.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s465432109", "user_id": "u133486819"}, "prompt_components": {"gold_output": "4\n2\n5\n", "input_to_evaluate": " $m) {\n if ($n < $m) {\n break;\n }\n $cnt++;\n }\n echo $cnt, PHP_EOL;\n}", "problem_context": "Prime Number\n\nWrite a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nInput\n\nInput consists of several datasets. Each dataset has an integer n (1 ≤ n ≤ 999,999) in a line.\n\nThe number of datasets is less than or equal to 30.\n\nOutput\n\nFor each dataset, prints the number of prime numbers.\n\nSample Input\n\n10\n3\n11\n\nOutput for the Sample Input\n\n4\n2\n5", "sample_input": "10\n3\n11\n"}, "reference_outputs": ["4\n2\n5\n"], "source_document_id": "p00009", "source_text": "Prime Number\n\nWrite a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nInput\n\nInput consists of several datasets. Each dataset has an integer n (1 ≤ n ≤ 999,999) in a line.\n\nThe number of datasets is less than or equal to 30.\n\nOutput\n\nFor each dataset, prints the number of prime numbers.\n\nSample Input\n\n10\n3\n11\n\nOutput for the Sample Input\n\n4\n2\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 587, "cpu_time_ms": 790, "memory_kb": 194672}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s427497028", "group_id": "codeNet:p00009", "input_text": "", "language": "PHP", "metadata": {"date": 1448076557, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00014.html", "problem_id": "p00014", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00014/input.txt", "sample_output_relpath": "derived/input_output/data/p00014/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00014/PHP/s863449783.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s863449783", "user_id": "u092829549"}, "prompt_components": {"gold_output": "68440000\n70210000\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nIntegral\n\nWrite a program which computes the area of a shape represented by the following three lines:\n\n$y = x^2$\n\n$y = 0$\n\n$x = 600$\n\nIt is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure:\n\n$f(x) = x^2$\n\nThe approximative area $s$ where the width of the rectangles is $d$ is:\n\narea of rectangle where its width is $d$ and height is $f(d)$ $+$\n\narea of rectangle where its width is $d$ and height is $f(2d)$ $+$\n\narea of rectangle where its width is $d$ and height is $f(3d)$ $+$\n\n...\n\narea of rectangle where its width is $d$ and height is $f(600 - d)$\n\nThe more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$.\n\nInput\n\nThe input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20.\n\nOutput\n\nFor each dataset, print the area $s$ in a line.\n\nSample Input\n\n20\n10\n\nOutput for the Sample Input\n\n68440000\n70210000", "sample_input": "20\n10\n"}, "reference_outputs": ["68440000\n70210000\n"], "source_document_id": "p00014", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nIntegral\n\nWrite a program which computes the area of a shape represented by the following three lines:\n\n$y = x^2$\n\n$y = 0$\n\n$x = 600$\n\nIt is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure:\n\n$f(x) = x^2$\n\nThe approximative area $s$ where the width of the rectangles is $d$ is:\n\narea of rectangle where its width is $d$ and height is $f(d)$ $+$\n\narea of rectangle where its width is $d$ and height is $f(2d)$ $+$\n\narea of rectangle where its width is $d$ and height is $f(3d)$ $+$\n\n...\n\narea of rectangle where its width is $d$ and height is $f(600 - d)$\n\nThe more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$.\n\nInput\n\nThe input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20.\n\nOutput\n\nFor each dataset, print the area $s$ in a line.\n\nSample Input\n\n20\n10\n\nOutput for the Sample Input\n\n68440000\n70210000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 110, "cpu_time_ms": 10, "memory_kb": 15076}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s306051894", "group_id": "codeNet:p00018", "input_text": "", "language": "PHP", "metadata": {"date": 1475660645, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00018.html", "problem_id": "p00018", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00018/input.txt", "sample_output_relpath": "derived/input_output/data/p00018/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00018/PHP/s306051894.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s306051894", "user_id": "u981168887"}, "prompt_components": {"gold_output": "9 7 6 5 3\n", "input_to_evaluate": "", "problem_context": "Sorting Five Numbers\n\nWrite a program which reads five numbers and sorts them in descending order.\n\nInput\n\nInput consists of five numbers a, b, c, d and e (-100000 ≤ a, b, c, d,e ≤ 100000). The five numbers are separeted by a space.\n\nOutput\n\nPrint the ordered numbers in a line. Adjacent numbers should be separated by a space.\n\nSample Input\n\n3 6 9 7 5\n\nOutput for the Sample Input\n\n9 7 6 5 3", "sample_input": "3 6 9 7 5\n"}, "reference_outputs": ["9 7 6 5 3\n"], "source_document_id": "p00018", "source_text": "Sorting Five Numbers\n\nWrite a program which reads five numbers and sorts them in descending order.\n\nInput\n\nInput consists of five numbers a, b, c, d and e (-100000 ≤ a, b, c, d,e ≤ 100000). The five numbers are separeted by a space.\n\nOutput\n\nPrint the ordered numbers in a line. Adjacent numbers should be separated by a space.\n\nSample Input\n\n3 6 9 7 5\n\nOutput for the Sample Input\n\n9 7 6 5 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 93, "cpu_time_ms": 10, "memory_kb": 15020}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s550555084", "group_id": "codeNet:p00024", "input_text": "", "language": "PHP", "metadata": {"date": 1484112123, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00028.html", "problem_id": "p00028", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00028/input.txt", "sample_output_relpath": "derived/input_output/data/p00028/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00028/PHP/s735273285.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s735273285", "user_id": "u223228190"}, "prompt_components": {"gold_output": "3\n5\n", "input_to_evaluate": "", "problem_context": "Mode Value\n\nYour task is to write a program which reads a sequence of integers and prints mode values of the sequence.\nThe mode value is the element which occurs most frequently.\n\nInput\n\nA sequence of integers ai (1 ≤ ai ≤ 100). The number of integers is less than or equals to 100.\n\nOutput\n\nPrint the mode values. If there are several mode values, print them in ascending order.\n\nSample Input\n\n5\n6\n3\n5\n8\n7\n5\n3\n9\n7\n3\n4\n\nOutput for the Sample Input\n\n3\n5\n\nFor example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.", "sample_input": "5\n6\n3\n5\n8\n7\n5\n3\n9\n7\n3\n4\n"}, "reference_outputs": ["3\n5\n"], "source_document_id": "p00028", "source_text": "Mode Value\n\nYour task is to write a program which reads a sequence of integers and prints mode values of the sequence.\nThe mode value is the element which occurs most frequently.\n\nInput\n\nA sequence of integers ai (1 ≤ ai ≤ 100). The number of integers is less than or equals to 100.\n\nOutput\n\nPrint the mode values. If there are several mode values, print them in ascending order.\n\nSample Input\n\n5\n6\n3\n5\n8\n7\n5\n3\n9\n7\n3\n4\n\nOutput for the Sample Input\n\n3\n5\n\nFor example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 284, "cpu_time_ms": 10, "memory_kb": 15188}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s815044068", "group_id": "codeNet:p00029", "input_text": " 0; $i--) {\n $num *= $i;\n }\n while ($num > 0) {\n $first = substr($num, -1);\n $num = substr($num, 0, -1);\n if ($first == 0) {\n $count++;\n } else {\n break;\n }\n }\n }\n echo $count;\n}\n?>", "language": "PHP", "metadata": {"date": 1475659716, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00052.html", "problem_id": "p00052", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00052/input.txt", "sample_output_relpath": "derived/input_output/data/p00052/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00052/PHP/s339732159.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s339732159", "user_id": "u624893585"}, "prompt_components": {"gold_output": "0\n2\n2499\n", "input_to_evaluate": " 0; $i--) {\n $num *= $i;\n }\n while ($num > 0) {\n $first = substr($num, -1);\n $num = substr($num, 0, -1);\n if ($first == 0) {\n $count++;\n } else {\n break;\n }\n }\n }\n echo $count;\n}\n?>", "problem_context": "階乗 II\n\nn! = n × (n − 1) × (n − 2) × ... × 3 × 2 × 1\n\nを n の階乗といいます。例えば、12 の階乗は\n\n12! = 12 × 11 × 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 479001600\n\nとなり、末尾に 0 が 2 つ連続して並んでいます。\n\n整数 n を入力して、n! の末尾に連続して並んでいる 0 の数を出力するプログラムを作成してください。ただし、n は 20000 以下の正の整数とします。\n\nInput\n\n複数のデータが与えられます。各データに n (n ≤ 20000) が1行に与えられます。n が 0 の時入力の最後とします。\n\nデータの数は 20 を超えません。\n\nOutput\n\n各データに対して n! の末尾に連続して並んでいる 0 の数を1行に出力して下さい。\n\nSample Input\n\n2\n12\n10000\n0\n\nOutput for the Sample Input\n\n0\n2\n2499", "sample_input": "2\n12\n10000\n0\n"}, "reference_outputs": ["0\n2\n2499\n"], "source_document_id": "p00052", "source_text": "階乗 II\n\nn! = n × (n − 1) × (n − 2) × ... × 3 × 2 × 1\n\nを n の階乗といいます。例えば、12 の階乗は\n\n12! = 12 × 11 × 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 479001600\n\nとなり、末尾に 0 が 2 つ連続して並んでいます。\n\n整数 n を入力して、n! の末尾に連続して並んでいる 0 の数を出力するプログラムを作成してください。ただし、n は 20000 以下の正の整数とします。\n\nInput\n\n複数のデータが与えられます。各データに n (n ≤ 20000) が1行に与えられます。n が 0 の時入力の最後とします。\n\nデータの数は 20 を超えません。\n\nOutput\n\n各データに対して n! の末尾に連続して並んでいる 0 の数を1行に出力して下さい。\n\nSample Input\n\n2\n12\n10000\n0\n\nOutput for the Sample Input\n\n0\n2\n2499", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 442, "cpu_time_ms": 40000, "memory_kb": 15332}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s260253043", "group_id": "codeNet:p00052", "input_text": "= 25) {\n\t\t\techo $number . \"\\n\";\n\t\t}\n\t}\n\n?>", "language": "PHP", "metadata": {"date": 1475661287, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00075.html", "problem_id": "p00075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00075/input.txt", "sample_output_relpath": "derived/input_output/data/p00075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00075/PHP/s640613533.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s640613533", "user_id": "u453324819"}, "prompt_components": {"gold_output": "1004\n1005\n", "input_to_evaluate": "= 25) {\n\t\t\techo $number . \"\\n\";\n\t\t}\n\t}\n\n?>", "problem_context": "BMI\n\n肥満は多くの成人病の原因として挙げられています。過去においては、一部の例外を除けば、高校生には無縁なものでした。しかし、過度の受験勉強等のために運動不足となり、あるいはストレスによる過食症となることが、非現実的なこととはいえなくなっています。高校生にとっても十分関心を持たねばならない問題になるかもしれません。\n\nそこで、あなたは、保健室の先生の助手となって、生徒のデータから肥満の疑いのある生徒を探し出すプログラムを作成することになりました。\n\n方法は BMI (Body Mass Index) という数値を算出する方法です。BMIは次の式で与えられます。\n\nBMI = 22 が標準的で、25 以上だと肥満の疑いがあります。\n\n各々の生徒の体重、身長の情報から BMI を算出し、25 以上の生徒の学籍番号を出力するプログラムを作成してください。\n\n入力\n\n入力は以下の形式で与えられます。\n\ns1,w1,h1\ns2,w2,h2\n...\n...\n\nsi (1 ≤ si ≤ 2,000)、wi (1 ≤ wi ≤ 200)、hi (1.0 ≤ hi ≤ 2.0) はそれぞれ、i 番目の生徒の学籍番号(整数)、体重(実数)、身長(実数)を表します。\n\n生徒の数は 50 を超えません。\n\n出力\n\nBMI が 25 以上の生徒の学籍番号を、入力された順番にそれぞれ1行に出力します。\n\nSample Input\n\n1001,50.0,1.60\n1002,60.0,1.70\n1003,70.0,1.80\n1004,80.0,1.70\n1005,90.0,1.60\n\nOutput for the Sample Input\n\n1004\n1005", "sample_input": "1001,50.0,1.60\n1002,60.0,1.70\n1003,70.0,1.80\n1004,80.0,1.70\n1005,90.0,1.60\n"}, "reference_outputs": ["1004\n1005\n"], "source_document_id": "p00075", "source_text": "BMI\n\n肥満は多くの成人病の原因として挙げられています。過去においては、一部の例外を除けば、高校生には無縁なものでした。しかし、過度の受験勉強等のために運動不足となり、あるいはストレスによる過食症となることが、非現実的なこととはいえなくなっています。高校生にとっても十分関心を持たねばならない問題になるかもしれません。\n\nそこで、あなたは、保健室の先生の助手となって、生徒のデータから肥満の疑いのある生徒を探し出すプログラムを作成することになりました。\n\n方法は BMI (Body Mass Index) という数値を算出する方法です。BMIは次の式で与えられます。\n\nBMI = 22 が標準的で、25 以上だと肥満の疑いがあります。\n\n各々の生徒の体重、身長の情報から BMI を算出し、25 以上の生徒の学籍番号を出力するプログラムを作成してください。\n\n入力\n\n入力は以下の形式で与えられます。\n\ns1,w1,h1\ns2,w2,h2\n...\n...\n\nsi (1 ≤ si ≤ 2,000)、wi (1 ≤ wi ≤ 200)、hi (1.0 ≤ hi ≤ 2.0) はそれぞれ、i 番目の生徒の学籍番号(整数)、体重(実数)、身長(実数)を表します。\n\n生徒の数は 50 を超えません。\n\n出力\n\nBMI が 25 以上の生徒の学籍番号を、入力された順番にそれぞれ1行に出力します。\n\nSample Input\n\n1001,50.0,1.60\n1002,60.0,1.70\n1003,70.0,1.80\n1004,80.0,1.70\n1005,90.0,1.60\n\nOutput for the Sample Input\n\n1004\n1005", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 278, "cpu_time_ms": 10, "memory_kb": 15336}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s518904650", "group_id": "codeNet:p00083", "input_text": "= 1989 && $b >= 1 && $c >= 8) || ($a >= 1989 && $b >= 2) || ($a >= 1990)) {\n $a -= 1988;\n print(\"heisei $a $b $c\\n\");\n }\n else{\n if(($a >= 1926 && $b >= 12 && $c >= 25) || ($a >= 1927)){\n $a -= 1925;\n print(\"showa $a $b $c\\n\");\n }\n else{\n if(($a >= 1912 && $b >= 7 && $c >= 30) || ($a >= 1912 && $b >= 8) || ($a >= 1913)){\n $a -= 1911;\n print(\"taisho $a $b $c\\n\");\n }\n else{\n if(($a >= 1868 && $b >= 9 && $c >= 8) || ($a >= 1868 && $b >= 10) || ($a >= 1869)){\n $a -= 1867;\n print(\"meiji $a $b $c\\n\");\n }\n else{\n print(\"pre-meiji\\n\");\n }\n }\n }\n }\n \n }\n \n \n\t\t?>", "language": "PHP", "metadata": {"date": 1463661535, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00083.html", "problem_id": "p00083", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00083/input.txt", "sample_output_relpath": "derived/input_output/data/p00083/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00083/PHP/s518904650.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s518904650", "user_id": "u017136598"}, "prompt_components": {"gold_output": "heisei 17 9 3\nmeiji 1 12 2\npre-meiji\n", "input_to_evaluate": "= 1989 && $b >= 1 && $c >= 8) || ($a >= 1989 && $b >= 2) || ($a >= 1990)) {\n $a -= 1988;\n print(\"heisei $a $b $c\\n\");\n }\n else{\n if(($a >= 1926 && $b >= 12 && $c >= 25) || ($a >= 1927)){\n $a -= 1925;\n print(\"showa $a $b $c\\n\");\n }\n else{\n if(($a >= 1912 && $b >= 7 && $c >= 30) || ($a >= 1912 && $b >= 8) || ($a >= 1913)){\n $a -= 1911;\n print(\"taisho $a $b $c\\n\");\n }\n else{\n if(($a >= 1868 && $b >= 9 && $c >= 8) || ($a >= 1868 && $b >= 10) || ($a >= 1869)){\n $a -= 1867;\n print(\"meiji $a $b $c\\n\");\n }\n else{\n print(\"pre-meiji\\n\");\n }\n }\n }\n }\n \n }\n \n \n\t\t?>", "problem_context": "西暦和暦変換\n\n西暦で表された年月日を、元号を用いた和暦に変換し、その年月日を出力するプログラムを作成してください。入力は例に示すように 3 つの整数であり、順に西暦年、月、日です。これを、出力例に示すように変換してください。なお、明治以前の年月日が入力された場合は「pre-meiji」と表示してください。\n\n各年号の最初の年は「元年」ではなく「1年」と出力することとします。\n\n元号\n\n期間\n\nmeiji\n\n1868. 9. 8 〜 1912. 7.29\n\ntaisho\n\n1912. 7.30 〜 1926.12.24\n\nshowa\n\n1926.12.25 〜 1989. 1. 7\n\nheisei\n\n1989. 1. 8 〜\n\n入力\n\n複数のデータが与えられます。各データとして年、月、日を表す3つの整数が空白区切りで1行に与えられます。\n\n入力の終わりまで処理してください。データの数は 50 を超えません。\n\n出力\n\n空白区切りの元号、年、月、日、または「pre-meiji」を1行に出力してください。\n\nSample Input\n\n2005 9 3\n1868 12 2\n1868 9 7\n\nOutput for the Sample Input\n\nheisei 17 9 3\nmeiji 1 12 2\npre-meiji", "sample_input": "2005 9 3\n1868 12 2\n1868 9 7\n"}, "reference_outputs": ["heisei 17 9 3\nmeiji 1 12 2\npre-meiji\n"], "source_document_id": "p00083", "source_text": "西暦和暦変換\n\n西暦で表された年月日を、元号を用いた和暦に変換し、その年月日を出力するプログラムを作成してください。入力は例に示すように 3 つの整数であり、順に西暦年、月、日です。これを、出力例に示すように変換してください。なお、明治以前の年月日が入力された場合は「pre-meiji」と表示してください。\n\n各年号の最初の年は「元年」ではなく「1年」と出力することとします。\n\n元号\n\n期間\n\nmeiji\n\n1868. 9. 8 〜 1912. 7.29\n\ntaisho\n\n1912. 7.30 〜 1926.12.24\n\nshowa\n\n1926.12.25 〜 1989. 1. 7\n\nheisei\n\n1989. 1. 8 〜\n\n入力\n\n複数のデータが与えられます。各データとして年、月、日を表す3つの整数が空白区切りで1行に与えられます。\n\n入力の終わりまで処理してください。データの数は 50 を超えません。\n\n出力\n\n空白区切りの元号、年、月、日、または「pre-meiji」を1行に出力してください。\n\nSample Input\n\n2005 9 3\n1868 12 2\n1868 9 7\n\nOutput for the Sample Input\n\nheisei 17 9 3\nmeiji 1 12 2\npre-meiji", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1254, "cpu_time_ms": 10, "memory_kb": 15144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s100960391", "group_id": "codeNet:p00084", "input_text": " 2 && strlen($words[$i]) < 7) {\n $compWords[] = $words[$i];\n }\n}\nprint implode(' ', $compWords);\n?>", "language": "PHP", "metadata": {"date": 1475661466, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00084.html", "problem_id": "p00084", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00084/input.txt", "sample_output_relpath": "derived/input_output/data/p00084/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00084/PHP/s100960391.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s100960391", "user_id": "u453324819"}, "prompt_components": {"gold_output": "Rain rain Spain\n", "input_to_evaluate": " 2 && strlen($words[$i]) < 7) {\n $compWords[] = $words[$i];\n }\n}\nprint implode(' ', $compWords);\n?>", "problem_context": "検索エンジン\n\nインターネットの検索エンジン、例えば、Google などでは、世界中のウェブページを自動で収捨して分類し、巨大なデータベースを作成します。また、ユーザが入力した検索キーワードを解析して、データベース検索のための問い合わせ文を作成します。\n\nいずれの場合も、効率的な検索を実現するために複雑な処理を行っていますが、とりあえずの基本は全て文章からの単語の切り出しです。\n\nということで、文章からの単語の切り出しに挑戦してください。今回は以下の通り、単語区切りが明確な英語の文章を対象とします。\n\n対象となる文章 : 改行を含まない 1024 文字以下の英語の文章\n\n区切り文字 : いずれも半角で空白、ピリオド、カンマのみ\n\n切り出す単語 : 3 から 6 文字の単語(2文字以下や7文字以上の単語は無視) \n\n入力\n\n区切り文字及び英数字で構成される英文が1行(すべて半角)に与えられます。\n\n出力\n\n空白文字1文字(半角)で区切られた単語を1行に出力してください。\n\nSample Input\n\nRain, rain, go to Spain.\n\nOutput for the Sample Input\n\nRain rain Spain\n\nSample Input 2\n\nWin today's preliminary contest and be qualified to visit University of Aizu.\n\nOutput for the Sample Input 2\n\nWin and visit Aizu", "sample_input": "Rain, rain, go to Spain.\n"}, "reference_outputs": ["Rain rain Spain\n"], "source_document_id": "p00084", "source_text": "検索エンジン\n\nインターネットの検索エンジン、例えば、Google などでは、世界中のウェブページを自動で収捨して分類し、巨大なデータベースを作成します。また、ユーザが入力した検索キーワードを解析して、データベース検索のための問い合わせ文を作成します。\n\nいずれの場合も、効率的な検索を実現するために複雑な処理を行っていますが、とりあえずの基本は全て文章からの単語の切り出しです。\n\nということで、文章からの単語の切り出しに挑戦してください。今回は以下の通り、単語区切りが明確な英語の文章を対象とします。\n\n対象となる文章 : 改行を含まない 1024 文字以下の英語の文章\n\n区切り文字 : いずれも半角で空白、ピリオド、カンマのみ\n\n切り出す単語 : 3 から 6 文字の単語(2文字以下や7文字以上の単語は無視) \n\n入力\n\n区切り文字及び英数字で構成される英文が1行(すべて半角)に与えられます。\n\n出力\n\n空白文字1文字(半角)で区切られた単語を1行に出力してください。\n\nSample Input\n\nRain, rain, go to Spain.\n\nOutput for the Sample Input\n\nRain rain Spain\n\nSample Input 2\n\nWin today's preliminary contest and be qualified to visit University of Aizu.\n\nOutput for the Sample Input 2\n\nWin and visit Aizu", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 270, "cpu_time_ms": 10, "memory_kb": 15300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s343730685", "group_id": "codeNet:p00088", "input_text": " '101',\n \"'\" => '000000',\n ',' => '000011',\n '-' => '10010001',\n '.' => '010001',\n '?' => '000001',\n 'A' => '100101',\n 'B' => '10011010',\n 'C' => '0101',\n 'D' => '0001',\n 'E' => '110',\n 'F' => '01001',\n 'G' => '10011011',\n 'H' => '010000',\n 'I' => '0111',\n 'J' => '10011000',\n 'K' => '0110',\n 'L' => '00100',\n 'M' => '10011001',\n 'N' => '10011110',\n 'O' => '00101',\n 'P' => '111',\n 'Q' => '10011111',\n 'R' => '1000',\n 'S' => '00110',\n 'T' => '00111',\n 'U' => '10011100',\n 'V' => '10011101',\n 'W' => '000010',\n 'X' => '10010010',\n 'Y' => '10010011',\n 'Z' => '10010000',\n);\n\n$decode = array(\n '00000' => 'A',\n '00001' => 'B',\n '00010' => 'C',\n '00011' => 'D',\n '00100' => 'E',\n '00101' => 'F',\n '00110' => 'G',\n '00111' => 'H',\n '01000' => 'I',\n '01001' => 'J',\n '01010' => 'K',\n '01011' => 'L',\n '01100' => 'M',\n '01101' => 'N',\n '01110' => 'O',\n '01111' => 'P',\n '10000' => 'Q',\n '10001' => 'R',\n '10010' => 'S',\n '10011' => 'T',\n '10100' => 'U',\n '10101' => 'V',\n '10110' => 'W',\n '10111' => 'X',\n '11000' => 'Y',\n '11001' => 'Z',\n '11010' => ' ',\n '11011' => '.',\n '11100' => ',',\n '11101' => '-',\n '11110' => \"'\",\n '11111' => '?',\n);\n\nwhile (($line = trim(fgets(STDIN))) !== '') {\n $code = '';\n for ($i = 0, $len = strlen($line); $i < $len; $i++) {\n $ch = $line[$i];\n $code .= $encode[$ch];\n }\n\n $len = strlen($code);\n while (strlen($code) % 5 !== 0) {\n $code .= '0';\n }\n\n for ($i = 0, $len = strlen($code); $i < $len; $i += 5) {\n echo $decode[substr($code, $i, 5)];\n }\n echo \"\\n\";\n}", "language": "PHP", "metadata": {"date": 1423923110, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00088.html", "problem_id": "p00088", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00088/input.txt", "sample_output_relpath": "derived/input_output/data/p00088/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00088/PHP/s343730685.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s343730685", "user_id": "u133486819"}, "prompt_components": {"gold_output": "?D-C'KOPUA\n", "input_to_evaluate": " '101',\n \"'\" => '000000',\n ',' => '000011',\n '-' => '10010001',\n '.' => '010001',\n '?' => '000001',\n 'A' => '100101',\n 'B' => '10011010',\n 'C' => '0101',\n 'D' => '0001',\n 'E' => '110',\n 'F' => '01001',\n 'G' => '10011011',\n 'H' => '010000',\n 'I' => '0111',\n 'J' => '10011000',\n 'K' => '0110',\n 'L' => '00100',\n 'M' => '10011001',\n 'N' => '10011110',\n 'O' => '00101',\n 'P' => '111',\n 'Q' => '10011111',\n 'R' => '1000',\n 'S' => '00110',\n 'T' => '00111',\n 'U' => '10011100',\n 'V' => '10011101',\n 'W' => '000010',\n 'X' => '10010010',\n 'Y' => '10010011',\n 'Z' => '10010000',\n);\n\n$decode = array(\n '00000' => 'A',\n '00001' => 'B',\n '00010' => 'C',\n '00011' => 'D',\n '00100' => 'E',\n '00101' => 'F',\n '00110' => 'G',\n '00111' => 'H',\n '01000' => 'I',\n '01001' => 'J',\n '01010' => 'K',\n '01011' => 'L',\n '01100' => 'M',\n '01101' => 'N',\n '01110' => 'O',\n '01111' => 'P',\n '10000' => 'Q',\n '10001' => 'R',\n '10010' => 'S',\n '10011' => 'T',\n '10100' => 'U',\n '10101' => 'V',\n '10110' => 'W',\n '10111' => 'X',\n '11000' => 'Y',\n '11001' => 'Z',\n '11010' => ' ',\n '11011' => '.',\n '11100' => ',',\n '11101' => '-',\n '11110' => \"'\",\n '11111' => '?',\n);\n\nwhile (($line = trim(fgets(STDIN))) !== '') {\n $code = '';\n for ($i = 0, $len = strlen($line); $i < $len; $i++) {\n $ch = $line[$i];\n $code .= $encode[$ch];\n }\n\n $len = strlen($code);\n while (strlen($code) % 5 !== 0) {\n $code .= '0';\n }\n\n for ($i = 0, $len = strlen($code); $i < $len; $i += 5) {\n echo $decode[substr($code, $i, 5)];\n }\n echo \"\\n\";\n}", "problem_context": "博士が愛した符号\n\n博士 : ピーター君、ついにやったよ。\n\nピーター : どうしました、デビッド博士?またくだらない発明ですか?\n\n博士 : この表だよ、この表。\n\n文字\n\n符号\n\n(空白)\n\n101\n\n'\n\n000000\n\n,\n\n000011\n\n-\n\n10010001\n\n.\n\n010001\n\n?\n\n000001\n\nA\n\n100101\n\nB\n\n10011010\n\n文字\n\n符号\n\nC\n\n0101\n\nD\n\n0001\n\nE\n\n110\n\nF\n\n01001\n\nG\n\n10011011\n\nH\n\n010000\n\nI\n\n0111\n\nJ\n\n10011000\n\n文字\n\n符号\n\nK\n\n0110\n\nL\n\n00100\n\nM\n\n10011001\n\nN\n\n10011110\n\nO\n\n00101\n\nP\n\n111\n\nQ\n\n10011111\n\nR\n\n1000\n\n文字\n\n符号\n\nS\n\n00110\n\nT\n\n00111\n\nU\n\n10011100\n\nV\n\n10011101\n\nW\n\n000010\n\nX\n\n10010010\n\nY\n\n10010011\n\nZ\n\n10010000\n\nピーター : なんですか? この表は。\n\n博士 : いいから、言う通りにしてみなさい。まず、お前の名前を紙に書いてごらん。\n\nピーター : はい\"PETER POTTER\" っと。\n\n博士 : そうしたら、1文字ずつ、この表の「符号」に置き換えるのだよ。\n\nピーター : えーと\"P\" を「111」にして\"E\" を「110」して…結構面倒ですね。\n\n111 110 00111 110 1000 101 111 00101 00111 00111 110 1000\n\nになりました。なんだか、バーコードみたいですね。\n\n博士 : よろしい。そうしたら、置き換えた文字列を全部つなげて、5文字ごとに区切ってみなさい。\n\nピーター : はいはい、つなげて区切ると。\n\n11111 00011 11101 00010 11110 01010 01110 01111 10100 0\n\nこんな感じになりました。けど、最後の「0」だけのやつはどうしますか?\n\n博士 : 0を付け加えて5文字にしておいてくれ。\n\nピーター : えーと最後が0が1個だけだから0をあと4つ加えてやればいいんですね。できました。\n\n11111 00011 11101 00010 11110 01010 01110 01111 10100 00000\n\n博士 : 次はこの表を使うのだ。\n\n符号\n\n文字\n\n00000\n\nA\n\n00001\n\nB\n\n00010\n\nC\n\n00011\n\nD\n\n00100\n\nE\n\n00101\n\nF\n\n00110\n\nG\n\n00111\n\nH\n\n符号\n\n文字\n\n01000\n\nI\n\n01001\n\nJ\n\n01010\n\nK\n\n01011\n\nL\n\n01100\n\nM\n\n01101\n\nN\n\n01110\n\nO\n\n01111\n\nP\n\n符号\n\n文字\n\n10000\n\nQ\n\n10001\n\nR\n\n10010\n\nS\n\n10011\n\nT\n\n10100\n\nU\n\n10101\n\nV\n\n10110\n\nW\n\n10111\n\nX\n\n符号\n\n文字\n\n11000\n\nY\n\n11001\n\nZ\n\n11010\n\n(空白)\n\n11011\n\n.\n\n11100\n\n,\n\n11101\n\n-\n\n11110\n\n'\n\n11111\n\n?\n\nピーター : これをどう使うんですか…そうか!今度は符号から文字に置き換えるのか!\n\n博士 : そうそう。「11111」だったら「?」に、「00011」だったら「D」にとやってゆけばいいんだよ。\n\nピーター : これは単純ですね……えーと「?D-C'KOPUA」になりました。でも意味不明ですよ。\n\n博士 : 文字数を数えてごらん。\n\nピーター : 10文字ですよ。あっ、「PETER POTTER」は12文字だったのに2文字減っています。\n\n博士 : そう、この表を使えば文字を減らすことができるのだよ。じゃあ今度はこの文章で同じことをやっ\nてごらん。\n\nPETER PIPER PICKED A PECK OF PICKLED PEPPERS. A PECK OF PICKLED PEPPERS\nPETER PIPER PICKED. IF PETER PIPER PICKED A PECK OF PICKLED PEPPERS, WHERE'S\nTHE PECK OF PICKLED PEPPERS PETER PIPER PICKED?\n\nピーター : ぎょぎょ、行が分かれていますが、どうするんですか?\n\n博士 : 紙の都合で3行になってしまったが、改行文字のかわりに空白がある長い1行だと思っておくれ。\n\nピーター : はいはい。行と行の間にあるのは空白だと。しかし面倒だな……。\n\n博士 : だったらプログラムにやらせればいいではないか。\n\nということで、ピーターの代わりに、読み込んだ文字列を符号に変換し出力するプログラムを作成してください。\n\n入力\n\n複数のデータセットが与えられます。各データセットに文字列1行(表に含まれる文字からなる)が与えられます。文字列に含まれる文字の数は 1 文字以上 100 文字以下です。\n\nデータセットの数は 200 を超えません。\n\n出力\n\n各データセットごとに、変換後の文字列を1行に出力してください。\n\nSample Input\n\nPETER POTTER\n\nOutput for the Sample Input\n\n?D-C'KOPUA", "sample_input": "PETER POTTER\n"}, "reference_outputs": ["?D-C'KOPUA\n"], "source_document_id": "p00088", "source_text": "博士が愛した符号\n\n博士 : ピーター君、ついにやったよ。\n\nピーター : どうしました、デビッド博士?またくだらない発明ですか?\n\n博士 : この表だよ、この表。\n\n文字\n\n符号\n\n(空白)\n\n101\n\n'\n\n000000\n\n,\n\n000011\n\n-\n\n10010001\n\n.\n\n010001\n\n?\n\n000001\n\nA\n\n100101\n\nB\n\n10011010\n\n文字\n\n符号\n\nC\n\n0101\n\nD\n\n0001\n\nE\n\n110\n\nF\n\n01001\n\nG\n\n10011011\n\nH\n\n010000\n\nI\n\n0111\n\nJ\n\n10011000\n\n文字\n\n符号\n\nK\n\n0110\n\nL\n\n00100\n\nM\n\n10011001\n\nN\n\n10011110\n\nO\n\n00101\n\nP\n\n111\n\nQ\n\n10011111\n\nR\n\n1000\n\n文字\n\n符号\n\nS\n\n00110\n\nT\n\n00111\n\nU\n\n10011100\n\nV\n\n10011101\n\nW\n\n000010\n\nX\n\n10010010\n\nY\n\n10010011\n\nZ\n\n10010000\n\nピーター : なんですか? この表は。\n\n博士 : いいから、言う通りにしてみなさい。まず、お前の名前を紙に書いてごらん。\n\nピーター : はい\"PETER POTTER\" っと。\n\n博士 : そうしたら、1文字ずつ、この表の「符号」に置き換えるのだよ。\n\nピーター : えーと\"P\" を「111」にして\"E\" を「110」して…結構面倒ですね。\n\n111 110 00111 110 1000 101 111 00101 00111 00111 110 1000\n\nになりました。なんだか、バーコードみたいですね。\n\n博士 : よろしい。そうしたら、置き換えた文字列を全部つなげて、5文字ごとに区切ってみなさい。\n\nピーター : はいはい、つなげて区切ると。\n\n11111 00011 11101 00010 11110 01010 01110 01111 10100 0\n\nこんな感じになりました。けど、最後の「0」だけのやつはどうしますか?\n\n博士 : 0を付け加えて5文字にしておいてくれ。\n\nピーター : えーと最後が0が1個だけだから0をあと4つ加えてやればいいんですね。できました。\n\n11111 00011 11101 00010 11110 01010 01110 01111 10100 00000\n\n博士 : 次はこの表を使うのだ。\n\n符号\n\n文字\n\n00000\n\nA\n\n00001\n\nB\n\n00010\n\nC\n\n00011\n\nD\n\n00100\n\nE\n\n00101\n\nF\n\n00110\n\nG\n\n00111\n\nH\n\n符号\n\n文字\n\n01000\n\nI\n\n01001\n\nJ\n\n01010\n\nK\n\n01011\n\nL\n\n01100\n\nM\n\n01101\n\nN\n\n01110\n\nO\n\n01111\n\nP\n\n符号\n\n文字\n\n10000\n\nQ\n\n10001\n\nR\n\n10010\n\nS\n\n10011\n\nT\n\n10100\n\nU\n\n10101\n\nV\n\n10110\n\nW\n\n10111\n\nX\n\n符号\n\n文字\n\n11000\n\nY\n\n11001\n\nZ\n\n11010\n\n(空白)\n\n11011\n\n.\n\n11100\n\n,\n\n11101\n\n-\n\n11110\n\n'\n\n11111\n\n?\n\nピーター : これをどう使うんですか…そうか!今度は符号から文字に置き換えるのか!\n\n博士 : そうそう。「11111」だったら「?」に、「00011」だったら「D」にとやってゆけばいいんだよ。\n\nピーター : これは単純ですね……えーと「?D-C'KOPUA」になりました。でも意味不明ですよ。\n\n博士 : 文字数を数えてごらん。\n\nピーター : 10文字ですよ。あっ、「PETER POTTER」は12文字だったのに2文字減っています。\n\n博士 : そう、この表を使えば文字を減らすことができるのだよ。じゃあ今度はこの文章で同じことをやっ\nてごらん。\n\nPETER PIPER PICKED A PECK OF PICKLED PEPPERS. A PECK OF PICKLED PEPPERS\nPETER PIPER PICKED. IF PETER PIPER PICKED A PECK OF PICKLED PEPPERS, WHERE'S\nTHE PECK OF PICKLED PEPPERS PETER PIPER PICKED?\n\nピーター : ぎょぎょ、行が分かれていますが、どうするんですか?\n\n博士 : 紙の都合で3行になってしまったが、改行文字のかわりに空白がある長い1行だと思っておくれ。\n\nピーター : はいはい。行と行の間にあるのは空白だと。しかし面倒だな……。\n\n博士 : だったらプログラムにやらせればいいではないか。\n\nということで、ピーターの代わりに、読み込んだ文字列を符号に変換し出力するプログラムを作成してください。\n\n入力\n\n複数のデータセットが与えられます。各データセットに文字列1行(表に含まれる文字からなる)が与えられます。文字列に含まれる文字の数は 1 文字以上 100 文字以下です。\n\nデータセットの数は 200 を超えません。\n\n出力\n\n各データセットごとに、変換後の文字列を1行に出力してください。\n\nSample Input\n\nPETER POTTER\n\nOutput for the Sample Input\n\n?D-C'KOPUA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1764, "cpu_time_ms": 30, "memory_kb": 6644}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s648177428", "group_id": "codeNet:p00089", "input_text": "value = $value;\n\t}\n\n\tpublic function max_value() {\n\t\tif ($this->largest !== null) {\n\t\t\treturn $this->largest;\n\t\t}\n\t\tif (is_null($this->left) && is_null($this->right)) {\n\t\t\treturn $this->value;\n\t\t}\n\t\t$left = is_null($this->left) ? -1 : $this->left->max_value();\n\t\t$right = is_null($this->right) ? -1 : $this->right->max_value();\n\n\t\treturn $this->largest = $this->value + max($left, $right);\n\t}\n}\n\n$diamond = array();\n\nwhile ($line = trim(fgets(STDIN))) {\n\t$diamond[] = explode(',', $line);\n}\n\n$nodes = array();\nfor ($i = 0; $i < count($diamond); $i++) {\n\tfor ($j = 0; $j < count($diamond[$i]); $j++) {\n\t\t$nodes[$i][$j] = new Node($diamond[$i][$j]);\n\t}\n}\n\nfor ($i = 0; $i < count($nodes); $i++) {\n\tfor ($j = 0; $j < count($nodes[$i]); $j++) {\n\t\t$n = $nodes[$i][$j];\n\t\tif ($i < count($diamond)/2 - 1) {\n\t\t\t$n->left = isset($nodes[$i + 1][$j]) ? $nodes[$i + 1][$j] : null;\n\t\t\t$n->right = isset($nodes[$i + 1][$j + 1]) ? $nodes[$i + 1][$j + 1] : null;\n\t\t} else {\n\t\t\t$n->left = isset($nodes[$i + 1][$j - 1]) ? $nodes[$i + 1][$j - 1] : null;\n\t\t\t$n->right = isset($nodes[$i + 1][$j]) ? $nodes[$i + 1][$j] : null;\n\t\t}\n\t}\n}\n\n$top = $nodes[0][0];\n\necho $top->max_value() . \"\\n\";", "language": "PHP", "metadata": {"date": 1408858618, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00089.html", "problem_id": "p00089", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00089/input.txt", "sample_output_relpath": "derived/input_output/data/p00089/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00089/PHP/s648177428.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s648177428", "user_id": "u523886269"}, "prompt_components": {"gold_output": "55\n", "input_to_evaluate": "value = $value;\n\t}\n\n\tpublic function max_value() {\n\t\tif ($this->largest !== null) {\n\t\t\treturn $this->largest;\n\t\t}\n\t\tif (is_null($this->left) && is_null($this->right)) {\n\t\t\treturn $this->value;\n\t\t}\n\t\t$left = is_null($this->left) ? -1 : $this->left->max_value();\n\t\t$right = is_null($this->right) ? -1 : $this->right->max_value();\n\n\t\treturn $this->largest = $this->value + max($left, $right);\n\t}\n}\n\n$diamond = array();\n\nwhile ($line = trim(fgets(STDIN))) {\n\t$diamond[] = explode(',', $line);\n}\n\n$nodes = array();\nfor ($i = 0; $i < count($diamond); $i++) {\n\tfor ($j = 0; $j < count($diamond[$i]); $j++) {\n\t\t$nodes[$i][$j] = new Node($diamond[$i][$j]);\n\t}\n}\n\nfor ($i = 0; $i < count($nodes); $i++) {\n\tfor ($j = 0; $j < count($nodes[$i]); $j++) {\n\t\t$n = $nodes[$i][$j];\n\t\tif ($i < count($diamond)/2 - 1) {\n\t\t\t$n->left = isset($nodes[$i + 1][$j]) ? $nodes[$i + 1][$j] : null;\n\t\t\t$n->right = isset($nodes[$i + 1][$j + 1]) ? $nodes[$i + 1][$j + 1] : null;\n\t\t} else {\n\t\t\t$n->left = isset($nodes[$i + 1][$j - 1]) ? $nodes[$i + 1][$j - 1] : null;\n\t\t\t$n->right = isset($nodes[$i + 1][$j]) ? $nodes[$i + 1][$j] : null;\n\t\t}\n\t}\n}\n\n$top = $nodes[0][0];\n\necho $top->max_value() . \"\\n\";", "problem_context": "最短経路\n\n図1に例示するように整数(0 以上 99 以下)をひしがたに並べます。このような、ひしがたを表すデータを読み込んで、一番上からスタートして一番下まで次のルールに従って進むとき、通過する整数の和の最大値を出力するプログラムを作成してください。\n\n各ステップで、対角線上の左下か対角線上の右下に進むことができます。\n\n例えば図1の例では、図2に示すように、7,3,8,7,5,7,8,3,7を選んで通ったとき、その和は最大の 55 (7+3+8+7+5+7+8+3+7=55) となります。\n\nInput\n\n入力例に示すように、カンマで区切られた整数の並びが、ひし形状に与えられます。各行に空白文字は含まれません。入力例は図1に対応しています。\nデータの行数は 100 行未満です。\n\nOutput\n\nルールに従って通過する整数の和の最大値を1行に出力します。\n\nSample Input\n\n7\n3,8\n8,1,0\n2,7,4,4\n4,5,2,6,5\n2,7,4,4\n8,1,0\n3,8\n7\n\nSample Output\n\n55", "sample_input": "7\n3,8\n8,1,0\n2,7,4,4\n4,5,2,6,5\n2,7,4,4\n8,1,0\n3,8\n7\n"}, "reference_outputs": ["55\n"], "source_document_id": "p00089", "source_text": "最短経路\n\n図1に例示するように整数(0 以上 99 以下)をひしがたに並べます。このような、ひしがたを表すデータを読み込んで、一番上からスタートして一番下まで次のルールに従って進むとき、通過する整数の和の最大値を出力するプログラムを作成してください。\n\n各ステップで、対角線上の左下か対角線上の右下に進むことができます。\n\n例えば図1の例では、図2に示すように、7,3,8,7,5,7,8,3,7を選んで通ったとき、その和は最大の 55 (7+3+8+7+5+7+8+3+7=55) となります。\n\nInput\n\n入力例に示すように、カンマで区切られた整数の並びが、ひし形状に与えられます。各行に空白文字は含まれません。入力例は図1に対応しています。\nデータの行数は 100 行未満です。\n\nOutput\n\nルールに従って通過する整数の和の最大値を1行に出力します。\n\nSample Input\n\n7\n3,8\n8,1,0\n2,7,4,4\n4,5,2,6,5\n2,7,4,4\n8,1,0\n3,8\n7\n\nSample Output\n\n55", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1321, "cpu_time_ms": 10, "memory_kb": 9672}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s007761627", "group_id": "codeNet:p00093", "input_text": "", "language": "PHP", "metadata": {"date": 1478081111, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00093.html", "problem_id": "p00093", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00093/input.txt", "sample_output_relpath": "derived/input_output/data/p00093/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00093/PHP/s007761627.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s007761627", "user_id": "u595800182"}, "prompt_components": {"gold_output": "2004\n2008\n\nNA\n\n2004\n2008\n", "input_to_evaluate": "", "problem_context": "うるう年\n\n西暦 a 年から b 年までの間にあるすべてのうるう年を出力するプログラムを作成してください。\n\nうるう年の条件は、次のとおりとします。ただし、0 < a ≤ b < 3,000 とします。与えられた期間にうるう年がない場合には \"NA\"と出力してください。\n\n西暦年が 4 で割り切れる年であること。\n\nただし、100 で割り切れる年はうるう年としない。\n\nしかし、400 で割り切れる年はうるう年である。\n\nInput\n\n複数のデータセットが与えられます。各データセットの形式は以下のとおりです:\n\na b\n\na, b がともに 0 のとき入力の終了とします。データセットの数は 50 を超えません。\n\nOutput\n\nデータセットごとに、西暦または NA を出力してください。\n\nデータセットの間に1つの空行を入れてください。\n\nSample Input\n\n2001 2010\n2005 2005\n2001 2010\n0 0\n\nOutput for the Sample Input\n\n2004\n2008\n\nNA\n\n2004\n2008", "sample_input": "2001 2010\n2005 2005\n2001 2010\n0 0\n"}, "reference_outputs": ["2004\n2008\n\nNA\n\n2004\n2008\n"], "source_document_id": "p00093", "source_text": "うるう年\n\n西暦 a 年から b 年までの間にあるすべてのうるう年を出力するプログラムを作成してください。\n\nうるう年の条件は、次のとおりとします。ただし、0 < a ≤ b < 3,000 とします。与えられた期間にうるう年がない場合には \"NA\"と出力してください。\n\n西暦年が 4 で割り切れる年であること。\n\nただし、100 で割り切れる年はうるう年としない。\n\nしかし、400 で割り切れる年はうるう年である。\n\nInput\n\n複数のデータセットが与えられます。各データセットの形式は以下のとおりです:\n\na b\n\na, b がともに 0 のとき入力の終了とします。データセットの数は 50 を超えません。\n\nOutput\n\nデータセットごとに、西暦または NA を出力してください。\n\nデータセットの間に1つの空行を入れてください。\n\nSample Input\n\n2001 2010\n2005 2005\n2001 2010\n0 0\n\nOutput for the Sample Input\n\n2004\n2008\n\nNA\n\n2004\n2008", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 646, "cpu_time_ms": 20, "memory_kb": 15284}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s236189283", "group_id": "codeNet:p00103", "input_text": " $ch) {\n $map[$i][$j] = $ch;\n }\n }\n\n $p = '0 0';\n $result = 'LOOP';\n while (!in_array($p, $visited)) {\n sscanf($p, '%d %d', $x, $y);\n $visited[] = $p;\n switch ($map[$y][$x]) {\n case '>':\n $p = sprintf('%d %d', $x + 1, $y);\n break;\n\n case '<':\n $p = sprintf('%d %d', $x - 1, $y);\n break;\n\n case '^':\n $p = sprintf('%d %d', $x, $y - 1);\n break;\n\n case 'v':\n $p = sprintf('%d %d', $x, $y + 1);\n break;\n\n default:\n $result = $p;\n break 2;\n }\n }\n\n echo $result, PHP_EOL;\n}", "language": "PHP", "metadata": {"date": 1423886126, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00104.html", "problem_id": "p00104", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00104/input.txt", "sample_output_relpath": "derived/input_output/data/p00104/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00104/PHP/s366455032.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s366455032", "user_id": "u133486819"}, "prompt_components": {"gold_output": "5 7\nLOOP\n", "input_to_evaluate": " $ch) {\n $map[$i][$j] = $ch;\n }\n }\n\n $p = '0 0';\n $result = 'LOOP';\n while (!in_array($p, $visited)) {\n sscanf($p, '%d %d', $x, $y);\n $visited[] = $p;\n switch ($map[$y][$x]) {\n case '>':\n $p = sprintf('%d %d', $x + 1, $y);\n break;\n\n case '<':\n $p = sprintf('%d %d', $x - 1, $y);\n break;\n\n case '^':\n $p = sprintf('%d %d', $x, $y - 1);\n break;\n\n case 'v':\n $p = sprintf('%d %d', $x, $y + 1);\n break;\n\n default:\n $result = $p;\n break 2;\n }\n }\n\n echo $result, PHP_EOL;\n}", "problem_context": "Magic Tile\n\nThere is a magic room in a homestead. The room is paved with H × W tiles. There are five different tiles:\n\nTile with a east-pointing arrow\n\nTile with a west-pointing arrow\n\nTile with a south-pointing arrow\n\nTile with a north-pointing arrow\n\nTile with nothing\n\nOnce a person steps onto a tile which has an arrow, the mystic force makes the person go to the next tile pointed by the arrow. If the next tile has an arrow, the person moves to the next, ans so on. The person moves on until he/she steps onto a tile which does not have the arrow (the tile with nothing). The entrance of the room is at the northwest corner.\n\nYour task is to write a program which simulates the movement of the person in the room. The program should read strings which represent the room and print the last position of the person.\n\nThe input represents the room as seen from directly above, and up, down, left and right side of the input correspond to north, south, west and east side of the room respectively. The horizontal axis represents x-axis (from 0 to W-1, inclusive) and the vertical axis represents y-axis (from 0 to H-1, inclusive). The upper left tile corresponds to (0, 0).\n\nThe following figure shows an example of the input:\n\n10 10\n>>>v..>>>v\n...v..^..v\n...>>>^..v\n.........v\n.v<<<<...v\n.v...^...v\n.v...^<<<<\n.v........\n.v...^....\n.>>>>^....\n\nCharacters represent tiles as follows:\n\n'>': Tile with a east-pointing arrow\n'<': Tile with a west-pointing arrow\n'^': Tile with a north-pointing arrow\n'v': Tile with a south-pointing arrow\n'.': Tile with nothing\n\nIf the person goes in cycles forever, your program should print \"LOOP\". You may assume that the person never goes outside of the room.\n\nInput\n\nThe input consists of multiple datasets. The input ends with a line which contains two 0. Each dataset consists of:\n\nH W\nH lines where each line contains W characters\n\nYou can assume that 0 < W, H < 101.\n\nOutput\n\nFor each dataset, print the coordinate (X, Y) of the person or \"LOOP\" in a line. X and Y should be separated by a space.\n\nSample Input\n\n10 10\n>>>v..>>>v\n...v..^..v\n>>>>>>^..v\n.........v\n.v<<<<...v\n.v.v.^...v\n.v.v.^<<<<\n.v.v.....v\n.v...^...v\n.>>>>^....\n6 10\n>>>>>>>>>v\n.........v\n.........v\n>>>>v....v\n^...v....v\n^<<<<<<<<<\n0 0\n\nOutput for the Sample Input\n\n5 7\nLOOP", "sample_input": "10 10\n>>>v..>>>v\n...v..^..v\n>>>>>>^..v\n.........v\n.v\n"}, "reference_outputs": ["5 7\nLOOP\n"], "source_document_id": "p00104", "source_text": "Magic Tile\n\nThere is a magic room in a homestead. The room is paved with H × W tiles. There are five different tiles:\n\nTile with a east-pointing arrow\n\nTile with a west-pointing arrow\n\nTile with a south-pointing arrow\n\nTile with a north-pointing arrow\n\nTile with nothing\n\nOnce a person steps onto a tile which has an arrow, the mystic force makes the person go to the next tile pointed by the arrow. If the next tile has an arrow, the person moves to the next, ans so on. The person moves on until he/she steps onto a tile which does not have the arrow (the tile with nothing). The entrance of the room is at the northwest corner.\n\nYour task is to write a program which simulates the movement of the person in the room. The program should read strings which represent the room and print the last position of the person.\n\nThe input represents the room as seen from directly above, and up, down, left and right side of the input correspond to north, south, west and east side of the room respectively. The horizontal axis represents x-axis (from 0 to W-1, inclusive) and the vertical axis represents y-axis (from 0 to H-1, inclusive). The upper left tile corresponds to (0, 0).\n\nThe following figure shows an example of the input:\n\n10 10\n>>>v..>>>v\n...v..^..v\n...>>>^..v\n.........v\n.v<<<<...v\n.v...^...v\n.v...^<<<<\n.v........\n.v...^....\n.>>>>^....\n\nCharacters represent tiles as follows:\n\n'>': Tile with a east-pointing arrow\n'<': Tile with a west-pointing arrow\n'^': Tile with a north-pointing arrow\n'v': Tile with a south-pointing arrow\n'.': Tile with nothing\n\nIf the person goes in cycles forever, your program should print \"LOOP\". You may assume that the person never goes outside of the room.\n\nInput\n\nThe input consists of multiple datasets. The input ends with a line which contains two 0. Each dataset consists of:\n\nH W\nH lines where each line contains W characters\n\nYou can assume that 0 < W, H < 101.\n\nOutput\n\nFor each dataset, print the coordinate (X, Y) of the person or \"LOOP\" in a line. X and Y should be separated by a space.\n\nSample Input\n\n10 10\n>>>v..>>>v\n...v..^..v\n>>>>>>^..v\n.........v\n.v<<<<...v\n.v.v.^...v\n.v.v.^<<<<\n.v.v.....v\n.v...^...v\n.>>>>^....\n6 10\n>>>>>>>>>v\n.........v\n.........v\n>>>>v....v\n^...v....v\n^<<<<<<<<<\n0 0\n\nOutput for the Sample Input\n\n5 7\nLOOP", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1040, "cpu_time_ms": 20, "memory_kb": 7860}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s667058883", "group_id": "codeNet:p00135", "input_text": "= 360) { $dig_h -= 360; }\n $df = abs($dig_h - $dig_m);\n if ($df > 180) { $df = 360 - $df; }\n\n// echo $df.':';\n if ($df < 30) {\n echo \"alert\\n\";\n } else if ($df < 90) {\n echo \"warning\\n\";\n } else {\n echo \"safe\\n\";\n }\n}", "language": "PHP", "metadata": {"date": 1475662269, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00135.html", "problem_id": "p00135", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00135/input.txt", "sample_output_relpath": "derived/input_output/data/p00135/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00135/PHP/s667058883.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s667058883", "user_id": "u860352238"}, "prompt_components": {"gold_output": "alert\nsafe\nalert\nwarning\n", "input_to_evaluate": "= 360) { $dig_h -= 360; }\n $df = abs($dig_h - $dig_m);\n if ($df > 180) { $df = 360 - $df; }\n\n// echo $df.':';\n if ($df < 30) {\n echo \"alert\\n\";\n } else if ($df < 90) {\n echo \"warning\\n\";\n } else {\n echo \"safe\\n\";\n }\n}", "problem_context": "時計の短い針と長い針\n\n原始スローライフ主義組織「アカルイダ」から、いたずらの予告状が届きました。アカルイダといえば、要人の顔面にパイを投げつけたりするいたずらで有名ですが、最近では火薬を用いてレセプション会場にネズミ花火をまき散らすなど、より過激化してきました。予告状は次の文面です。\n\n---パソコン ヒトの時間を奪う。良くない。\n時計の短い針と長い針 出会うころ、アカルイダ 正義行う。\nスローライフ 偉大なり。\n\nたどたどしくてよく解らないのですが、時計の短針と長針とが重なったころにいたずらを決行するという意味のようです。\n\nこのいたずらを警戒するため、時刻を入力として、短針と長針が近い場合は \"alert\"、遠い場合は \"safe\"、それ以外の場合は \"warning\" と出力するプログラムを作成してください。ただし、「近い」とは短針と長針の角度が 0° 以上 30° 未満の場合をいい、「遠い」とは 90° 以上 180° 以下の場合をいいます。なお、時刻は 00:00 以上 11:59 以下とします。\n\nInput\n\n入力は以下の形式で与えられます。\n\nn\nhh1:mm1\nhh2:mm2\n:\nhhn:mmn\n\n1 行目に判定する時刻の個数 n(1 ≤ n ≤ 10000)、2 行目以降に i 番目の時刻 hhi:mmi がそれぞれ1行に与えられます。\n\nOutput\n\ni 番目の時刻の判定結果 safe、warning、または alert を順番にそれぞれ1行に出力してください。\n\nSample Input\n\n4\n02:15\n06:01\n11:55\n10:40\n\nOutput for the Sample Input\n\nalert\nsafe\nalert\nwarning", "sample_input": "4\n02:15\n06:01\n11:55\n10:40\n"}, "reference_outputs": ["alert\nsafe\nalert\nwarning\n"], "source_document_id": "p00135", "source_text": "時計の短い針と長い針\n\n原始スローライフ主義組織「アカルイダ」から、いたずらの予告状が届きました。アカルイダといえば、要人の顔面にパイを投げつけたりするいたずらで有名ですが、最近では火薬を用いてレセプション会場にネズミ花火をまき散らすなど、より過激化してきました。予告状は次の文面です。\n\n---パソコン ヒトの時間を奪う。良くない。\n時計の短い針と長い針 出会うころ、アカルイダ 正義行う。\nスローライフ 偉大なり。\n\nたどたどしくてよく解らないのですが、時計の短針と長針とが重なったころにいたずらを決行するという意味のようです。\n\nこのいたずらを警戒するため、時刻を入力として、短針と長針が近い場合は \"alert\"、遠い場合は \"safe\"、それ以外の場合は \"warning\" と出力するプログラムを作成してください。ただし、「近い」とは短針と長針の角度が 0° 以上 30° 未満の場合をいい、「遠い」とは 90° 以上 180° 以下の場合をいいます。なお、時刻は 00:00 以上 11:59 以下とします。\n\nInput\n\n入力は以下の形式で与えられます。\n\nn\nhh1:mm1\nhh2:mm2\n:\nhhn:mmn\n\n1 行目に判定する時刻の個数 n(1 ≤ n ≤ 10000)、2 行目以降に i 番目の時刻 hhi:mmi がそれぞれ1行に与えられます。\n\nOutput\n\ni 番目の時刻の判定結果 safe、warning、または alert を順番にそれぞれ1行に出力してください。\n\nSample Input\n\n4\n02:15\n06:01\n11:55\n10:40\n\nOutput for the Sample Input\n\nalert\nsafe\nalert\nwarning", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 410, "cpu_time_ms": 10, "memory_kb": 15344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s618984194", "group_id": "codeNet:p00168", "input_text": "", "language": "PHP", "metadata": {"date": 1430174871, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00168.html", "problem_id": "p00168", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00168/input.txt", "sample_output_relpath": "derived/input_output/data/p00168/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00168/PHP/s618984194.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s618984194", "user_id": "u802954168"}, "prompt_components": {"gold_output": "1\n1\n34\n701\n", "input_to_evaluate": "", "problem_context": "観音堂\n\n一郎君の家の裏山には観音堂があります。この観音堂まではふもとから 30 段の階段があり、一郎君は、毎日のように観音堂まで遊びに行きます。一郎君は階段を1足で3段まで上がることができます。遊んでいるうちに階段の上り方の種類(段の飛ばし方の個数)が非常にたくさんあることに気がつきました。\n\nそこで、一日に 10 種類の上り方をし、すべての上り方を試そうと考えました。しかし数学を熟知しているあなたはそんなことでは一郎君の寿命が尽きてしまうことを知っているはずです。\n\n一郎君の計画が実現不可能であることを一郎君に納得させるために、階段の段数 n を入力とし、一日に 10 種類の上り方をするとして、一郎君がすべての上り方を実行するのに要する年数を出力するプログラムを作成してください。一年は 365 日として計算してください。一日でも必要なら一年とします。365 日なら 1 年であり、366 日なら 2 年となります。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終わりはゼロひとつの行で示されます。\n各データセットとして、段数を表す1つの整数 n (1 ≤ n ≤ 30) が1行に与えられます。\n\nデータセットの数は 30 を超えません。\n\nOutput\n\nデータセットごとに一郎君がすべての上り方を実行するのに必要な年数(整数)を1行に出力します。\n\nSample Input\n\n1\n10\n20\n25\n0\n\nOutput for the Sample Input\n\n1\n1\n34\n701", "sample_input": "1\n10\n20\n25\n0\n"}, "reference_outputs": ["1\n1\n34\n701\n"], "source_document_id": "p00168", "source_text": "観音堂\n\n一郎君の家の裏山には観音堂があります。この観音堂まではふもとから 30 段の階段があり、一郎君は、毎日のように観音堂まで遊びに行きます。一郎君は階段を1足で3段まで上がることができます。遊んでいるうちに階段の上り方の種類(段の飛ばし方の個数)が非常にたくさんあることに気がつきました。\n\nそこで、一日に 10 種類の上り方をし、すべての上り方を試そうと考えました。しかし数学を熟知しているあなたはそんなことでは一郎君の寿命が尽きてしまうことを知っているはずです。\n\n一郎君の計画が実現不可能であることを一郎君に納得させるために、階段の段数 n を入力とし、一日に 10 種類の上り方をするとして、一郎君がすべての上り方を実行するのに要する年数を出力するプログラムを作成してください。一年は 365 日として計算してください。一日でも必要なら一年とします。365 日なら 1 年であり、366 日なら 2 年となります。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終わりはゼロひとつの行で示されます。\n各データセットとして、段数を表す1つの整数 n (1 ≤ n ≤ 30) が1行に与えられます。\n\nデータセットの数は 30 を超えません。\n\nOutput\n\nデータセットごとに一郎君がすべての上り方を実行するのに必要な年数(整数)を1行に出力します。\n\nSample Input\n\n1\n10\n20\n25\n0\n\nOutput for the Sample Input\n\n1\n1\n34\n701", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 655, "cpu_time_ms": 10, "memory_kb": 6672}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s534619065", "group_id": "codeNet:p00179", "input_text": " $val){\n\t\tif (is_numeric($key)) {\t\t//配列のキーが数値ならば(secがあるので)\n\t\t\t$str = $str.$val;\n\t\t}\n\t}\n\treturn $str;\n}\n\n\nwhile (1){\n\t//変数の初期化\n\t$sec = 0;\n\t$goal_flag = 0;\n\n\t//ファイル読み込み\n\t$stdin = trim(fgets($file_handle));\n\t//終了条件\n\tif ($stdin == '0'){\n\t\tbreak;\n\t}\n\t$ary_start = str_split($stdin);\n\t\n\n\t//探索\n\twfs();\n\n\t//出力\n\tif ($goal_flag === 1){\n\t\techo $sec;\n\t} else {\n\t\techo 'NA';\n\t}\n\techo PHP_EOL;\n}\n\nfclose($file_handle);", "language": "PHP", "metadata": {"date": 1372808956, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00179.html", "problem_id": "p00179", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00179/input.txt", "sample_output_relpath": "derived/input_output/data/p00179/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00179/PHP/s534619065.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s534619065", "user_id": "u050004141"}, "prompt_components": {"gold_output": "5\n7\n1\n6\nNA\n8\n0\n4\n", "input_to_evaluate": " $val){\n\t\tif (is_numeric($key)) {\t\t//配列のキーが数値ならば(secがあるので)\n\t\t\t$str = $str.$val;\n\t\t}\n\t}\n\treturn $str;\n}\n\n\nwhile (1){\n\t//変数の初期化\n\t$sec = 0;\n\t$goal_flag = 0;\n\n\t//ファイル読み込み\n\t$stdin = trim(fgets($file_handle));\n\t//終了条件\n\tif ($stdin == '0'){\n\t\tbreak;\n\t}\n\t$ary_start = str_split($stdin);\n\t\n\n\t//探索\n\twfs();\n\n\t//出力\n\tif ($goal_flag === 1){\n\t\techo $sec;\n\t} else {\n\t\techo 'NA';\n\t}\n\techo PHP_EOL;\n}\n\nfclose($file_handle);", "problem_context": "ふしぎな虫\n\n会津生物学研究所のA博士は、とある南の島でふしぎな虫を発見しました。形は芋虫のように細長いのですが、ひとつの体節が玉のような形をしているので、糸でつないだビーズ玉のように見えます。ふしぎなのは体の色に様々なバリエーションがあることと、なかには時間がたつにつれて体の色が変っていく虫がいることでした。どの虫の体節の色も赤か緑か青のどれかに限られるようですが、1 秒ごとに体節の色が変わっていき、最後にはすべての体節が同じ色になって落ち着く場合もあれば、いつまで待ってもずっと色が変わりつづける場合もあるようでした。\n\n調べていくうちに、ふだんはすべての体節が同じ色をしているのですが、何かに驚いたりして興奮した後は体節の色が勝手に変わってしまうことがわかりました。一度体節の色が変わってしまうと、ふたたびすべての体節が同じ色になるまではずっと色が変わり続けることがわかりました。\n\nA博士はこの虫を何匹も捕まえて興奮させてみては、色が変わる様子を興味深く観察していましたが、やがて色が変化している最中の色の変わり方には次のような規則性があることに気がつきました。\n\n色が変わるのは、隣り合っている色違いの 2つの体節のペア 1組だけが変わり、他の体節の色は変わらない。ただし、そのようなペアが複数あるときに、どのペアの色が変わるかはあらかじめ予測できない。\n\nそのようなペアは、2つの体節の色のどちらでもない色に同時に変わる(たとえば、緑と赤の体節が隣り合っているときは、それらが同時に青に変わる)。\n\n虫の色の変化を、2秒後まですべて書いたものが上の図です。図の上段のような色をした虫がいるとします。このとき、隣り合った色違いの体節のペアは 3組あるので、1秒後には中段に並べて描いた 3通りの色のどれかに変わります。1秒後に中段左側の 2つのように変わったときには、2秒後にすべての体節が緑色になることができます(図の下段の左側から 2番目)。 それに対して、1秒後に中段の1番右のように変わったときには、2秒後にすべての体節が同じ色に変わることはありません。\n\n博士は、目の前にいる虫の体節がすべて同じ色になる可能性があるのか、あるとしたらそうなるのは最短で何秒後なのかを予測することにしました。\n\n目の前にいる虫の体節の色の並びを入力とし、その虫の体節がすべて同じ色になるのに要する最短の時間を秒単位で出力するプログラムを作成してください。ただし、同じ色になる可能性がないときは「NA(半角英大文字)」と出力してください。また、虫の体節の色の並びは2 以上 10 以下のr(赤)、g(緑)、b(青)からなる文字列で表されます。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終わりはゼロひとつの行で示されま\nす。各データセットとして、 虫の体節の情報を表す1つの文字列が1行に与えられます。\n\nデータセットの数は 100 を超えません。\n\nOutput\n\nデータセット毎に、すべての体節の色が同じになるまでに要する最小時間 (秒単位の整数) または NA を1行に出力します。\n\nSample Input\n\nrbgrg\nrbbgbbr\nbgr\nbgrbrgbr\nbggrgbgrr\ngbrggrbggr\nrrrrr\nbgbr\n0\n\nOutput for the Sample Input\n\n5\n7\n1\n6\nNA\n8\n0\n4", "sample_input": "rbgrg\nrbbgbbr\nbgr\nbgrbrgbr\nbggrgbgrr\ngbrggrbggr\nrrrrr\nbgbr\n0\n"}, "reference_outputs": ["5\n7\n1\n6\nNA\n8\n0\n4\n"], "source_document_id": "p00179", "source_text": "ふしぎな虫\n\n会津生物学研究所のA博士は、とある南の島でふしぎな虫を発見しました。形は芋虫のように細長いのですが、ひとつの体節が玉のような形をしているので、糸でつないだビーズ玉のように見えます。ふしぎなのは体の色に様々なバリエーションがあることと、なかには時間がたつにつれて体の色が変っていく虫がいることでした。どの虫の体節の色も赤か緑か青のどれかに限られるようですが、1 秒ごとに体節の色が変わっていき、最後にはすべての体節が同じ色になって落ち着く場合もあれば、いつまで待ってもずっと色が変わりつづける場合もあるようでした。\n\n調べていくうちに、ふだんはすべての体節が同じ色をしているのですが、何かに驚いたりして興奮した後は体節の色が勝手に変わってしまうことがわかりました。一度体節の色が変わってしまうと、ふたたびすべての体節が同じ色になるまではずっと色が変わり続けることがわかりました。\n\nA博士はこの虫を何匹も捕まえて興奮させてみては、色が変わる様子を興味深く観察していましたが、やがて色が変化している最中の色の変わり方には次のような規則性があることに気がつきました。\n\n色が変わるのは、隣り合っている色違いの 2つの体節のペア 1組だけが変わり、他の体節の色は変わらない。ただし、そのようなペアが複数あるときに、どのペアの色が変わるかはあらかじめ予測できない。\n\nそのようなペアは、2つの体節の色のどちらでもない色に同時に変わる(たとえば、緑と赤の体節が隣り合っているときは、それらが同時に青に変わる)。\n\n虫の色の変化を、2秒後まですべて書いたものが上の図です。図の上段のような色をした虫がいるとします。このとき、隣り合った色違いの体節のペアは 3組あるので、1秒後には中段に並べて描いた 3通りの色のどれかに変わります。1秒後に中段左側の 2つのように変わったときには、2秒後にすべての体節が緑色になることができます(図の下段の左側から 2番目)。 それに対して、1秒後に中段の1番右のように変わったときには、2秒後にすべての体節が同じ色に変わることはありません。\n\n博士は、目の前にいる虫の体節がすべて同じ色になる可能性があるのか、あるとしたらそうなるのは最短で何秒後なのかを予測することにしました。\n\n目の前にいる虫の体節の色の並びを入力とし、その虫の体節がすべて同じ色になるのに要する最短の時間を秒単位で出力するプログラムを作成してください。ただし、同じ色になる可能性がないときは「NA(半角英大文字)」と出力してください。また、虫の体節の色の並びは2 以上 10 以下のr(赤)、g(緑)、b(青)からなる文字列で表されます。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終わりはゼロひとつの行で示されま\nす。各データセットとして、 虫の体節の情報を表す1つの文字列が1行に与えられます。\n\nデータセットの数は 100 を超えません。\n\nOutput\n\nデータセット毎に、すべての体節の色が同じになるまでに要する最小時間 (秒単位の整数) または NA を1行に出力します。\n\nSample Input\n\nrbgrg\nrbbgbbr\nbgr\nbgrbrgbr\nbggrgbgrr\ngbrggrbggr\nrrrrr\nbgbr\n0\n\nOutput for the Sample Input\n\n5\n7\n1\n6\nNA\n8\n0\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2152, "cpu_time_ms": 7190, "memory_kb": 12924}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s315389809", "group_id": "codeNet:p00226", "input_text": "[0,0],\n 'B'=>[1,0],\n 'C'=>[2,0],\n 'D'=>[0,1],\n 'E'=>[1,1],\n 'F'=>[2,1],\n 'G'=>[0,2],\n 'H'=>[1,2],\n 'I'=>[2,2]);\n\n$memo = array();\n\nfunction f($cx, $cy, $n, $t, $b) { // $cx,$cy:セル座標、$n:残りバッテリ\nif (DEBUG) echo \"$cx, $cy, $n, $t, $b:\";\n global $cells, $dx, $dy, $memo;\n // メモチェック\n if (array_key_exists(\"$cx:$cy:$n\", $memo)) {\nif (DEBUG) echo $memo[\"$cx:$cy:$n\"].\"\\n\";\n return $memo[\"$cx:$cy:$n\"];\n }\n if ($n == 0) {\n // バッテリがなくなった\n if ($cx == $cells[$t][0] && $cy == $cells[$t][1]) {\n // 充電器で終了\nif (DEBUG) echo \"1\\n\";\n return 1;\n } else {\nif (DEBUG) echo \"0_1\\n\";\n return 0;\n }\n }\n\n // 4方向に移動する\n $ret = 0;\n for($i=0; $i<4; ++$i) {\n $x = $cx + $dx[$i];\n $y = $cy + $dy[$i];\n if ($x < 0 || 2 < $x || $y < 0 || 2 < $y\n || ($x == $cells[$b][0] && $y == $cells[$b][1])) {\n // 壁にあたった、又は、倉庫にぶつかったので座標を元に戻す\n $x = $cx;\n $y = $cy;\n }\nif (DEBUG) echo \"f\\n\";\n $ret += f($x, $y, $n-1, $t, $b);\n }\n// error_log(\"ret:$ret\");\n // メモ化\n $memo[\"$cx:$cy:$n\"] = $ret;\nif (DEBUG) echo \"$ret\\n\";\n return $ret;\n}\n\nwhile ($n = chop(fgets(STDIN))) {\n list($s, $t, $b) = explode(' ', chop(fgets(STDIN)));\n $memo = array();\n $num = f($cells[$s][0], $cells[$s][1], $n, $t, $b);\n echo sprintf('%.8f', $num / pow(4, $n)) . \"\\n\";\n unset($memo);\n}\n\n", "language": "PHP", "metadata": {"date": 1539615015, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00606.html", "problem_id": "p00606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00606/input.txt", "sample_output_relpath": "derived/input_output/data/p00606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00606/PHP/s348846289.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s348846289", "user_id": "u615703396"}, "prompt_components": {"gold_output": "0.00000000\n0.25000000\n0.06250000\n", "input_to_evaluate": "[0,0],\n 'B'=>[1,0],\n 'C'=>[2,0],\n 'D'=>[0,1],\n 'E'=>[1,1],\n 'F'=>[2,1],\n 'G'=>[0,2],\n 'H'=>[1,2],\n 'I'=>[2,2]);\n\n$memo = array();\n\nfunction f($cx, $cy, $n, $t, $b) { // $cx,$cy:セル座標、$n:残りバッテリ\nif (DEBUG) echo \"$cx, $cy, $n, $t, $b:\";\n global $cells, $dx, $dy, $memo;\n // メモチェック\n if (array_key_exists(\"$cx:$cy:$n\", $memo)) {\nif (DEBUG) echo $memo[\"$cx:$cy:$n\"].\"\\n\";\n return $memo[\"$cx:$cy:$n\"];\n }\n if ($n == 0) {\n // バッテリがなくなった\n if ($cx == $cells[$t][0] && $cy == $cells[$t][1]) {\n // 充電器で終了\nif (DEBUG) echo \"1\\n\";\n return 1;\n } else {\nif (DEBUG) echo \"0_1\\n\";\n return 0;\n }\n }\n\n // 4方向に移動する\n $ret = 0;\n for($i=0; $i<4; ++$i) {\n $x = $cx + $dx[$i];\n $y = $cy + $dy[$i];\n if ($x < 0 || 2 < $x || $y < 0 || 2 < $y\n || ($x == $cells[$b][0] && $y == $cells[$b][1])) {\n // 壁にあたった、又は、倉庫にぶつかったので座標を元に戻す\n $x = $cx;\n $y = $cy;\n }\nif (DEBUG) echo \"f\\n\";\n $ret += f($x, $y, $n-1, $t, $b);\n }\n// error_log(\"ret:$ret\");\n // メモ化\n $memo[\"$cx:$cy:$n\"] = $ret;\nif (DEBUG) echo \"$ret\\n\";\n return $ret;\n}\n\nwhile ($n = chop(fgets(STDIN))) {\n list($s, $t, $b) = explode(' ', chop(fgets(STDIN)));\n $memo = array();\n $num = f($cells[$s][0], $cells[$s][1], $n, $t, $b);\n echo sprintf('%.8f', $num / pow(4, $n)) . \"\\n\";\n unset($memo);\n}\n\n", "problem_context": "Problem B: Cleaning Robot\n\nDr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.\n\nAs shown in the following figure, his house has 9 rooms, where each room is identified by an alphabet:\n\nThe robot he developed operates as follows:\n\nIf the battery runs down, the robot stops.\n\nIf not so, the robot chooses a direction from four cardinal points with the equal probability, and moves to the room in that direction. Then, the robot clean the room and consumes 1 point of the battery.\n\nHowever, if there is no room in that direction, the robot does not move and remains the same room. In addition, there is a junk room in the house where the robot can not enter, and the robot also remains when it tries to enter the junk room. The robot also consumes 1 point of the battery when it remains the same place.\n\nA battery charger for the robot is in a room. It would be convenient for Dr. Asimov if the robot stops at the battery room when its battery run down.\n\nYour task is to write a program which computes the probability of the robot stopping at the battery room.\n\nInput\n\nThe input consists of several datasets. Each dataset consists of:\n\nn\ns t b\n\nn is an integer that indicates the initial battery point. s, t, b are alphabets respectively represent the room where the robot is initially, the battery room, and the junk room.\n\nThe input ends with a dataset which consists of single 0 for n. Your program should not output for this dataset.\n\nOutput\n\nFor each dataset, print the probability as a floating point number in a line. The answer may not have an error greater than 0.000001.\n\nConstraints\n\nJudge data includes at most 100 data sets.\n\nn ≤ 15\n\ns, t, b are distinct.\n\nSample Input\n\n1\nE A C\n1\nE B C\n2\nE A B\n0\n\nOutput for the Sample Input\n\n0.00000000\n0.25000000\n0.06250000", "sample_input": "1\nE A C\n1\nE B C\n2\nE A B\n0\n"}, "reference_outputs": ["0.00000000\n0.25000000\n0.06250000\n"], "source_document_id": "p00606", "source_text": "Problem B: Cleaning Robot\n\nDr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.\n\nAs shown in the following figure, his house has 9 rooms, where each room is identified by an alphabet:\n\nThe robot he developed operates as follows:\n\nIf the battery runs down, the robot stops.\n\nIf not so, the robot chooses a direction from four cardinal points with the equal probability, and moves to the room in that direction. Then, the robot clean the room and consumes 1 point of the battery.\n\nHowever, if there is no room in that direction, the robot does not move and remains the same room. In addition, there is a junk room in the house where the robot can not enter, and the robot also remains when it tries to enter the junk room. The robot also consumes 1 point of the battery when it remains the same place.\n\nA battery charger for the robot is in a room. It would be convenient for Dr. Asimov if the robot stops at the battery room when its battery run down.\n\nYour task is to write a program which computes the probability of the robot stopping at the battery room.\n\nInput\n\nThe input consists of several datasets. Each dataset consists of:\n\nn\ns t b\n\nn is an integer that indicates the initial battery point. s, t, b are alphabets respectively represent the room where the robot is initially, the battery room, and the junk room.\n\nThe input ends with a dataset which consists of single 0 for n. Your program should not output for this dataset.\n\nOutput\n\nFor each dataset, print the probability as a floating point number in a line. The answer may not have an error greater than 0.000001.\n\nConstraints\n\nJudge data includes at most 100 data sets.\n\nn ≤ 15\n\ns, t, b are distinct.\n\nSample Input\n\n1\nE A C\n1\nE B C\n2\nE A B\n0\n\nOutput for the Sample Input\n\n0.00000000\n0.25000000\n0.06250000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1536, "cpu_time_ms": 60, "memory_kb": 9428}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s725415976", "group_id": "codeNet:p00914", "input_text": " $n || $sum > $s) return 0;\n \n $res = 0;\n \n for ($i = $v + 1; $i <= $n; $i++) {\n $res += dfs($i, $count + 1, $sum + $i, $n, $k, $s);\n }\n\n return $res;\n}\n\nwhile (fscanf(STDIN, \"%d%d%d\", $n, $k, $s) && ($n | $k | $s)) {\n print dfs(0, 0, 0, $n, $k, $s) . \"\\n\";\n}", "language": "PHP", "metadata": {"date": 1415538094, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p00914.html", "problem_id": "p00914", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00914/input.txt", "sample_output_relpath": "derived/input_output/data/p00914/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00914/PHP/s725415976.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s725415976", "user_id": "u385322134"}, "prompt_components": {"gold_output": "1\n2\n0\n20\n1542\n5448\n1\n0\n0\n", "input_to_evaluate": " $n || $sum > $s) return 0;\n \n $res = 0;\n \n for ($i = $v + 1; $i <= $n; $i++) {\n $res += dfs($i, $count + 1, $sum + $i, $n, $k, $s);\n }\n\n return $res;\n}\n\nwhile (fscanf(STDIN, \"%d%d%d\", $n, $k, $s) && ($n | $k | $s)) {\n print dfs(0, 0, 0, $n, $k, $s) . \"\\n\";\n}", "problem_context": "Problem A: Equal Sum Sets\n\nLet us consider sets of positive integers less than or equal to n. Note that all elements of a set are different. Also note that the order of elements doesn't matter, that is, both {3, 5, 9} and {5, 9, 3} mean the same set.\n\nSpecifying the number of set elements and their sum to be k and s, respectively, sets satisfying the conditions are limited. When n = 9, k = 3 and s = 23, {6, 8, 9} is the only such set. There may be more than one such set, in general, however. When n = 9, k = 3 and s = 22, both {5, 8, 9} and {6, 7, 9} are possible.\n\nYou have to write a program that calculates the number of the sets that satisfy the given conditions.\n\nInput\n\nThe input consists of multiple datasets. The number of datasets does not exceed 100.\n\nEach of the datasets has three integers n, k and s in one line, separated by a space. You may assume 1 ≤ n ≤ 20, 1 ≤ k ≤ 10 and 1 ≤ s ≤ 155.\n\nThe end of the input is indicated by a line containing three zeros.\n\nOutput\n\nThe output for each dataset should be a line containing a single integer that gives the number of the sets that satisfy the conditions. No other characters should appear in the output.\n\nYou can assume that the number of sets does not exceed 231 - 1.\n\nSample Input\n\n9 3 23\n9 3 22\n10 3 28\n16 10 107\n20 8 102\n20 10 105\n20 10 155\n3 4 3\n4 2 11\n0 0 0\n\nOutput for the Sample Input\n\n1\n2\n0\n20\n1542\n5448\n1\n0\n0", "sample_input": "9 3 23\n9 3 22\n10 3 28\n16 10 107\n20 8 102\n20 10 105\n20 10 155\n3 4 3\n4 2 11\n0 0 0\n"}, "reference_outputs": ["1\n2\n0\n20\n1542\n5448\n1\n0\n0\n"], "source_document_id": "p00914", "source_text": "Problem A: Equal Sum Sets\n\nLet us consider sets of positive integers less than or equal to n. Note that all elements of a set are different. Also note that the order of elements doesn't matter, that is, both {3, 5, 9} and {5, 9, 3} mean the same set.\n\nSpecifying the number of set elements and their sum to be k and s, respectively, sets satisfying the conditions are limited. When n = 9, k = 3 and s = 23, {6, 8, 9} is the only such set. There may be more than one such set, in general, however. When n = 9, k = 3 and s = 22, both {5, 8, 9} and {6, 7, 9} are possible.\n\nYou have to write a program that calculates the number of the sets that satisfy the given conditions.\n\nInput\n\nThe input consists of multiple datasets. The number of datasets does not exceed 100.\n\nEach of the datasets has three integers n, k and s in one line, separated by a space. You may assume 1 ≤ n ≤ 20, 1 ≤ k ≤ 10 and 1 ≤ s ≤ 155.\n\nThe end of the input is indicated by a line containing three zeros.\n\nOutput\n\nThe output for each dataset should be a line containing a single integer that gives the number of the sets that satisfy the conditions. No other characters should appear in the output.\n\nYou can assume that the number of sets does not exceed 231 - 1.\n\nSample Input\n\n9 3 23\n9 3 22\n10 3 28\n16 10 107\n20 8 102\n20 10 105\n20 10 155\n3 4 3\n4 2 11\n0 0 0\n\nOutput for the Sample Input\n\n1\n2\n0\n20\n1542\n5448\n1\n0\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 406, "cpu_time_ms": 1670, "memory_kb": 6592}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s906262804", "group_id": "codeNet:p01101", "input_text": "=1;$i--){\n for($j=1;$j<$i;$j++){\n if($list[$i]-$list[$j]==$l){\n $sum++;\n }\n }\n }\n echo $sum.\"\\n\";\n}\n?>", "language": "PHP", "metadata": {"date": 1423345227, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p01314.html", "problem_id": "p01314", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01314/input.txt", "sample_output_relpath": "derived/input_output/data/p01314/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01314/PHP/s831695992.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s831695992", "user_id": "u802954168"}, "prompt_components": {"gold_output": "2\n3\n", "input_to_evaluate": "=1;$i--){\n for($j=1;$j<$i;$j++){\n if($list[$i]-$list[$j]==$l){\n $sum++;\n }\n }\n }\n echo $sum.\"\\n\";\n}\n?>", "problem_context": "Problem A: Sum of Consecutive Integers\n\nあなたは数か月に渡る受験戦争を勝ち抜き,晴れてICPC大学に入学することができた.入学手続きの日,大学のキャンパス内では熱狂的なサークルの勧誘活動が行われており,あなたは大量のパンフレットを受け取って帰ってきた.部屋に戻ってきたあなたは受け取ったパンフレットの中から気になる一枚を見つけた.そのパンフレットは大学の広報部から渡されたものだった.\n\nパンフレットには以下のような問題が記されていた.\n\n和が N となるような,連続する2つ以上の正の整数の組み合わせは,何組存在するでしょうか?例えば, 9 は 2+3+4 と 4+5 の 2通りの組み合わせがあります.\n\nこの問題の答えが気になったあなたは,プログラムを書いてその答えを調べることにした.したがって,あなたの仕事は,入力として与えられる正の整数 N に対して,問題の答えを出力するプログラムを書くことである.\n\nInput\n\n入力はデータセットの並びである.各データセットはひとつの整数 N からなる一行である.ここで 1 ≤ N ≤ 1000 である.\n\n入力の終りは,ひとつのゼロからなる一行で示される.\n\nOutput\n\n出力は,入力の各データセットの表す正の整数に対する問題の答えを,入力データセットの順序通りに並べたものである.それ以外の文字が出力にあってはならない.\n\nSample Input\n\n9\n500\n0\n\nOutput for the Sample Input\n\n2\n3", "sample_input": "9\n500\n0\n"}, "reference_outputs": ["2\n3\n"], "source_document_id": "p01314", "source_text": "Problem A: Sum of Consecutive Integers\n\nあなたは数か月に渡る受験戦争を勝ち抜き,晴れてICPC大学に入学することができた.入学手続きの日,大学のキャンパス内では熱狂的なサークルの勧誘活動が行われており,あなたは大量のパンフレットを受け取って帰ってきた.部屋に戻ってきたあなたは受け取ったパンフレットの中から気になる一枚を見つけた.そのパンフレットは大学の広報部から渡されたものだった.\n\nパンフレットには以下のような問題が記されていた.\n\n和が N となるような,連続する2つ以上の正の整数の組み合わせは,何組存在するでしょうか?例えば, 9 は 2+3+4 と 4+5 の 2通りの組み合わせがあります.\n\nこの問題の答えが気になったあなたは,プログラムを書いてその答えを調べることにした.したがって,あなたの仕事は,入力として与えられる正の整数 N に対して,問題の答えを出力するプログラムを書くことである.\n\nInput\n\n入力はデータセットの並びである.各データセットはひとつの整数 N からなる一行である.ここで 1 ≤ N ≤ 1000 である.\n\n入力の終りは,ひとつのゼロからなる一行で示される.\n\nOutput\n\n出力は,入力の各データセットの表す正の整数に対する問題の答えを,入力データセットの順序通りに並べたものである.それ以外の文字が出力にあってはならない.\n\nSample Input\n\n9\n500\n0\n\nOutput for the Sample Input\n\n2\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 354, "cpu_time_ms": 420, "memory_kb": 6740}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s234985204", "group_id": "codeNet:p01447", "input_text": "", "language": "PHP", "metadata": {"date": 1430168275, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p01447.html", "problem_id": "p01447", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01447/input.txt", "sample_output_relpath": "derived/input_output/data/p01447/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01447/PHP/s234985204.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s234985204", "user_id": "u802954168"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Problem A: 雅先生の地球侵略日誌\n\nクァークゴ帝国遠征軍は、地球侵略をもくろむ悪の組織である。彼らは侵略者の伝統にのっとり、日\n本の東京周辺をターゲットに、毎週1体のペースで怪人を送りこみ続けていた。しかし、そのたびに\n人類戦隊アースファイブと名乗る5人の戦士があらわれ、街で暴れまわっていた怪人はあっさりと倒\nされてしまうのであった。\n\nワルザード・スルー(地球名:源雅)は、そんな現状を本気で憂いている、クァークゴ帝国遠征軍の\n女幹部である。彼女は、毎週の敗北から何も学ぼうとしない司令官や、どこかズレた発明を繰り返す\n天才科学者らの下で、頭の痛い日々を過ごしていた。\n\nそんな中、次の作戦は吸血怪人ドラキュラスを日本に送りこむことに決まった。ドラキュラスは、血\nを吸った人間をドラキュラスに変えてしまう恐るべき怪人である。ドラキュラスに血を吸われた人間\nもまた、他の人間の血を吸って仲間のドラキュラスを増やしていく。こうして地球全土をドラキュラ\nスで埋めつくしてしまおうという作戦だ。\n\nこれを聞いたワルザードは、すぐに悟った。この作戦は、幼稚園バスの乗っ取りのような普段やって\nいるセコい作戦とは訳が違う。あのダメ司令官が立案したものにしては珍しく、本当に地球を征服で\nきる可能性を秘めていると。\n\n倍々ゲームの勢いは恐ろしい。地上に降りたったドラキュラスは、またたく間に仲間の数を増やして\nいった。このまま行けば地球侵略は目と鼻の先だと思われた。だがその瞬間、ワルザードの脳裏を、\n強烈にいやな予感が走り抜けた。まさか、この怪人、オリジナルが倒されると仲間も全滅するなんて\nことはないよな?\n\n慌ててドラキュラスを設計開発した科学者を問いつめたところ、やはりワルザードの危惧していた通\nりだった。オリジナルのドラキュラスがやられると、血を吸われた人間はすべて元に戻るように設計\nしてあるのだという。ふざけんなよ開発者。どうしてそんな余計な機能をつけた!\n\nワルザードは、開発担当者に飛び膝蹴りをきめると、すぐさまオリジナルの回収作業にとりかかっ\nた。いくらオリジナルと偽物は見た目がまったく同じだといっても、このままでは、駆けつけたアー\nスファイブに何かしらの理由でオリジナルを見抜かれて敗北するのが目に見えている。\n\n開発者の話によると、ドラキュラス化した人間の重さはすべて同じだが、オリジナルのドラキュラス\nはそれよりも少しだけ重いらしい。それならば、天秤ばかりを使えばオリジナルを見つけることがで\nきるはずだ。アースファイブがあらわれる前に、できるだけ早くオリジナルのドラキュラスを見つけ\nて回収しなければ。\n\nInput\n\nN\n\n入力の1行目には、整数 N(2 ≤ N ≤ 2,000,000,000)が書かれている。これは、オリジナルと偽物を合わせたドラキュラスの数をあらわす。\n\nOutput\n\n天秤ばかりを使ってN 体のドラキュラスの中から1体のオリジナルを見つけるには、最悪の場合で\nも天秤ばかりを何回使えれば十分か。その最小値を出力せよ。ただし、天秤ばかりの左と右の皿に、\nそれぞれ何体かのドラキュラスを乗せて重さを比較することを、1回とカウントする。\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nSample Input 2\n\n30\n\nSample Output 2\n\n4\n\nSample Input 3\n\n2000000000\n\nSample Output 3\n\n20", "sample_input": "8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p01447", "source_text": "Problem A: 雅先生の地球侵略日誌\n\nクァークゴ帝国遠征軍は、地球侵略をもくろむ悪の組織である。彼らは侵略者の伝統にのっとり、日\n本の東京周辺をターゲットに、毎週1体のペースで怪人を送りこみ続けていた。しかし、そのたびに\n人類戦隊アースファイブと名乗る5人の戦士があらわれ、街で暴れまわっていた怪人はあっさりと倒\nされてしまうのであった。\n\nワルザード・スルー(地球名:源雅)は、そんな現状を本気で憂いている、クァークゴ帝国遠征軍の\n女幹部である。彼女は、毎週の敗北から何も学ぼうとしない司令官や、どこかズレた発明を繰り返す\n天才科学者らの下で、頭の痛い日々を過ごしていた。\n\nそんな中、次の作戦は吸血怪人ドラキュラスを日本に送りこむことに決まった。ドラキュラスは、血\nを吸った人間をドラキュラスに変えてしまう恐るべき怪人である。ドラキュラスに血を吸われた人間\nもまた、他の人間の血を吸って仲間のドラキュラスを増やしていく。こうして地球全土をドラキュラ\nスで埋めつくしてしまおうという作戦だ。\n\nこれを聞いたワルザードは、すぐに悟った。この作戦は、幼稚園バスの乗っ取りのような普段やって\nいるセコい作戦とは訳が違う。あのダメ司令官が立案したものにしては珍しく、本当に地球を征服で\nきる可能性を秘めていると。\n\n倍々ゲームの勢いは恐ろしい。地上に降りたったドラキュラスは、またたく間に仲間の数を増やして\nいった。このまま行けば地球侵略は目と鼻の先だと思われた。だがその瞬間、ワルザードの脳裏を、\n強烈にいやな予感が走り抜けた。まさか、この怪人、オリジナルが倒されると仲間も全滅するなんて\nことはないよな?\n\n慌ててドラキュラスを設計開発した科学者を問いつめたところ、やはりワルザードの危惧していた通\nりだった。オリジナルのドラキュラスがやられると、血を吸われた人間はすべて元に戻るように設計\nしてあるのだという。ふざけんなよ開発者。どうしてそんな余計な機能をつけた!\n\nワルザードは、開発担当者に飛び膝蹴りをきめると、すぐさまオリジナルの回収作業にとりかかっ\nた。いくらオリジナルと偽物は見た目がまったく同じだといっても、このままでは、駆けつけたアー\nスファイブに何かしらの理由でオリジナルを見抜かれて敗北するのが目に見えている。\n\n開発者の話によると、ドラキュラス化した人間の重さはすべて同じだが、オリジナルのドラキュラス\nはそれよりも少しだけ重いらしい。それならば、天秤ばかりを使えばオリジナルを見つけることがで\nきるはずだ。アースファイブがあらわれる前に、できるだけ早くオリジナルのドラキュラスを見つけ\nて回収しなければ。\n\nInput\n\nN\n\n入力の1行目には、整数 N(2 ≤ N ≤ 2,000,000,000)が書かれている。これは、オリジナルと偽物を合わせたドラキュラスの数をあらわす。\n\nOutput\n\n天秤ばかりを使ってN 体のドラキュラスの中から1体のオリジナルを見つけるには、最悪の場合で\nも天秤ばかりを何回使えれば十分か。その最小値を出力せよ。ただし、天秤ばかりの左と右の皿に、\nそれぞれ何体かのドラキュラスを乗せて重さを比較することを、1回とカウントする。\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nSample Input 2\n\n30\n\nSample Output 2\n\n4\n\nSample Input 3\n\n2000000000\n\nSample Output 3\n\n20", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 62, "cpu_time_ms": 10, "memory_kb": 6556}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s574627121", "group_id": "codeNet:p02255", "input_text": "= 0 && $A[$j] > $v) {\n\t\t$A[$j+1] = $A[$j];\n\t\t$j--;\n\t}\n\t$A[$j+1] = $v;\n\techo implode(\" \",$A),PHP_EOL;\n}\n?>", "language": "PHP", "metadata": {"date": 1479171774, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02255.html", "problem_id": "p02255", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02255/input.txt", "sample_output_relpath": "derived/input_output/data/p02255/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02255/PHP/s574627121.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s574627121", "user_id": "u428229577"}, "prompt_components": {"gold_output": "5 2 4 6 1 3\n2 5 4 6 1 3\n2 4 5 6 1 3\n2 4 5 6 1 3\n1 2 4 5 6 3\n1 2 3 4 5 6\n", "input_to_evaluate": "= 0 && $A[$j] > $v) {\n\t\t$A[$j+1] = $A[$j];\n\t\t$j--;\n\t}\n\t$A[$j+1] = $v;\n\techo implode(\" \",$A),PHP_EOL;\n}\n?>", "problem_context": "Insertion Sort\n\nWrite a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:\n\nfor i = 1 to A.length-1\nkey = A[i]\n/* insert A[i] into the sorted sequence A[0,...,j-1] */\nj = i - 1\nwhile j >= 0 and A[j] > key\nA[j+1] = A[j]\nj--\nA[j+1] = key\n\nNote that, indices for array elements are based on 0-origin.\n\nTo illustrate the algorithms, your program should trace intermediate result for each step.\n\nInput\n\nThe first line of the input includes an integer N, the number of elements in the sequence.\n\nIn the second line, N elements of the sequence are given separated by a single space.\n\nOutput\n\nThe output consists of N lines. Please output the intermediate sequence in a line for each step. Elements of the sequence should be separated by single space.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nSample Input 1\n\n6\n5 2 4 6 1 3\n\nSample Output 1\n\n5 2 4 6 1 3\n2 5 4 6 1 3\n2 4 5 6 1 3\n2 4 5 6 1 3\n1 2 4 5 6 3\n1 2 3 4 5 6\n\nSample Input 2\n\n3\n1 2 3\n\nSample Output 2\n\n1 2 3\n1 2 3\n1 2 3\n\nHint\n\nTemplate in C", "sample_input": "6\n5 2 4 6 1 3\n"}, "reference_outputs": ["5 2 4 6 1 3\n2 5 4 6 1 3\n2 4 5 6 1 3\n2 4 5 6 1 3\n1 2 4 5 6 3\n1 2 3 4 5 6\n"], "source_document_id": "p02255", "source_text": "Insertion Sort\n\nWrite a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:\n\nfor i = 1 to A.length-1\nkey = A[i]\n/* insert A[i] into the sorted sequence A[0,...,j-1] */\nj = i - 1\nwhile j >= 0 and A[j] > key\nA[j+1] = A[j]\nj--\nA[j+1] = key\n\nNote that, indices for array elements are based on 0-origin.\n\nTo illustrate the algorithms, your program should trace intermediate result for each step.\n\nInput\n\nThe first line of the input includes an integer N, the number of elements in the sequence.\n\nIn the second line, N elements of the sequence are given separated by a single space.\n\nOutput\n\nThe output consists of N lines. Please output the intermediate sequence in a line for each step. Elements of the sequence should be separated by single space.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nSample Input 1\n\n6\n5 2 4 6 1 3\n\nSample Output 1\n\n5 2 4 6 1 3\n2 5 4 6 1 3\n2 4 5 6 1 3\n2 4 5 6 1 3\n1 2 4 5 6 3\n1 2 3 4 5 6\n\nSample Input 2\n\n3\n1 2 3\n\nSample Output 2\n\n1 2 3\n1 2 3\n1 2 3\n\nHint\n\nTemplate in C", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 276, "cpu_time_ms": 10, "memory_kb": 15460}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s674253198", "group_id": "codeNet:p02257", "input_text": "isPrime($num)) $count++;\n }\n\n echo $count . PHP_EOL;\n }\n}\n\nclass CheckPrimeNumber extends Caluculate {\n\n public function isPrime($num) {\n\n if ($num == 2) {\n return true;\n } elseif ( $num < 2 or $num % 2 == 0) {\n return false;\n } else {\n $start = 3;\n while ($start <= sqrt($num) + 1) {\n if ($num % $start == 0) {\n return false;\n }\n $start += 2;\n }\n return true;\n }\n }\n}\n\n$rate = new CheckPrimeNumber();\n$rate->getAnswer();\n\n", "language": "PHP", "metadata": {"date": 1540742192, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02257.html", "problem_id": "p02257", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02257/input.txt", "sample_output_relpath": "derived/input_output/data/p02257/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02257/PHP/s674253198.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s674253198", "user_id": "u885258297"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "isPrime($num)) $count++;\n }\n\n echo $count . PHP_EOL;\n }\n}\n\nclass CheckPrimeNumber extends Caluculate {\n\n public function isPrime($num) {\n\n if ($num == 2) {\n return true;\n } elseif ( $num < 2 or $num % 2 == 0) {\n return false;\n } else {\n $start = 3;\n while ($start <= sqrt($num) + 1) {\n if ($num % $start == 0) {\n return false;\n }\n $start += 2;\n }\n return true;\n }\n }\n}\n\n$rate = new CheckPrimeNumber();\n$rate->getAnswer();\n\n", "problem_context": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "sample_input": "5\n2\n3\n4\n5\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02257", "source_text": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 819, "cpu_time_ms": 270, "memory_kb": 9316}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s883005008", "group_id": "codeNet:p02257", "input_text": "isPrime($num)) {\n $count++;\n }\n }\n\n echo $count . PHP_EOL;\n }\n}\n\nclass CheckPrimeNumbers extends CalculateSum {\n\n public function isPrime($num)\n {\n if ($num == 2) {\n return true;\n } elseif ( $num < 2 or $num % 2 == 0) {\n return false;\n } else {\n $start = 3;\n while ($start <= sqrt($num)) {\n if ($num % $start == 0) {\n return false;\n }\n $start += 2;\n }\n return true;\n }\n }\n}\n\n$rate = new CheckPrimeNumbers();\n$rate->getAnswer();\n\n", "language": "PHP", "metadata": {"date": 1540777480, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02257.html", "problem_id": "p02257", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02257/input.txt", "sample_output_relpath": "derived/input_output/data/p02257/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02257/PHP/s883005008.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s883005008", "user_id": "u885258297"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "isPrime($num)) {\n $count++;\n }\n }\n\n echo $count . PHP_EOL;\n }\n}\n\nclass CheckPrimeNumbers extends CalculateSum {\n\n public function isPrime($num)\n {\n if ($num == 2) {\n return true;\n } elseif ( $num < 2 or $num % 2 == 0) {\n return false;\n } else {\n $start = 3;\n while ($start <= sqrt($num)) {\n if ($num % $start == 0) {\n return false;\n }\n $start += 2;\n }\n return true;\n }\n }\n}\n\n$rate = new CheckPrimeNumbers();\n$rate->getAnswer();\n\n", "problem_context": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "sample_input": "5\n2\n3\n4\n5\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02257", "source_text": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 861, "cpu_time_ms": 260, "memory_kb": 9316}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s818141958", "group_id": "codeNet:p02258", "input_text": "", "language": "PHP", "metadata": {"date": 1441194232, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02258.html", "problem_id": "p02258", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02258/input.txt", "sample_output_relpath": "derived/input_output/data/p02258/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02258/PHP/s818141958.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s818141958", "user_id": "u604774382"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "sample_input": "6\n5\n3\n1\n3\n4\n3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02258", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 349, "cpu_time_ms": 200, "memory_kb": 44436}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s685238978", "group_id": "codeNet:p02261", "input_text": "$i; --$j) {\n if ($arr[$j][1] < $arr[$j-1][1]) {\n $tmp = $arr[$j];\n $arr[$j] = $arr[$j - 1];\n $arr[$j - 1] = $tmp;\n }\n }\n }\n\n return $arr;\n}\n\nfunction SelectionSort($arr, $N){\n for ($i=0; $i<$N; ++$i){\n $mini = $i;\n for ($j=$i; $j<$N; ++$j){\n if ($arr[$j][1] < $arr[$mini][1]){\n $mini = $j;\n }\n }\n if($mini!=$i){\n $tmp = $arr[$i];\n $arr[$i] = $arr[$mini];\n $arr[$mini] = $tmp;\n }\n }\n return $arr;\n}\n\nfunction isStable($bubbleArr, $selectionArr){\n $result = array_diff_assoc($bubbleArr, $selectionArr);\n if(count($result)==0){\n echo(\"Stable\".PHP_EOL);\n } else {\n echo(\"Not stable\".PHP_EOL);\n }\n}\n", "language": "PHP", "metadata": {"date": 1546420471, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02261.html", "problem_id": "p02261", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02261/input.txt", "sample_output_relpath": "derived/input_output/data/p02261/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02261/PHP/s685238978.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s685238978", "user_id": "u312681524"}, "prompt_components": {"gold_output": "D2 C3 H4 S4 C9\nStable\nD2 C3 S4 H4 C9\nNot stable\n", "input_to_evaluate": "$i; --$j) {\n if ($arr[$j][1] < $arr[$j-1][1]) {\n $tmp = $arr[$j];\n $arr[$j] = $arr[$j - 1];\n $arr[$j - 1] = $tmp;\n }\n }\n }\n\n return $arr;\n}\n\nfunction SelectionSort($arr, $N){\n for ($i=0; $i<$N; ++$i){\n $mini = $i;\n for ($j=$i; $j<$N; ++$j){\n if ($arr[$j][1] < $arr[$mini][1]){\n $mini = $j;\n }\n }\n if($mini!=$i){\n $tmp = $arr[$i];\n $arr[$i] = $arr[$mini];\n $arr[$mini] = $tmp;\n }\n }\n return $arr;\n}\n\nfunction isStable($bubbleArr, $selectionArr){\n $result = array_diff_assoc($bubbleArr, $selectionArr);\n if(count($result)==0){\n echo(\"Stable\".PHP_EOL);\n } else {\n echo(\"Not stable\".PHP_EOL);\n }\n}\n", "problem_context": "Stable Sort\n\nLet's arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, ... 9). For example, 'eight of heart' is represented by H8 and 'one of diamonds' is represented by D1.\n\nYour task is to write a program which sorts a given set of cards in ascending order by their values using the Bubble Sort algorithms and the Selection Sort algorithm respectively. These algorithms should be based on the following pseudocode:\n\nBubbleSort(C)\n1 for i = 0 to C.length-1\n2 for j = C.length-1 downto i+1\n3 if C[j].value < C[j-1].value\n4 swap C[j] and C[j-1]\n\nSelectionSort(C)\n1 for i = 0 to C.length-1\n2 mini = i\n3 for j = i to C.length-1\n4 if C[j].value < C[mini].value\n5 mini = j\n6 swap C[i] and C[mini]\n\nNote that, indices for array elements are based on 0-origin.\n\nFor each algorithm, report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).\n\nInput\n\nThe first line contains an integer N, the number of cards.\n\nN cards are given in the following line. Each card is represented by two characters. Two consecutive cards are separated by a space character.\n\nOutput\n\nIn the first line, print the arranged cards provided by the Bubble Sort algorithm. Two consecutive cards should be separated by a space character.\n\nIn the second line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nIn the third line, print the arranged cards provided by the Selection Sort algorithm. Two consecutive cards should be separated by a space character.\n\nIn the fourth line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nConstraints\n\n1 ≤ N ≤ 36\n\nSample Input 1\n\n5\nH4 C9 S4 D2 C3\n\nSample Output 1\n\nD2 C3 H4 S4 C9\nStable\nD2 C3 S4 H4 C9\nNot stable\n\nSample Input 2\n\n2\nS1 H1\n\nSample Output 2\n\nS1 H1\nStable\nS1 H1\nStable", "sample_input": "5\nH4 C9 S4 D2 C3\n"}, "reference_outputs": ["D2 C3 H4 S4 C9\nStable\nD2 C3 S4 H4 C9\nNot stable\n"], "source_document_id": "p02261", "source_text": "Stable Sort\n\nLet's arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, ... 9). For example, 'eight of heart' is represented by H8 and 'one of diamonds' is represented by D1.\n\nYour task is to write a program which sorts a given set of cards in ascending order by their values using the Bubble Sort algorithms and the Selection Sort algorithm respectively. These algorithms should be based on the following pseudocode:\n\nBubbleSort(C)\n1 for i = 0 to C.length-1\n2 for j = C.length-1 downto i+1\n3 if C[j].value < C[j-1].value\n4 swap C[j] and C[j-1]\n\nSelectionSort(C)\n1 for i = 0 to C.length-1\n2 mini = i\n3 for j = i to C.length-1\n4 if C[j].value < C[mini].value\n5 mini = j\n6 swap C[i] and C[mini]\n\nNote that, indices for array elements are based on 0-origin.\n\nFor each algorithm, report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).\n\nInput\n\nThe first line contains an integer N, the number of cards.\n\nN cards are given in the following line. Each card is represented by two characters. Two consecutive cards are separated by a space character.\n\nOutput\n\nIn the first line, print the arranged cards provided by the Bubble Sort algorithm. Two consecutive cards should be separated by a space character.\n\nIn the second line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nIn the third line, print the arranged cards provided by the Selection Sort algorithm. Two consecutive cards should be separated by a space character.\n\nIn the fourth line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nConstraints\n\n1 ≤ N ≤ 36\n\nSample Input 1\n\n5\nH4 C9 S4 D2 C3\n\nSample Output 1\n\nD2 C3 H4 S4 C9\nStable\nD2 C3 S4 H4 C9\nNot stable\n\nSample Input 2\n\n2\nS1 H1\n\nSample Output 2\n\nS1 H1\nStable\nS1 H1\nStable", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1203, "cpu_time_ms": 10, "memory_kb": 9300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s557979777", "group_id": "codeNet:p02263", "input_text": "top = 0;\n $data = trim(fgets(STDIN));\n $this->data_arr = explode(' ', $data);\n }\n\n public function isEmpty()\n {\n return $this->top == 0;\n }\n\n public function isFull()\n {\n return $this->top > 10**6 - 1;\n }\n\n public function push($data)\n {\n if ($this->isFull()) {\n echo 'overflow';\n }\n\n $this->top++;\n $this->data_stacked[$this->top] = $data;\n }\n\n public function pop()\n {\n if ($this->isEmpty()) {\n echo 'underflow';\n }\n\n $this->top--;\n return $this->data_stacked[$this->top + 1];\n }\n \n public function getAnswer()\n {\n $data_arr = $this->data_arr;\n while (current($data_arr) != false) {\n if ($data_arr[key($data_arr)] == \"+\") {\n $tmp = $this->pop();\n $this->data_stacked[$this->top] = $this->data_stacked[$this->top] + $tmp;\n } elseif ($data_arr[key($data_arr)] == \"-\") {\n $tmp = $this->pop();\n $this->data_stacked[$this->top] = $this->data_stacked[$this->top] - $tmp;\n } elseif ($data_arr[key($data_arr)] == \"*\") {\n $tmp = $this->pop();\n $this->data_stacked[$this->top] = $this->data_stacked[$this->top] * $tmp;\n } else {\n $this->push($data_arr[key($data_arr)]);\n }\n\n next($data_arr);\n }\n echo $this->data_stacked[1] . \"\\n\";\n }\n}\n\n$answer = new Answer();\n$answer->getAnswer();\n\n", "language": "PHP", "metadata": {"date": 1544371996, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02263.html", "problem_id": "p02263", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02263/input.txt", "sample_output_relpath": "derived/input_output/data/p02263/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02263/PHP/s557979777.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s557979777", "user_id": "u885258297"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "top = 0;\n $data = trim(fgets(STDIN));\n $this->data_arr = explode(' ', $data);\n }\n\n public function isEmpty()\n {\n return $this->top == 0;\n }\n\n public function isFull()\n {\n return $this->top > 10**6 - 1;\n }\n\n public function push($data)\n {\n if ($this->isFull()) {\n echo 'overflow';\n }\n\n $this->top++;\n $this->data_stacked[$this->top] = $data;\n }\n\n public function pop()\n {\n if ($this->isEmpty()) {\n echo 'underflow';\n }\n\n $this->top--;\n return $this->data_stacked[$this->top + 1];\n }\n \n public function getAnswer()\n {\n $data_arr = $this->data_arr;\n while (current($data_arr) != false) {\n if ($data_arr[key($data_arr)] == \"+\") {\n $tmp = $this->pop();\n $this->data_stacked[$this->top] = $this->data_stacked[$this->top] + $tmp;\n } elseif ($data_arr[key($data_arr)] == \"-\") {\n $tmp = $this->pop();\n $this->data_stacked[$this->top] = $this->data_stacked[$this->top] - $tmp;\n } elseif ($data_arr[key($data_arr)] == \"*\") {\n $tmp = $this->pop();\n $this->data_stacked[$this->top] = $this->data_stacked[$this->top] * $tmp;\n } else {\n $this->push($data_arr[key($data_arr)]);\n }\n\n next($data_arr);\n }\n echo $this->data_stacked[1] . \"\\n\";\n }\n}\n\n$answer = new Answer();\n$answer->getAnswer();\n\n", "problem_context": "Reverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages of the Reverse Polish notation is that it is parenthesis-free.\n\nWrite a program which reads an expression in the Reverse Polish notation and prints the computational result.\n\nAn expression in the Reverse Polish notation is calculated using a stack. To evaluate the expression, the program should read symbols in order. If the symbol is an operand, the corresponding value should be pushed into the stack. On the other hand, if the symbols is an operator, the program should pop two elements from the stack, perform the corresponding operations, then push the result in to the stack. The program should repeat this operations.\n\nInput\n\nAn expression is given in a line. Two consequtive symbols (operand or operator) are separated by a space character.\n\nYou can assume that +, - and * are given as the operator and an operand is a positive integer less than 106\n\nOutput\n\nPrint the computational result in a line.\n\nConstraints\n\n2 ≤ the number of operands in the expression ≤ 100\n\n1 ≤ the number of operators in the expression ≤ 99\n\n-1 × 109 ≤ values in the stack ≤ 109\n\nSample Input 1\n\n1 2 +\n\nSample Output 1\n\n3\n\nSample Input 2\n\n1 2 + 3 4 - *\n\nSample Output 2\n\n-3\n\nNotes\n\nTemplate in C", "sample_input": "1 2 +\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02263", "source_text": "Reverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages of the Reverse Polish notation is that it is parenthesis-free.\n\nWrite a program which reads an expression in the Reverse Polish notation and prints the computational result.\n\nAn expression in the Reverse Polish notation is calculated using a stack. To evaluate the expression, the program should read symbols in order. If the symbol is an operand, the corresponding value should be pushed into the stack. On the other hand, if the symbols is an operator, the program should pop two elements from the stack, perform the corresponding operations, then push the result in to the stack. The program should repeat this operations.\n\nInput\n\nAn expression is given in a line. Two consequtive symbols (operand or operator) are separated by a space character.\n\nYou can assume that +, - and * are given as the operator and an operand is a positive integer less than 106\n\nOutput\n\nPrint the computational result in a line.\n\nConstraints\n\n2 ≤ the number of operands in the expression ≤ 100\n\n1 ≤ the number of operators in the expression ≤ 99\n\n-1 × 109 ≤ values in the stack ≤ 109\n\nSample Input 1\n\n1 2 +\n\nSample Output 1\n\n3\n\nSample Input 2\n\n1 2 + 3 4 - *\n\nSample Output 2\n\n-3\n\nNotes\n\nTemplate in C", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1685, "cpu_time_ms": 10, "memory_kb": 9420}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s296447684", "group_id": "codeNet:p02265", "input_text": "n_processes);\n while ($this->n_processes > 0) {\n fscanf(STDIN, \"%s %d\", $operation, $key);\n $this->doOperation($operation, $key);\n $this->n_processes -= 1;\n }\n }\n\n public function doOperation($operation, $key)\n {\n switch ($operation) {\n case 'insert':\n array_unshift($this->queue, $key);\n break;\n case 'delete':\n unset($this->queue[array_search($key, $this->queue)]);\n break;\n case 'deleteFirst':\n unset($this->queue[0]);\n break;\n case 'deleteLast':\n array_pop($this->queue);\n break;\n }\n }\n\n public function getAnswer()\n {\n // echo implode(' ', $this->queue) . \"\\n\";\n echo implode(' ', array_map('intval', $this->queue)) . \"\\n\";\n }\n}\n\n$answer = new Simulator();\n$answer->getAnswer();\n\n", "language": "PHP", "metadata": {"date": 1545667217, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02265.html", "problem_id": "p02265", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02265/input.txt", "sample_output_relpath": "derived/input_output/data/p02265/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02265/PHP/s296447684.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s296447684", "user_id": "u885258297"}, "prompt_components": {"gold_output": "6 1 2\n", "input_to_evaluate": "n_processes);\n while ($this->n_processes > 0) {\n fscanf(STDIN, \"%s %d\", $operation, $key);\n $this->doOperation($operation, $key);\n $this->n_processes -= 1;\n }\n }\n\n public function doOperation($operation, $key)\n {\n switch ($operation) {\n case 'insert':\n array_unshift($this->queue, $key);\n break;\n case 'delete':\n unset($this->queue[array_search($key, $this->queue)]);\n break;\n case 'deleteFirst':\n unset($this->queue[0]);\n break;\n case 'deleteLast':\n array_pop($this->queue);\n break;\n }\n }\n\n public function getAnswer()\n {\n // echo implode(' ', $this->queue) . \"\\n\";\n echo implode(' ', array_map('intval', $this->queue)) . \"\\n\";\n }\n}\n\n$answer = new Simulator();\n$answer->getAnswer();\n\n", "problem_context": "Doubly Linked List\n\nYour task is to implement a double linked list.\n\nWrite a program which performs the following operations:\n\ninsert x: insert an element with key x into the front of the list.\n\ndelete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything.\n\ndeleteFirst: delete the first element from the list.\n\ndeleteLast: delete the last element from the list.\n\nInput\n\nThe input is given in the following format:\n\nn\n\ncommand1\n\ncommand2\n\n...\n\ncommandn\n\nIn the first line, the number of operations n is given. In the following n lines, the above mentioned operations are given in the following format:\n\ninsert x\n\ndelete x\n\ndeleteFirst\n\ndeleteLast\n\nOutput\n\nPrint all the element (key) in the list after the given operations. Two consequtive keys should be separated by a single space.\n\nConstraints\n\nThe number of operations ≤ 2,000,000\n\nThe number of delete operations ≤ 20\n\n0 ≤ value of a key ≤ 109\n\nThe number of elements in the list does not exceed 106\n\nFor a delete, deleteFirst or deleteLast operation, there is at least one element in the list.\n\nSample Input 1\n\n7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n\nSample Output 1\n\n6 1 2\n\nSample Input 2\n\n9\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast\n\nSample Output 2\n\n1", "sample_input": "7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n"}, "reference_outputs": ["6 1 2\n"], "source_document_id": "p02265", "source_text": "Doubly Linked List\n\nYour task is to implement a double linked list.\n\nWrite a program which performs the following operations:\n\ninsert x: insert an element with key x into the front of the list.\n\ndelete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything.\n\ndeleteFirst: delete the first element from the list.\n\ndeleteLast: delete the last element from the list.\n\nInput\n\nThe input is given in the following format:\n\nn\n\ncommand1\n\ncommand2\n\n...\n\ncommandn\n\nIn the first line, the number of operations n is given. In the following n lines, the above mentioned operations are given in the following format:\n\ninsert x\n\ndelete x\n\ndeleteFirst\n\ndeleteLast\n\nOutput\n\nPrint all the element (key) in the list after the given operations. Two consequtive keys should be separated by a single space.\n\nConstraints\n\nThe number of operations ≤ 2,000,000\n\nThe number of delete operations ≤ 20\n\n0 ≤ value of a key ≤ 109\n\nThe number of elements in the list does not exceed 106\n\nFor a delete, deleteFirst or deleteLast operation, there is at least one element in the list.\n\nSample Input 1\n\n7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n\nSample Output 1\n\n6 1 2\n\nSample Input 2\n\n9\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1121, "cpu_time_ms": 10, "memory_kb": 9344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s015202187", "group_id": "codeNet:p02265", "input_text": "n_processes);\n while ($this->n_processes > 0) {\n fscanf(STDIN, \"%s %d\", $operation, $key);\n $this->doOperation($operation, $key);\n $this->n_processes -= 1;\n }\n }\n\n public function doOperation($operation, $key)\n {\n switch ($operation) {\n case 'insert':\n array_unshift($this->queue, $key);\n break;\n case 'delete':\n unset($this->queue[array_search($key, $this->queue)]);\n break;\n case 'deleteFirst':\n unset($this->queue[0]);\n break;\n case 'deleteLast':\n array_pop($this->queue);\n break;\n }\n }\n\n public function getAnswer()\n {\n // var_dump(array_values($this->queue));\n echo implode(' ', array_values($this->queue)) . \"\\n\";\n }\n}\n\n$answer = new Simulator();\n$answer->getAnswer();\n\n", "language": "PHP", "metadata": {"date": 1545670520, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02265.html", "problem_id": "p02265", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02265/input.txt", "sample_output_relpath": "derived/input_output/data/p02265/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02265/PHP/s015202187.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s015202187", "user_id": "u885258297"}, "prompt_components": {"gold_output": "6 1 2\n", "input_to_evaluate": "n_processes);\n while ($this->n_processes > 0) {\n fscanf(STDIN, \"%s %d\", $operation, $key);\n $this->doOperation($operation, $key);\n $this->n_processes -= 1;\n }\n }\n\n public function doOperation($operation, $key)\n {\n switch ($operation) {\n case 'insert':\n array_unshift($this->queue, $key);\n break;\n case 'delete':\n unset($this->queue[array_search($key, $this->queue)]);\n break;\n case 'deleteFirst':\n unset($this->queue[0]);\n break;\n case 'deleteLast':\n array_pop($this->queue);\n break;\n }\n }\n\n public function getAnswer()\n {\n // var_dump(array_values($this->queue));\n echo implode(' ', array_values($this->queue)) . \"\\n\";\n }\n}\n\n$answer = new Simulator();\n$answer->getAnswer();\n\n", "problem_context": "Doubly Linked List\n\nYour task is to implement a double linked list.\n\nWrite a program which performs the following operations:\n\ninsert x: insert an element with key x into the front of the list.\n\ndelete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything.\n\ndeleteFirst: delete the first element from the list.\n\ndeleteLast: delete the last element from the list.\n\nInput\n\nThe input is given in the following format:\n\nn\n\ncommand1\n\ncommand2\n\n...\n\ncommandn\n\nIn the first line, the number of operations n is given. In the following n lines, the above mentioned operations are given in the following format:\n\ninsert x\n\ndelete x\n\ndeleteFirst\n\ndeleteLast\n\nOutput\n\nPrint all the element (key) in the list after the given operations. Two consequtive keys should be separated by a single space.\n\nConstraints\n\nThe number of operations ≤ 2,000,000\n\nThe number of delete operations ≤ 20\n\n0 ≤ value of a key ≤ 109\n\nThe number of elements in the list does not exceed 106\n\nFor a delete, deleteFirst or deleteLast operation, there is at least one element in the list.\n\nSample Input 1\n\n7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n\nSample Output 1\n\n6 1 2\n\nSample Input 2\n\n9\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast\n\nSample Output 2\n\n1", "sample_input": "7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n"}, "reference_outputs": ["6 1 2\n"], "source_document_id": "p02265", "source_text": "Doubly Linked List\n\nYour task is to implement a double linked list.\n\nWrite a program which performs the following operations:\n\ninsert x: insert an element with key x into the front of the list.\n\ndelete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything.\n\ndeleteFirst: delete the first element from the list.\n\ndeleteLast: delete the last element from the list.\n\nInput\n\nThe input is given in the following format:\n\nn\n\ncommand1\n\ncommand2\n\n...\n\ncommandn\n\nIn the first line, the number of operations n is given. In the following n lines, the above mentioned operations are given in the following format:\n\ninsert x\n\ndelete x\n\ndeleteFirst\n\ndeleteLast\n\nOutput\n\nPrint all the element (key) in the list after the given operations. Two consequtive keys should be separated by a single space.\n\nConstraints\n\nThe number of operations ≤ 2,000,000\n\nThe number of delete operations ≤ 20\n\n0 ≤ value of a key ≤ 109\n\nThe number of elements in the list does not exceed 106\n\nFor a delete, deleteFirst or deleteLast operation, there is at least one element in the list.\n\nSample Input 1\n\n7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n\nSample Output 1\n\n6 1 2\n\nSample Input 2\n\n9\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1112, "cpu_time_ms": 10, "memory_kb": 9336}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s748151838", "group_id": "codeNet:p02265", "input_text": "operations_count);\n $this->operated_keys = new \\SplDoublyLinkedList();\n for (;$this->operations_count > 0;$this->operations_count -= 1) {\n $operation = explode(' ', trim(fgets(STDIN)));\n if ($operation[0] === 'insert') {\n $this->operated_keys->unshift($operation[1]);\n } elseif ($operation[0] === 'deleteFirst') {\n $this->operated_keys->shift();\n } elseif ($operation[0] === 'deleteLast') {\n $this->operated_keys->pop();\n } elseif ($operation[0] === 'delete') {\n foreach ($this->operated_keys as $key => $element) {\n if ($element === $operation[1]) {\n $this->operated_keys->offsetUnset($key);\n break;\n }\n }\n }\n }\n }\n\n public function getAnswer()\n {\n $keys_operated = array();\n\n while (count($this->operated_keys) > 0) {\n $keys_operated[] = $this->operated_keys->shift();\n }\n echo implode(' ', $keys_operated), PHP_EOL;\n }\n}\n\n$operator = new Operator();\n$operator->doOperations();\n$operator->getAnswer();\n\n", "language": "PHP", "metadata": {"date": 1545920827, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02265.html", "problem_id": "p02265", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02265/input.txt", "sample_output_relpath": "derived/input_output/data/p02265/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02265/PHP/s748151838.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s748151838", "user_id": "u885258297"}, "prompt_components": {"gold_output": "6 1 2\n", "input_to_evaluate": "operations_count);\n $this->operated_keys = new \\SplDoublyLinkedList();\n for (;$this->operations_count > 0;$this->operations_count -= 1) {\n $operation = explode(' ', trim(fgets(STDIN)));\n if ($operation[0] === 'insert') {\n $this->operated_keys->unshift($operation[1]);\n } elseif ($operation[0] === 'deleteFirst') {\n $this->operated_keys->shift();\n } elseif ($operation[0] === 'deleteLast') {\n $this->operated_keys->pop();\n } elseif ($operation[0] === 'delete') {\n foreach ($this->operated_keys as $key => $element) {\n if ($element === $operation[1]) {\n $this->operated_keys->offsetUnset($key);\n break;\n }\n }\n }\n }\n }\n\n public function getAnswer()\n {\n $keys_operated = array();\n\n while (count($this->operated_keys) > 0) {\n $keys_operated[] = $this->operated_keys->shift();\n }\n echo implode(' ', $keys_operated), PHP_EOL;\n }\n}\n\n$operator = new Operator();\n$operator->doOperations();\n$operator->getAnswer();\n\n", "problem_context": "Doubly Linked List\n\nYour task is to implement a double linked list.\n\nWrite a program which performs the following operations:\n\ninsert x: insert an element with key x into the front of the list.\n\ndelete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything.\n\ndeleteFirst: delete the first element from the list.\n\ndeleteLast: delete the last element from the list.\n\nInput\n\nThe input is given in the following format:\n\nn\n\ncommand1\n\ncommand2\n\n...\n\ncommandn\n\nIn the first line, the number of operations n is given. In the following n lines, the above mentioned operations are given in the following format:\n\ninsert x\n\ndelete x\n\ndeleteFirst\n\ndeleteLast\n\nOutput\n\nPrint all the element (key) in the list after the given operations. Two consequtive keys should be separated by a single space.\n\nConstraints\n\nThe number of operations ≤ 2,000,000\n\nThe number of delete operations ≤ 20\n\n0 ≤ value of a key ≤ 109\n\nThe number of elements in the list does not exceed 106\n\nFor a delete, deleteFirst or deleteLast operation, there is at least one element in the list.\n\nSample Input 1\n\n7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n\nSample Output 1\n\n6 1 2\n\nSample Input 2\n\n9\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast\n\nSample Output 2\n\n1", "sample_input": "7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n"}, "reference_outputs": ["6 1 2\n"], "source_document_id": "p02265", "source_text": "Doubly Linked List\n\nYour task is to implement a double linked list.\n\nWrite a program which performs the following operations:\n\ninsert x: insert an element with key x into the front of the list.\n\ndelete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything.\n\ndeleteFirst: delete the first element from the list.\n\ndeleteLast: delete the last element from the list.\n\nInput\n\nThe input is given in the following format:\n\nn\n\ncommand1\n\ncommand2\n\n...\n\ncommandn\n\nIn the first line, the number of operations n is given. In the following n lines, the above mentioned operations are given in the following format:\n\ninsert x\n\ndelete x\n\ndeleteFirst\n\ndeleteLast\n\nOutput\n\nPrint all the element (key) in the list after the given operations. Two consequtive keys should be separated by a single space.\n\nConstraints\n\nThe number of operations ≤ 2,000,000\n\nThe number of delete operations ≤ 20\n\n0 ≤ value of a key ≤ 109\n\nThe number of elements in the list does not exceed 106\n\nFor a delete, deleteFirst or deleteLast operation, there is at least one element in the list.\n\nSample Input 1\n\n7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n\nSample Output 1\n\n6 1 2\n\nSample Input 2\n\n9\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1362, "cpu_time_ms": 1970, "memory_kb": 136156}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s135475892", "group_id": "codeNet:p02267", "input_text": "x . \" \" . $p->y . PHP_EOL;\n }\n }\n\n public function __construct($x, $y)\n {\n $this->x = $x;\n $this->y = $y;\n }\n}\n\nfunction koch($n, Point $a, Point $b)\n{\n if ($n <= 0) {\n return;\n }\n\n// $s = new Point(\n// abs($b->x - $a->x) / 3 * 1 + $a->x,\n// abs($b->y - $a->y) / 3 * 1 + $a->y\n// );\n//\n// $t = new Point(\n// abs($b->x - $a->x) / 3 * 2 + $a->x,\n// abs($b->y - $a->y) / 3 * 2 + $a->y\n// );\n\n $s = new Point(\n (2.0 * $a->x + 1.0 * $b->x) / 3,\n (2.0 * $a->y + 1.0 * $b->y) / 3\n );\n\n $t = new Point(\n (1.0 * $a->x + 2.0 * $b->x) /3,\n (1.0 * $a->y + 2.0 * $b->y) /3\n );\n\n $u = round60($s, $t);\n\n koch($n - 1, $a, $s);\n Point::stackPoint($s);\n\n koch($n - 1, $s, $u);\n Point::stackPoint($u);\n\n koch($n - 1, $u, $t);\n Point::stackPoint($t);\n\n koch($n - 1, $t, $b);\n}\n\n// $a を起点として、$bを60度回転させた座標を返す\nfunction round60(Point $a, Point $b)\n{\n $rad60 = pi() / 3;\n $cx = ($b->x - $a->x) * cos($rad60) - ($b->y - $a->y) * sin($rad60) + $a->x;\n $cy = ($b->x - $a->x) * sin($rad60) + ($b->y - $a->y) * cos($rad60) + $a->y;\n\n return new Point($cx, $cy);\n}\n", "language": "PHP", "metadata": {"date": 1546400316, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02273.html", "problem_id": "p02273", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02273/input.txt", "sample_output_relpath": "derived/input_output/data/p02273/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02273/PHP/s279317060.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s279317060", "user_id": "u173420035"}, "prompt_components": {"gold_output": "0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n", "input_to_evaluate": "x . \" \" . $p->y . PHP_EOL;\n }\n }\n\n public function __construct($x, $y)\n {\n $this->x = $x;\n $this->y = $y;\n }\n}\n\nfunction koch($n, Point $a, Point $b)\n{\n if ($n <= 0) {\n return;\n }\n\n// $s = new Point(\n// abs($b->x - $a->x) / 3 * 1 + $a->x,\n// abs($b->y - $a->y) / 3 * 1 + $a->y\n// );\n//\n// $t = new Point(\n// abs($b->x - $a->x) / 3 * 2 + $a->x,\n// abs($b->y - $a->y) / 3 * 2 + $a->y\n// );\n\n $s = new Point(\n (2.0 * $a->x + 1.0 * $b->x) / 3,\n (2.0 * $a->y + 1.0 * $b->y) / 3\n );\n\n $t = new Point(\n (1.0 * $a->x + 2.0 * $b->x) /3,\n (1.0 * $a->y + 2.0 * $b->y) /3\n );\n\n $u = round60($s, $t);\n\n koch($n - 1, $a, $s);\n Point::stackPoint($s);\n\n koch($n - 1, $s, $u);\n Point::stackPoint($u);\n\n koch($n - 1, $u, $t);\n Point::stackPoint($t);\n\n koch($n - 1, $t, $b);\n}\n\n// $a を起点として、$bを60度回転させた座標を返す\nfunction round60(Point $a, Point $b)\n{\n $rad60 = pi() / 3;\n $cx = ($b->x - $a->x) * cos($rad60) - ($b->y - $a->y) * sin($rad60) + $a->x;\n $cy = ($b->x - $a->x) * sin($rad60) + ($b->y - $a->y) * cos($rad60) + $a->y;\n\n return new Point($cx, $cy);\n}\n", "problem_context": "Koch Curve\n\nWrite a program which reads an integer n and draws a Koch curve based on recursive calles of depth n.\n\nThe Koch curve is well known as a kind of fractals.\n\nYou can draw a Koch curve in the following algorithm:\n\nDivide a given segment (p1, p2) into three equal segments.\n\nReplace the middle segment by the two sides of an equilateral triangle (s, u, t) of the same length as the segment.\n\nRepeat this procedure recursively for new segments (p1, s), (s, u), (u, t), (t, p2).\n\nYou should start (0, 0), (100, 0) as the first segment.\n\nInput\n\nAn integer n is given.\n\nOutput\n\nPrint each point (x, y) of the Koch curve. Print a point in a line. You should start the point(0, 0), which is the endpoint of the first segment and end with the point (100, 0), the other endpoint so that you can draw the Koch curve as an unbroken line. Each solution should be given as a decimal with an arbitrary number of fractional digits, and with an absolute error of at most 10-4.\n\nConstraints\n\n0 ≤ n ≤ 6\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0.00000000 0.00000000\n11.11111111 0.00000000\n16.66666667 9.62250449\n22.22222222 0.00000000\n33.33333333 0.00000000\n38.88888889 9.62250449\n33.33333333 19.24500897\n44.44444444 19.24500897\n50.00000000 28.86751346\n55.55555556 19.24500897\n66.66666667 19.24500897\n61.11111111 9.62250449\n66.66666667 0.00000000\n77.77777778 0.00000000\n83.33333333 9.62250449\n88.88888889 0.00000000\n100.00000000 0.00000000\n\nNotes", "sample_input": "1\n"}, "reference_outputs": ["0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n"], "source_document_id": "p02273", "source_text": "Koch Curve\n\nWrite a program which reads an integer n and draws a Koch curve based on recursive calles of depth n.\n\nThe Koch curve is well known as a kind of fractals.\n\nYou can draw a Koch curve in the following algorithm:\n\nDivide a given segment (p1, p2) into three equal segments.\n\nReplace the middle segment by the two sides of an equilateral triangle (s, u, t) of the same length as the segment.\n\nRepeat this procedure recursively for new segments (p1, s), (s, u), (u, t), (t, p2).\n\nYou should start (0, 0), (100, 0) as the first segment.\n\nInput\n\nAn integer n is given.\n\nOutput\n\nPrint each point (x, y) of the Koch curve. Print a point in a line. You should start the point(0, 0), which is the endpoint of the first segment and end with the point (100, 0), the other endpoint so that you can draw the Koch curve as an unbroken line. Each solution should be given as a decimal with an arbitrary number of fractional digits, and with an absolute error of at most 10-4.\n\nConstraints\n\n0 ≤ n ≤ 6\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0.00000000 0.00000000\n11.11111111 0.00000000\n16.66666667 9.62250449\n22.22222222 0.00000000\n33.33333333 0.00000000\n38.88888889 9.62250449\n33.33333333 19.24500897\n44.44444444 19.24500897\n50.00000000 28.86751346\n55.55555556 19.24500897\n66.66666667 19.24500897\n61.11111111 9.62250449\n66.66666667 0.00000000\n77.77777778 0.00000000\n83.33333333 9.62250449\n88.88888889 0.00000000\n100.00000000 0.00000000\n\nNotes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3127, "cpu_time_ms": 30, "memory_kb": 11104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s456360499", "group_id": "codeNet:p02285", "input_text": "getId()] = $node;\n\t\t\tinsertNode($list, $node);\n\t\t}elseif ($input[0] === 'delete') {\n\t\t\t$list = deleteNode($list, (int)$input[1]);\n\t\t\t// var_dump($list);\n\t\t}elseif ($input[0] === 'find') {\n\t\t\tif (findNode($list, (int)$input[1])) {\n\t\t\t\techo 'yes' . PHP_EOL;\n\t\t\t}else{\n\t\t\t\techo 'no' . PHP_EOL;\n\t\t\t}\n\t\t}else{\n\t\t\t// $root = getRoot($list);\n\t\t\t// if ($root != NULL) {\n\t\t\t// \tinorderWalk($list, $root);\n\t\t\t// \techo PHP_EOL;\n\t\t\t// \tpreorderWalk($list, $root);\n\t\t\t// \techo PHP_EOL;\n\t\t\t// }else{\n\t\t\t// \techo PHP_EOL;\n\t\t\t// \techo PHP_EOL;\n\t\t\t// }\n\t\t\tvar_dump($list);\n\t\t}\n\t}\n}\n\nfunction getRoot($list){\n\t$p = NULL;\n\tif (count($list) > 0) {\n\t\t$p = $list[array_keys($list)[0]]->getId();\n\t\twhile (true) {\n\t\t\t$tmp = $list[$p]->getParentId();\n\t\t\tif ($tmp === NULL) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$p = $tmp;\n\t\t}\n\t}\n\treturn $p;\n}\nfunction insertNode($list, $node){\n\t$parent = NULL;\n\t$cur = getRoot($list);\n\twhile ($cur != NULL) {\n\t\t$parent = $cur;\n\t\tif ($node->getId() < $list[$parent]->getId()) {\n\t\t\t$cur = $list[$parent]->getLeft();\n\t\t}else{\n\t\t\t$cur = $list[$parent]->getRight();\n\t\t}\n\t}\n\tif ($parent !== $node->getId()) {\n\t\t$node->setParentId($parent);\n\t\tif ($parent !== NULL) {\n\t\t\tif ($node->getId() < $list[$parent]->getId()) {\n\t\t\t\t$list[$parent]->setLeft($node->getId());\n\t\t\t}else{\n\t\t\t\t$list[$parent]->setRight($node->getId());\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nfunction findNode($list, $target){\n\t$cur = getRoot($list);\n\twhile ($cur != NULL) {\n\t\tif ($list[$cur]->getId() === $target) {\n\t\t\tbreak;\n\t\t}\n\t\t$parent = $cur;\n\t\tif ($target < $list[$parent]->getId()) {\n\t\t\t$cur = $list[$parent]->getLeft();\n\t\t}else{\n\t\t\t$cur = $list[$parent]->getRight();\n\t\t}\n\t}\n\treturn ($cur != NULL);\n}\n\nfunction deleteNode($list, $target){\n\tif (isset($list[$target])) {\n\t\t$children = $list[$target]->getChildren();\n\t\tif (count($children) < 2) {\n\t\t\t$successor = $target;\n\t\t} else {\n\t\t\t$successor = getSuccessor($list, $target);\n\t\t}\n\t\t$parent = $list[$successor]->getParentId();\n\n\t\tif ($list[$successor]->hasLeft()) {\n\t\t\t$child = $list[$successor]->getLeft();\n\t\t}else{\n\t\t\t$child = $list[$successor]->getRight();\n\t\t}\n\t\tif ($child !== NULL) {\n\t\t\t$list[$child]->setParentId($parent);\n\t\t}\n\n\t\tif ($parent == NULL) {\n\t\t\t# code...\n\t\t} elseif ($successor === $list[$parent]->getLeft()) {\n\t\t\t$list[$parent]->setLeft($child);\n\t\t}else{\n\t\t\t$list[$parent]->setRight($child);\n\t\t}\n\n\t\tif ($successor !== $target) {\n\t\t\t$list[$target]->setId($successor);\n\t\t\t$list[$successor] = $list[$target];\n\t\t\tif ($list[$successor]->hasLeft()) {\n\t\t\t\t$left = $list[$successor]->getLeft();\n\t\t\t\t$list[$left]->setParentId($successor);\n\t\t\t}\n\t\t\tif ($list[$successor]->hasRight()) {\n\t\t\t\t$right = $list[$successor]->getRight();\n\t\t\t\t$list[$right]->setParentId($successor);\n\t\t\t}\n\t\t}\n\t\tunset($list[$target]);\n\t}\n\treturn $list;\n}\n\nfunction getSuccessor($list, $id){\n\tif ($list[$id]->hasRight()) {\n\t\treturn getMinimum($list, $list[$id]->getRight());\n\t}\n\t$parent = $list[$id]->getParentId();\n\twhile ($parent !== NULL && $id === $list[$parent]->getRight()) {\n\t\t$id = $parent;\n\t\t$parent = $parent->getParentId();\n\t}\n\treturn $parent;\n}\n\nfunction getMinimum($list, $id){\n\twhile ($list[$id]->hasLeft()) {\n\t\t$id = $list[$id]->getLeft();\n\t}\n\treturn $id;\n}\n\nfunction preorderWalk($list, $id){\n\techo ' ' . $id;\n\tif ($list[$id]->hasLeft()) {\n\t\tpreorderWalk($list, $list[$id]->getLeft());\n\t}\n\tif ($list[$id]->hasRight()) {\n\t\tpreorderWalk($list, $list[$id]->getRight());\n\t}\n}\n\nfunction inorderWalk($list, $id){\n\tif ($list[$id]->hasLeft()) {\n\t\tinorderWalk($list, $list[$id]->getLeft());\n\t}\n\techo ' ' . $id;\n\tif ($list[$id]->hasRight()) {\n\t\tinorderWalk($list, $list[$id]->getRight());\n\t}\n}\n\nclass BTreeNode\n{\n\tprivate $id;\n\tprivate $depth = 0;\n\tprivate $height = 0;\n\tprivate $parent_id = NULL;\n\tprivate $left = NULL;\n\tprivate $right = NULL;\n\n\tfunction __construct($id)\n\t{\n\t\t$this->id = $id;\n\t}\n\tfunction setParentId($p_id){\n\t\t$this->parent_id = $p_id;\n\t}\n\tfunction setLeft($l_id){\n\t\t$this->left = $l_id;\n\t}\n\tfunction setRight($r_id){\n\t\t$this->right = $r_id;\n\t}\n\tfunction setId($id){\n\t\t$this->id = $id;\n\t}\n\tfunction getId(){\n\t\treturn $this->id;\n\t}\n\tfunction getParentId(){\n\t\treturn $this->parent_id;\n\t}\n\tfunction getLeft(){\n\t\treturn $this->left;\n\t}\n\tfunction getRight(){\n\t\treturn $this->right;\n\t}\n\tfunction hasChild(){\n\t\treturn ($this->left !== NULL) || ($this->right !== NULL);\n\t}\n\tfunction getChildren(){\n\t\t$children = [];\n\t\tif ($this->hasLeft()) {\n\t\t\t$children[] = $this->left;\n\t\t}\n\t\tif ($this->hasRight()) {\n\t\t\t$children[] = $this->right;\n\t\t}\n\t\treturn $children;\n\t}\n\tfunction getAnotherChild($c_id){\n\t\t$c = NULL;\n\t\tif ($this->getLeft() === $c_id) {\n\t\t\t$c = $this->getRight();\n\t\t}elseif ($this->getRight() === $c_id) {\n\t\t\t$c = $this->getLeft();\n\t\t}\n\t\treturn $c;\n\t}\n\tfunction hasLeft(){\n\t\treturn $this->left !== NULL;\n\t}\n\tfunction hasRight(){\n\t\treturn $this->right !== NULL;\n\t}\n\tfunction setDepth($d){\n\t\t$this->depth = $d;\n\t}\n\tfunction addDepth(){\n\t\t$this->depth += 1;\n\t}\n\tfunction getDepth(){\n\t\treturn $this->depth;\n\t}\n\tfunction setHeight($h){\n\t\t$this->height = $h;\n\t}\n\tfunction getHeight(){\n\t\treturn $this->height;\n\t}\n}\n", "language": "PHP", "metadata": {"date": 1556593639, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02285.html", "problem_id": "p02285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02285/input.txt", "sample_output_relpath": "derived/input_output/data/p02285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02285/PHP/s456360499.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s456360499", "user_id": "u166757693"}, "prompt_components": {"gold_output": "yes\nyes\nyes\nno\nno\nno\nyes\nyes\n 1 2 3 7 8 22\n 8 2 1 3 7 22\n 1 2 8 22\n 8 2 1 22\n", "input_to_evaluate": "getId()] = $node;\n\t\t\tinsertNode($list, $node);\n\t\t}elseif ($input[0] === 'delete') {\n\t\t\t$list = deleteNode($list, (int)$input[1]);\n\t\t\t// var_dump($list);\n\t\t}elseif ($input[0] === 'find') {\n\t\t\tif (findNode($list, (int)$input[1])) {\n\t\t\t\techo 'yes' . PHP_EOL;\n\t\t\t}else{\n\t\t\t\techo 'no' . PHP_EOL;\n\t\t\t}\n\t\t}else{\n\t\t\t// $root = getRoot($list);\n\t\t\t// if ($root != NULL) {\n\t\t\t// \tinorderWalk($list, $root);\n\t\t\t// \techo PHP_EOL;\n\t\t\t// \tpreorderWalk($list, $root);\n\t\t\t// \techo PHP_EOL;\n\t\t\t// }else{\n\t\t\t// \techo PHP_EOL;\n\t\t\t// \techo PHP_EOL;\n\t\t\t// }\n\t\t\tvar_dump($list);\n\t\t}\n\t}\n}\n\nfunction getRoot($list){\n\t$p = NULL;\n\tif (count($list) > 0) {\n\t\t$p = $list[array_keys($list)[0]]->getId();\n\t\twhile (true) {\n\t\t\t$tmp = $list[$p]->getParentId();\n\t\t\tif ($tmp === NULL) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$p = $tmp;\n\t\t}\n\t}\n\treturn $p;\n}\nfunction insertNode($list, $node){\n\t$parent = NULL;\n\t$cur = getRoot($list);\n\twhile ($cur != NULL) {\n\t\t$parent = $cur;\n\t\tif ($node->getId() < $list[$parent]->getId()) {\n\t\t\t$cur = $list[$parent]->getLeft();\n\t\t}else{\n\t\t\t$cur = $list[$parent]->getRight();\n\t\t}\n\t}\n\tif ($parent !== $node->getId()) {\n\t\t$node->setParentId($parent);\n\t\tif ($parent !== NULL) {\n\t\t\tif ($node->getId() < $list[$parent]->getId()) {\n\t\t\t\t$list[$parent]->setLeft($node->getId());\n\t\t\t}else{\n\t\t\t\t$list[$parent]->setRight($node->getId());\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nfunction findNode($list, $target){\n\t$cur = getRoot($list);\n\twhile ($cur != NULL) {\n\t\tif ($list[$cur]->getId() === $target) {\n\t\t\tbreak;\n\t\t}\n\t\t$parent = $cur;\n\t\tif ($target < $list[$parent]->getId()) {\n\t\t\t$cur = $list[$parent]->getLeft();\n\t\t}else{\n\t\t\t$cur = $list[$parent]->getRight();\n\t\t}\n\t}\n\treturn ($cur != NULL);\n}\n\nfunction deleteNode($list, $target){\n\tif (isset($list[$target])) {\n\t\t$children = $list[$target]->getChildren();\n\t\tif (count($children) < 2) {\n\t\t\t$successor = $target;\n\t\t} else {\n\t\t\t$successor = getSuccessor($list, $target);\n\t\t}\n\t\t$parent = $list[$successor]->getParentId();\n\n\t\tif ($list[$successor]->hasLeft()) {\n\t\t\t$child = $list[$successor]->getLeft();\n\t\t}else{\n\t\t\t$child = $list[$successor]->getRight();\n\t\t}\n\t\tif ($child !== NULL) {\n\t\t\t$list[$child]->setParentId($parent);\n\t\t}\n\n\t\tif ($parent == NULL) {\n\t\t\t# code...\n\t\t} elseif ($successor === $list[$parent]->getLeft()) {\n\t\t\t$list[$parent]->setLeft($child);\n\t\t}else{\n\t\t\t$list[$parent]->setRight($child);\n\t\t}\n\n\t\tif ($successor !== $target) {\n\t\t\t$list[$target]->setId($successor);\n\t\t\t$list[$successor] = $list[$target];\n\t\t\tif ($list[$successor]->hasLeft()) {\n\t\t\t\t$left = $list[$successor]->getLeft();\n\t\t\t\t$list[$left]->setParentId($successor);\n\t\t\t}\n\t\t\tif ($list[$successor]->hasRight()) {\n\t\t\t\t$right = $list[$successor]->getRight();\n\t\t\t\t$list[$right]->setParentId($successor);\n\t\t\t}\n\t\t}\n\t\tunset($list[$target]);\n\t}\n\treturn $list;\n}\n\nfunction getSuccessor($list, $id){\n\tif ($list[$id]->hasRight()) {\n\t\treturn getMinimum($list, $list[$id]->getRight());\n\t}\n\t$parent = $list[$id]->getParentId();\n\twhile ($parent !== NULL && $id === $list[$parent]->getRight()) {\n\t\t$id = $parent;\n\t\t$parent = $parent->getParentId();\n\t}\n\treturn $parent;\n}\n\nfunction getMinimum($list, $id){\n\twhile ($list[$id]->hasLeft()) {\n\t\t$id = $list[$id]->getLeft();\n\t}\n\treturn $id;\n}\n\nfunction preorderWalk($list, $id){\n\techo ' ' . $id;\n\tif ($list[$id]->hasLeft()) {\n\t\tpreorderWalk($list, $list[$id]->getLeft());\n\t}\n\tif ($list[$id]->hasRight()) {\n\t\tpreorderWalk($list, $list[$id]->getRight());\n\t}\n}\n\nfunction inorderWalk($list, $id){\n\tif ($list[$id]->hasLeft()) {\n\t\tinorderWalk($list, $list[$id]->getLeft());\n\t}\n\techo ' ' . $id;\n\tif ($list[$id]->hasRight()) {\n\t\tinorderWalk($list, $list[$id]->getRight());\n\t}\n}\n\nclass BTreeNode\n{\n\tprivate $id;\n\tprivate $depth = 0;\n\tprivate $height = 0;\n\tprivate $parent_id = NULL;\n\tprivate $left = NULL;\n\tprivate $right = NULL;\n\n\tfunction __construct($id)\n\t{\n\t\t$this->id = $id;\n\t}\n\tfunction setParentId($p_id){\n\t\t$this->parent_id = $p_id;\n\t}\n\tfunction setLeft($l_id){\n\t\t$this->left = $l_id;\n\t}\n\tfunction setRight($r_id){\n\t\t$this->right = $r_id;\n\t}\n\tfunction setId($id){\n\t\t$this->id = $id;\n\t}\n\tfunction getId(){\n\t\treturn $this->id;\n\t}\n\tfunction getParentId(){\n\t\treturn $this->parent_id;\n\t}\n\tfunction getLeft(){\n\t\treturn $this->left;\n\t}\n\tfunction getRight(){\n\t\treturn $this->right;\n\t}\n\tfunction hasChild(){\n\t\treturn ($this->left !== NULL) || ($this->right !== NULL);\n\t}\n\tfunction getChildren(){\n\t\t$children = [];\n\t\tif ($this->hasLeft()) {\n\t\t\t$children[] = $this->left;\n\t\t}\n\t\tif ($this->hasRight()) {\n\t\t\t$children[] = $this->right;\n\t\t}\n\t\treturn $children;\n\t}\n\tfunction getAnotherChild($c_id){\n\t\t$c = NULL;\n\t\tif ($this->getLeft() === $c_id) {\n\t\t\t$c = $this->getRight();\n\t\t}elseif ($this->getRight() === $c_id) {\n\t\t\t$c = $this->getLeft();\n\t\t}\n\t\treturn $c;\n\t}\n\tfunction hasLeft(){\n\t\treturn $this->left !== NULL;\n\t}\n\tfunction hasRight(){\n\t\treturn $this->right !== NULL;\n\t}\n\tfunction setDepth($d){\n\t\t$this->depth = $d;\n\t}\n\tfunction addDepth(){\n\t\t$this->depth += 1;\n\t}\n\tfunction getDepth(){\n\t\treturn $this->depth;\n\t}\n\tfunction setHeight($h){\n\t\t$this->height = $h;\n\t}\n\tfunction getHeight(){\n\t\treturn $this->height;\n\t}\n}\n", "problem_context": "Binary Search Tree III\n\nWrite a program which performs the following operations to a binary search tree $T$ by adding delete operation to B: Binary Search Tree II.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nfind $k$: Report whether $T$ has a node containing $k$.\n\ndelete $k$: Delete a node containing $k$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nThe operation delete $k$ for deleting a given node $z$ containing key $k$ from $T$ can be implemented by an algorithm which considers the following cases:\n\nIf $z$ has no children, we modify its parent $z.p$ to replace $z$ with NIL as its child (delete $z$).\n\nIf $z$ has only a single child, we \"splice out\" $z$ by making a new link between its child and its parent.\n\nIf $z$ has two children, we splice out $z$'s successor $y$ and replace $z$'s key with $y$'s key.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$, find $k$, delete $k$ or print are given.\n\nOutput\n\nFor each find $k$ operation, print \"yes\" if $T$ has a node containing $k$, \"no\" if not.\n\nIn addition, for each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n18\ninsert 8\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 4\nfind 5\nfind 6\nfind 7\nfind 8\nprint\ndelete 3\ndelete 7\nprint\n\nSample Output 1\n\nyes\nyes\nyes\nno\nno\nno\nyes\nyes\n1 2 3 7 8 22\n8 2 1 3 7 22\n1 2 8 22\n8 2 1 22\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "18\ninsert 8\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 4\nfind 5\nfind 6\nfind 7\nfind 8\nprint\ndelete 3\ndelete 7\nprint\n"}, "reference_outputs": ["yes\nyes\nyes\nno\nno\nno\nyes\nyes\n 1 2 3 7 8 22\n 8 2 1 3 7 22\n 1 2 8 22\n 8 2 1 22\n"], "source_document_id": "p02285", "source_text": "Binary Search Tree III\n\nWrite a program which performs the following operations to a binary search tree $T$ by adding delete operation to B: Binary Search Tree II.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nfind $k$: Report whether $T$ has a node containing $k$.\n\ndelete $k$: Delete a node containing $k$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nThe operation delete $k$ for deleting a given node $z$ containing key $k$ from $T$ can be implemented by an algorithm which considers the following cases:\n\nIf $z$ has no children, we modify its parent $z.p$ to replace $z$ with NIL as its child (delete $z$).\n\nIf $z$ has only a single child, we \"splice out\" $z$ by making a new link between its child and its parent.\n\nIf $z$ has two children, we splice out $z$'s successor $y$ and replace $z$'s key with $y$'s key.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$, find $k$, delete $k$ or print are given.\n\nOutput\n\nFor each find $k$ operation, print \"yes\" if $T$ has a node containing $k$, \"no\" if not.\n\nIn addition, for each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n18\ninsert 8\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 4\nfind 5\nfind 6\nfind 7\nfind 8\nprint\ndelete 3\ndelete 7\nprint\n\nSample Output 1\n\nyes\nyes\nyes\nno\nno\nno\nyes\nyes\n1 2 3 7 8 22\n8 2 1 3 7 22\n1 2 8 22\n8 2 1 22\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5256, "cpu_time_ms": 10, "memory_kb": 9464}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s244853302", "group_id": "codeNet:p02288", "input_text": " 0; $i--) { \n\t\t$data = maxHeapify($data, $i);\n\t}\n\tforeach ($data as $v) {\n\t\techo ' ' . $v;\n\t}\n\techo PHP_EOL;\n}\n\nfunction maxHeapify($array, $i){\n\t$h = count($array);\n\t$l_idx = 2 * $i;\n\t$r_idx = (2 * $i) + 1;\n\t$largest = $i;\n\tif ($l_idx <= $h && $array[$l_idx] > $array[$i]) {\n\t\t$largest = $l_idx;\n\t}\n\tif ($r_idx <= $h && $array[$r_idx] > $array[$largest]) {\n\t\t$largest = $r_idx;\n\t}\n\n\tif ($largest !== $i) {\n\t\t$tmp = $array[$largest];\n\t\t$array[$largest] = $array[$i];\n\t\t$array[$i] = $tmp;\n\t\t$array = maxHeapify($array, $largest);\n\t}\n\treturn $array;\n}\n", "language": "PHP", "metadata": {"date": 1556793810, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02288.html", "problem_id": "p02288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02288/input.txt", "sample_output_relpath": "derived/input_output/data/p02288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02288/PHP/s244853302.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s244853302", "user_id": "u166757693"}, "prompt_components": {"gold_output": " 16 14 10 8 7 9 3 2 4 1\n", "input_to_evaluate": " 0; $i--) { \n\t\t$data = maxHeapify($data, $i);\n\t}\n\tforeach ($data as $v) {\n\t\techo ' ' . $v;\n\t}\n\techo PHP_EOL;\n}\n\nfunction maxHeapify($array, $i){\n\t$h = count($array);\n\t$l_idx = 2 * $i;\n\t$r_idx = (2 * $i) + 1;\n\t$largest = $i;\n\tif ($l_idx <= $h && $array[$l_idx] > $array[$i]) {\n\t\t$largest = $l_idx;\n\t}\n\tif ($r_idx <= $h && $array[$r_idx] > $array[$largest]) {\n\t\t$largest = $r_idx;\n\t}\n\n\tif ($largest !== $i) {\n\t\t$tmp = $array[$largest];\n\t\t$array[$largest] = $array[$i];\n\t\t$array[$i] = $tmp;\n\t\t$array = maxHeapify($array, $largest);\n\t}\n\treturn $array;\n}\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\n4 1 3 2 16 9 10 14 8 7\n"}, "reference_outputs": [" 16 14 10 8 7 9 3 2 4 1\n"], "source_document_id": "p02288", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 802, "cpu_time_ms": 30, "memory_kb": 10368}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s042657141", "group_id": "codeNet:p02379", "input_text": "", "language": "PHP", "metadata": {"date": 1488133521, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02382.html", "problem_id": "p02382", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02382/input.txt", "sample_output_relpath": "derived/input_output/data/p02382/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02382/PHP/s569476779.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s569476779", "user_id": "u064980217"}, "prompt_components": {"gold_output": "4.000000\n2.449490\n2.154435\n2.000000\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDistance II\n\nYour task is to calculate the distance between two $n$ dimensional vectors $x = \\{x_1, x_2, ..., x_n\\}$ and $y = \\{y_1, y_2, ..., y_n\\}$.\n\nThe Minkowski's distance defined below is a metric which is a generalization of both the Manhattan distance and the Euclidean distance.\n\n\\[\nD_{xy} = (\\sum_{i=1}^n |x_i - y_i|^p)^{\\frac{1}{p}}\n\\]\n\nIt can be the Manhattan distance\n\n\\[\nD_{xy} = |x_1 - y_1| + |x_2 - y_2| + ... + |x_n - y_n|\n\\]\n\nwhere $p = 1 $.\n\nIt can be the Euclidean distance\n\n\\[\nD_{xy} = \\sqrt{(|x_1 - y_1|)^{2} + (|x_2 - y_2|)^{2} + ... + (|x_n - y_n|)^{2}}\n\\]\n\nwhere $p = 2 $.\n\nAlso, it can be the Chebyshev distance\n\n\\[\nD_{xy} = max_{i=1}^n (|x_i - y_i|)\n\\]\n\nwhere $p = \\infty$\n\nWrite a program which reads two $n$ dimensional vectors $x$ and $y$, and calculates Minkowski's distance where $p = 1, 2, 3, \\infty$ respectively.\n\nInput\n\nIn the first line, an integer $n$ is given. In the second and third line, $x = \\{x_1, x_2, ... x_n\\}$ and $y = \\{y_1, y_2, ... y_n\\}$ are given respectively. The elements in $x$ and $y$ are given in integers.\n\nOutput\n\nPrint the distance where $p = 1, 2, 3$ and $\\infty$ in a line respectively.\nThe output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\n$0 \\leq x_i, y_i \\leq 1000$\n\nSample Input\n\n3\n1 2 3\n2 0 4\n\nSample Output\n\n4.000000\n2.449490\n2.154435\n2.000000", "sample_input": "3\n1 2 3\n2 0 4\n"}, "reference_outputs": ["4.000000\n2.449490\n2.154435\n2.000000\n"], "source_document_id": "p02382", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDistance II\n\nYour task is to calculate the distance between two $n$ dimensional vectors $x = \\{x_1, x_2, ..., x_n\\}$ and $y = \\{y_1, y_2, ..., y_n\\}$.\n\nThe Minkowski's distance defined below is a metric which is a generalization of both the Manhattan distance and the Euclidean distance.\n\n\\[\nD_{xy} = (\\sum_{i=1}^n |x_i - y_i|^p)^{\\frac{1}{p}}\n\\]\n\nIt can be the Manhattan distance\n\n\\[\nD_{xy} = |x_1 - y_1| + |x_2 - y_2| + ... + |x_n - y_n|\n\\]\n\nwhere $p = 1 $.\n\nIt can be the Euclidean distance\n\n\\[\nD_{xy} = \\sqrt{(|x_1 - y_1|)^{2} + (|x_2 - y_2|)^{2} + ... + (|x_n - y_n|)^{2}}\n\\]\n\nwhere $p = 2 $.\n\nAlso, it can be the Chebyshev distance\n\n\\[\nD_{xy} = max_{i=1}^n (|x_i - y_i|)\n\\]\n\nwhere $p = \\infty$\n\nWrite a program which reads two $n$ dimensional vectors $x$ and $y$, and calculates Minkowski's distance where $p = 1, 2, 3, \\infty$ respectively.\n\nInput\n\nIn the first line, an integer $n$ is given. In the second and third line, $x = \\{x_1, x_2, ... x_n\\}$ and $y = \\{y_1, y_2, ... y_n\\}$ are given respectively. The elements in $x$ and $y$ are given in integers.\n\nOutput\n\nPrint the distance where $p = 1, 2, 3$ and $\\infty$ in a line respectively.\nThe output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\n$0 \\leq x_i, y_i \\leq 1000$\n\nSample Input\n\n3\n1 2 3\n2 0 4\n\nSample Output\n\n4.000000\n2.449490\n2.154435\n2.000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 347, "cpu_time_ms": 10, "memory_kb": 15604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s938637612", "group_id": "codeNet:p02384", "input_text": "top;\n $this->top = $this->south;\n $this->south = $this->bottom;\n $this->bottom = $this->north;\n $this->north = $t;\n }\n\n public function toEast()\n {\n $t = $this->top;\n $this->top = $this->west;\n $this->west = $this->bottom;\n $this->bottom = $this->east;\n $this->east = $t;\n }\n\n public function toSouth()\n {\n $t = $this->top;\n $this->top = $this->north;\n $this->north = $this->bottom;\n $this->bottom = $this->south;\n $this->south = $t;\n }\n\n public function toWest()\n {\n $t = $this->top;\n $this->top = $this->east;\n $this->east = $this->bottom;\n $this->bottom = $this->west;\n $this->west = $t;\n }\n\n public function spin()\n {\n $n = $this->north;\n $this->north = $this->west;\n $this->west = $this->south;\n $this->south = $this->east;\n $this->east = $n;\n }\n\n public function toBottom()\n {\n $this->toNorth();\n $this->toNorth();\n }\n\n public function toTop($x)\n {\n if ($x == $this->north) $this->toSouth();\n elseif ($x == $this->east) $this->toWest();\n elseif ($x == $this->south) $this->toNorth();\n elseif ($x == $this->west) $this->toEast();\n elseif ($x == $this->bottom) $this->toBottom();\n }\n}\n\n$dice = new Dice();\n$n = explode(\" \", trim(fgets(STDIN)));\n$dice->top = $n[0];\n$dice->south = $n[1];\n$dice->east = $n[2];\n$dice->west = $n[3];\n$dice->north = $n[4];\n$dice->bottom = $n[5];\n\n$q = trim(fgets(STDIN));\n\nfor ($i = 0; $i < $q; $i++) {\n list($a, $b) = explode(\" \", trim(fgets(STDIN)));\n $dice->toTop($a);\n while ($b != $dice->south) $dice->spin();\n echo $dice->east . \"\\n\";\n}\n\n", "language": "PHP", "metadata": {"date": 1515311168, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02384.html", "problem_id": "p02384", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02384/input.txt", "sample_output_relpath": "derived/input_output/data/p02384/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02384/PHP/s938637612.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938637612", "user_id": "u344726938"}, "prompt_components": {"gold_output": "3\n5\n6\n", "input_to_evaluate": "top;\n $this->top = $this->south;\n $this->south = $this->bottom;\n $this->bottom = $this->north;\n $this->north = $t;\n }\n\n public function toEast()\n {\n $t = $this->top;\n $this->top = $this->west;\n $this->west = $this->bottom;\n $this->bottom = $this->east;\n $this->east = $t;\n }\n\n public function toSouth()\n {\n $t = $this->top;\n $this->top = $this->north;\n $this->north = $this->bottom;\n $this->bottom = $this->south;\n $this->south = $t;\n }\n\n public function toWest()\n {\n $t = $this->top;\n $this->top = $this->east;\n $this->east = $this->bottom;\n $this->bottom = $this->west;\n $this->west = $t;\n }\n\n public function spin()\n {\n $n = $this->north;\n $this->north = $this->west;\n $this->west = $this->south;\n $this->south = $this->east;\n $this->east = $n;\n }\n\n public function toBottom()\n {\n $this->toNorth();\n $this->toNorth();\n }\n\n public function toTop($x)\n {\n if ($x == $this->north) $this->toSouth();\n elseif ($x == $this->east) $this->toWest();\n elseif ($x == $this->south) $this->toNorth();\n elseif ($x == $this->west) $this->toEast();\n elseif ($x == $this->bottom) $this->toBottom();\n }\n}\n\n$dice = new Dice();\n$n = explode(\" \", trim(fgets(STDIN)));\n$dice->top = $n[0];\n$dice->south = $n[1];\n$dice->east = $n[2];\n$dice->west = $n[3];\n$dice->north = $n[4];\n$dice->bottom = $n[5];\n\n$q = trim(fgets(STDIN));\n\nfor ($i = 0; $i < $q; $i++) {\n list($a, $b) = explode(\" \", trim(fgets(STDIN)));\n $dice->toTop($a);\n while ($b != $dice->south) $dice->spin();\n echo $dice->east . \"\\n\";\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDice II\n\nConstruct a dice from a given sequence of integers in the same way as Dice I.\n\nYou are given integers on the top face and the front face after the dice was rolled in the same way as Dice I. Write a program to print an integer on the right side face.\n\nInput\n\nIn the first line, six integers assigned to faces are given in ascending order of their corresponding labels.\nIn the second line, the number of questions $q$ is given.\n\nIn the following $q$ lines, $q$ questions are given. Each question consists of two integers on the top face and the front face respectively.\n\nOutput\n\nFor each question, print the integer on the right side face.\n\nConstraints\n\n$0 \\leq $ the integer assigned to a face $ \\leq 100$\n\nThe integers are all different\n\n$1 \\leq q \\leq 24$\n\nSample Input\n\n1 2 3 4 5 6\n3\n6 5\n1 3\n3 2\n\nSample Output\n\n3\n5\n6", "sample_input": "1 2 3 4 5 6\n3\n6 5\n1 3\n3 2\n"}, "reference_outputs": ["3\n5\n6\n"], "source_document_id": "p02384", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDice II\n\nConstruct a dice from a given sequence of integers in the same way as Dice I.\n\nYou are given integers on the top face and the front face after the dice was rolled in the same way as Dice I. Write a program to print an integer on the right side face.\n\nInput\n\nIn the first line, six integers assigned to faces are given in ascending order of their corresponding labels.\nIn the second line, the number of questions $q$ is given.\n\nIn the following $q$ lines, $q$ questions are given. Each question consists of two integers on the top face and the front face respectively.\n\nOutput\n\nFor each question, print the integer on the right side face.\n\nConstraints\n\n$0 \\leq $ the integer assigned to a face $ \\leq 100$\n\nThe integers are all different\n\n$1 \\leq q \\leq 24$\n\nSample Input\n\n1 2 3 4 5 6\n3\n6 5\n1 3\n3 2\n\nSample Output\n\n3\n5\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1784, "cpu_time_ms": 10, "memory_kb": 9340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s845851781", "group_id": "codeNet:p02388", "input_text": "\n", "language": "PHP", "metadata": {"date": 1556084710, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/PHP/s845851781.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s845851781", "user_id": "u627843443"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "\n", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 61, "cpu_time_ms": 10, "memory_kb": 9172}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s986321159", "group_id": "codeNet:p02388", "input_text": "", "language": "PHP", "metadata": {"date": 1475655802, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/PHP/s202786997.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s202786997", "user_id": "u616299220"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 84, "cpu_time_ms": 10, "memory_kb": 15244}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s458338077", "group_id": "codeNet:p02388", "input_text": "", "language": "PHP", "metadata": {"date": 1492399738, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/PHP/s458338077.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s458338077", "user_id": "u928491417"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 69, "cpu_time_ms": 10, "memory_kb": 15092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s703736220", "group_id": "codeNet:p02388", "input_text": "", "language": "PHP", "metadata": {"date": 1505029469, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/PHP/s703736220.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s703736220", "user_id": "u955357818"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 89, "cpu_time_ms": 10, "memory_kb": 15008}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s611841334", "group_id": "codeNet:p02388", "input_text": "", "language": "PHP", "metadata": {"date": 1514178273, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/PHP/s611841334.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s611841334", "user_id": "u845105052"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 53, "cpu_time_ms": 10, "memory_kb": 9164}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s835029210", "group_id": "codeNet:p02388", "input_text": "", "language": "PHP", "metadata": {"date": 1514179035, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/PHP/s835029210.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s835029210", "user_id": "u845105052"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 78, "cpu_time_ms": 10, "memory_kb": 9168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s219915697", "group_id": "codeNet:p02388", "input_text": "\n", "language": "PHP", "metadata": {"date": 1558080858, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/PHP/s219915697.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s219915697", "user_id": "u646280391"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "\n", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 53, "cpu_time_ms": 10, "memory_kb": 9168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s452756396", "group_id": "codeNet:p02389", "input_text": "", "language": "PHP", "metadata": {"date": 1458490321, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/PHP/s452756396.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s452756396", "user_id": "u644239034"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 153, "cpu_time_ms": 10, "memory_kb": 15320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s512308189", "group_id": "codeNet:p02389", "input_text": "", "language": "PHP", "metadata": {"date": 1473308906, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/PHP/s512308189.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s512308189", "user_id": "u359764315"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 182, "cpu_time_ms": 10, "memory_kb": 15248}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s968886503", "group_id": "codeNet:p02389", "input_text": "\n\n", "language": "PHP", "metadata": {"date": 1562820836, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/PHP/s757205091.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s757205091", "user_id": "u640787710"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "\n\n", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 94, "cpu_time_ms": 10, "memory_kb": 9180}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s572174148", "group_id": "codeNet:p02389", "input_text": "", "language": "PHP", "metadata": {"date": 1435472169, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/PHP/s507820816.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s507820816", "user_id": "u281180011"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 10, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s528733038", "group_id": "codeNet:p02390", "input_text": "", "language": "PHP", "metadata": {"date": 1472709932, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/PHP/s480450329.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s480450329", "user_id": "u759763199"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 354, "cpu_time_ms": 10, "memory_kb": 15260}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s305864272", "group_id": "codeNet:p02390", "input_text": "", "language": "PHP", "metadata": {"date": 1473286260, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/PHP/s305864272.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s305864272", "user_id": "u441889394"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 134, "cpu_time_ms": 20, "memory_kb": 15192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s181480263", "group_id": "codeNet:p02390", "input_text": "", "language": "PHP", "metadata": {"date": 1490269506, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/PHP/s181480263.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s181480263", "user_id": "u372789658"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 96, "cpu_time_ms": 10, "memory_kb": 15220}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s143853319", "group_id": "codeNet:p02390", "input_text": " b\");\n}", "language": "PHP", "metadata": {"date": 1441837264, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/PHP/s275096162.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s275096162", "user_id": "u045588362"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": " b\");\n}", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 165, "cpu_time_ms": 10, "memory_kb": 15312}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s332577659", "group_id": "codeNet:p02391", "input_text": "b\";\n}elseif($a<$b){\n\techo \"b>a\";\n}\n\n\n?>", "language": "PHP", "metadata": {"date": 1452857099, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/PHP/s332577659.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s332577659", "user_id": "u013044130"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": "b\";\n}elseif($a<$b){\n\techo \"b>a\";\n}\n\n\n?>", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 195, "cpu_time_ms": 10, "memory_kb": 15276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s894883805", "group_id": "codeNet:p02391", "input_text": " $line2[1]){\n echo $line2[0].\" > \".$line2[1];\n }else{\n echo $line2[0].\" == \".$line2[1];\n }\n?>", "language": "PHP", "metadata": {"date": 1493193365, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/PHP/s894883805.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s894883805", "user_id": "u970073373"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": " $line2[1]){\n echo $line2[0].\" > \".$line2[1];\n }else{\n echo $line2[0].\" == \".$line2[1];\n }\n?>", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 259, "cpu_time_ms": 10, "memory_kb": 15408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s725467387", "group_id": "codeNet:p02391", "input_text": "$y){\n echo \"a > b\";\n }else{\n echo \"a == b\";\n }\n ?>", "language": "PHP", "metadata": {"date": 1494227460, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/PHP/s725467387.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s725467387", "user_id": "u584313098"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": "$y){\n echo \"a > b\";\n }else{\n echo \"a == b\";\n }\n ?>", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 10, "memory_kb": 14980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s850296992", "group_id": "codeNet:p02391", "input_text": " $lines[1]){\n echo \"a > b\";\n}else{\n echo \"a == b\";\n}\n?>", "language": "PHP", "metadata": {"date": 1504576245, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/PHP/s850296992.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s850296992", "user_id": "u547838013"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": " $lines[1]){\n echo \"a > b\";\n}else{\n echo \"a == b\";\n}\n?>", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 247, "cpu_time_ms": 10, "memory_kb": 15456}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s277188784", "group_id": "codeNet:p02391", "input_text": " $b){\n\n return \"a > b\";\n\n }else if($a == $b){\n\n return \"a == b\";\n }\n\n }\n\n $num = preg_split('/ /', trim(fgets(STDIN)));\n\n echo(compare($num[0], $num[1]));\n\n?>", "language": "PHP", "metadata": {"date": 1511494108, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/PHP/s277188784.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s277188784", "user_id": "u399951682"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": " $b){\n\n return \"a > b\";\n\n }else if($a == $b){\n\n return \"a == b\";\n }\n\n }\n\n $num = preg_split('/ /', trim(fgets(STDIN)));\n\n echo(compare($num[0], $num[1]));\n\n?>", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 313, "cpu_time_ms": 10, "memory_kb": 15624}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s107829056", "group_id": "codeNet:p02391", "input_text": "", "language": "PHP", "metadata": {"date": 1514326153, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/PHP/s107829056.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s107829056", "user_id": "u301900896"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": "", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 146, "cpu_time_ms": 10, "memory_kb": 9196}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s436649146", "group_id": "codeNet:p02392", "input_text": "\";\n?>\n", "language": "PHP", "metadata": {"date": 1541147276, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02392.html", "problem_id": "p02392", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02392/input.txt", "sample_output_relpath": "derived/input_output/data/p02392/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02392/PHP/s436649146.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s436649146", "user_id": "u878496663"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\";\n?>\n", "problem_context": "Range\n\nWrite a program which reads three integers a, b and c, and prints \"Yes\" if a < b < c, otherwise \"No\".\n\nInput\n\nThree integers a, b and c separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" or \"No\" in a line.\n\nConstraints\n\n0 ≤ a, b, c ≤ 100\n\nSample Input 1\n\n1 3 8\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n3 8 1\n\nSample Output 2\n\nNo", "sample_input": "1 3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02392", "source_text": "Range\n\nWrite a program which reads three integers a, b and c, and prints \"Yes\" if a < b < c, otherwise \"No\".\n\nInput\n\nThree integers a, b and c separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" or \"No\" in a line.\n\nConstraints\n\n0 ≤ a, b, c ≤ 100\n\nSample Input 1\n\n1 3 8\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n3 8 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 181, "cpu_time_ms": 10, "memory_kb": 9204}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s691148555", "group_id": "codeNet:p02392", "input_text": "", "language": "PHP", "metadata": {"date": 1487756411, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02392.html", "problem_id": "p02392", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02392/input.txt", "sample_output_relpath": "derived/input_output/data/p02392/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02392/PHP/s691148555.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s691148555", "user_id": "u816906640"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Range\n\nWrite a program which reads three integers a, b and c, and prints \"Yes\" if a < b < c, otherwise \"No\".\n\nInput\n\nThree integers a, b and c separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" or \"No\" in a line.\n\nConstraints\n\n0 ≤ a, b, c ≤ 100\n\nSample Input 1\n\n1 3 8\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n3 8 1\n\nSample Output 2\n\nNo", "sample_input": "1 3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02392", "source_text": "Range\n\nWrite a program which reads three integers a, b and c, and prints \"Yes\" if a < b < c, otherwise \"No\".\n\nInput\n\nThree integers a, b and c separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" or \"No\" in a line.\n\nConstraints\n\n0 ≤ a, b, c ≤ 100\n\nSample Input 1\n\n1 3 8\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n3 8 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 259, "cpu_time_ms": 10, "memory_kb": 15304}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s466355927", "group_id": "codeNet:p02392", "input_text": "", "language": "PHP", "metadata": {"date": 1495000533, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02393.html", "problem_id": "p02393", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02393/input.txt", "sample_output_relpath": "derived/input_output/data/p02393/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02393/PHP/s932361327.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s932361327", "user_id": "u349320095"}, "prompt_components": {"gold_output": "1 3 8\n", "input_to_evaluate": "", "problem_context": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "sample_input": "3 8 1\n"}, "reference_outputs": ["1 3 8\n"], "source_document_id": "p02393", "source_text": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 584, "cpu_time_ms": 10, "memory_kb": 15220}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s690040531", "group_id": "codeNet:p02394", "input_text": "= 0 && $val[2]-$val[4] >=0;\n$b = $val[1] - ($val[3] + $val[4]) >= 0 && $val[3]-$val[4] >=0;\n\n$r = $a && $b;\n\necho $r ?\"Yes\" :\"No\" ;\n\n?>", "language": "PHP", "metadata": {"date": 1445447244, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02394.html", "problem_id": "p02394", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02394/input.txt", "sample_output_relpath": "derived/input_output/data/p02394/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02394/PHP/s690040531.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s690040531", "user_id": "u994653984"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "= 0 && $val[2]-$val[4] >=0;\n$b = $val[1] - ($val[3] + $val[4]) >= 0 && $val[3]-$val[4] >=0;\n\n$r = $a && $b;\n\necho $r ?\"Yes\" :\"No\" ;\n\n?>", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "sample_input": "5 4 2 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02394", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 227, "cpu_time_ms": 10, "memory_kb": 15380}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s246481775", "group_id": "codeNet:p02394", "input_text": "= 0 && $x + $r <= $W && $y - $r >= 0 && $y + $r <= $H){\n echo \"Yes\";\n}else{\n echo \"No\";\n}\n?>", "language": "PHP", "metadata": {"date": 1472558599, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02394.html", "problem_id": "p02394", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02394/input.txt", "sample_output_relpath": "derived/input_output/data/p02394/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02394/PHP/s246481775.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s246481775", "user_id": "u014927809"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "= 0 && $x + $r <= $W && $y - $r >= 0 && $y + $r <= $H){\n echo \"Yes\";\n}else{\n echo \"No\";\n}\n?>", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "sample_input": "5 4 2 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02394", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 163, "cpu_time_ms": 10, "memory_kb": 15288}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s114460829", "group_id": "codeNet:p02394", "input_text": "$w)|($y+$r>$h)){echo 'No';}\nelse{echo 'Yes';}\n?>", "language": "PHP", "metadata": {"date": 1488023721, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02394.html", "problem_id": "p02394", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02394/input.txt", "sample_output_relpath": "derived/input_output/data/p02394/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02394/PHP/s316798243.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s316798243", "user_id": "u064980217"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$w)|($y+$r>$h)){echo 'No';}\nelse{echo 'Yes';}\n?>", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "sample_input": "5 4 2 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02394", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 138, "cpu_time_ms": 10, "memory_kb": 15432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s823758662", "group_id": "codeNet:p02394", "input_text": "", "language": "PHP", "metadata": {"date": 1497488476, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02394.html", "problem_id": "p02394", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02394/input.txt", "sample_output_relpath": "derived/input_output/data/p02394/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02394/PHP/s823758662.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s823758662", "user_id": "u241518746"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "sample_input": "5 4 2 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02394", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 238, "cpu_time_ms": 10, "memory_kb": 15376}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s470969690", "group_id": "codeNet:p02394", "input_text": "", "language": "PHP", "metadata": {"date": 1497488526, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02394.html", "problem_id": "p02394", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02394/input.txt", "sample_output_relpath": "derived/input_output/data/p02394/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02394/PHP/s470969690.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s470969690", "user_id": "u241518746"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "sample_input": "5 4 2 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02394", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 238, "cpu_time_ms": 10, "memory_kb": 15324}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s027374863", "group_id": "codeNet:p02394", "input_text": "= 0 && $h - $y - $r >= 0) echo 'Yes';\nelse echo 'No';\n?>", "language": "PHP", "metadata": {"date": 1514182582, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02394.html", "problem_id": "p02394", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02394/input.txt", "sample_output_relpath": "derived/input_output/data/p02394/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02394/PHP/s027374863.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s027374863", "user_id": "u845105052"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "= 0 && $h - $y - $r >= 0) echo 'Yes';\nelse echo 'No';\n?>", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "sample_input": "5 4 2 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02394", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 251, "cpu_time_ms": 10, "memory_kb": 9220}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s241667517", "group_id": "codeNet:p02396", "input_text": "", "language": "PHP", "metadata": {"date": 1430148081, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/PHP/s569438764.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s569438764", "user_id": "u330842660"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 258, "cpu_time_ms": 20, "memory_kb": 8360}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s415417868", "group_id": "codeNet:p02396", "input_text": "", "language": "PHP", "metadata": {"date": 1496002861, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/PHP/s904384716.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s904384716", "user_id": "u349320095"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 172, "cpu_time_ms": 60, "memory_kb": 15136}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s623089720", "group_id": "codeNet:p02396", "input_text": "\t", "language": "PHP", "metadata": {"date": 1497494772, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/PHP/s623089720.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s623089720", "user_id": "u241518746"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "\t", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 153, "cpu_time_ms": 40000, "memory_kb": 15064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s786484087", "group_id": "codeNet:p02396", "input_text": "", "language": "PHP", "metadata": {"date": 1501684455, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/PHP/s786484087.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s786484087", "user_id": "u989420736"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 175, "cpu_time_ms": 50, "memory_kb": 15048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s245283752", "group_id": "codeNet:p02396", "input_text": "", "language": "PHP", "metadata": {"date": 1501684598, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/PHP/s245283752.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s245283752", "user_id": "u989420736"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 151, "cpu_time_ms": 40, "memory_kb": 15092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s653550988", "group_id": "codeNet:p02396", "input_text": "", "language": "PHP", "metadata": {"date": 1511505857, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/PHP/s653550988.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s653550988", "user_id": "u399951682"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 220, "cpu_time_ms": 50, "memory_kb": 15432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s712421463", "group_id": "codeNet:p02396", "input_text": "\n", "language": "PHP", "metadata": {"date": 1590150735, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/PHP/s712421463.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s712421463", "user_id": "u631824216"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "\n", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 473, "cpu_time_ms": 70, "memory_kb": 9200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s014427400", "group_id": "codeNet:p02397", "input_text": "", "language": "PHP", "metadata": {"date": 1475790082, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02398.html", "problem_id": "p02398", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02398/input.txt", "sample_output_relpath": "derived/input_output/data/p02398/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02398/PHP/s847902571.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s847902571", "user_id": "u441889394"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "How Many Divisors?\n\nWrite a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.\n\nInput\n\nThree integers a, b and c are given in a line separated by a single space.\n\nOutput\n\nPrint the number of divisors in a line.\n\nConstraints\n\n1 ≤ a, b, c ≤ 10000\n\na ≤ b\n\nSample Input 1\n\n5 14 80\n\nSample Output 1\n\n3", "sample_input": "5 14 80\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02398", "source_text": "How Many Divisors?\n\nWrite a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.\n\nInput\n\nThree integers a, b and c are given in a line separated by a single space.\n\nOutput\n\nPrint the number of divisors in a line.\n\nConstraints\n\n1 ≤ a, b, c ≤ 10000\n\na ≤ b\n\nSample Input 1\n\n5 14 80\n\nSample Output 1\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 210, "cpu_time_ms": 10, "memory_kb": 15376}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s145030584", "group_id": "codeNet:p02399", "input_text": "", "language": "PHP", "metadata": {"date": 1435699871, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02399.html", "problem_id": "p02399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02399/input.txt", "sample_output_relpath": "derived/input_output/data/p02399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02399/PHP/s145030584.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s145030584", "user_id": "u604774382"}, "prompt_components": {"gold_output": "1 1 1.50000\n", "input_to_evaluate": "", "problem_context": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "sample_input": "3 2\n"}, "reference_outputs": ["1 1 1.50000\n"], "source_document_id": "p02399", "source_text": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 118, "cpu_time_ms": 10, "memory_kb": 6524}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s229278156", "group_id": "codeNet:p02399", "input_text": "", "language": "PHP", "metadata": {"date": 1488035800, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02399.html", "problem_id": "p02399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02399/input.txt", "sample_output_relpath": "derived/input_output/data/p02399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02399/PHP/s229278156.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s229278156", "user_id": "u064980217"}, "prompt_components": {"gold_output": "1 1 1.50000\n", "input_to_evaluate": "", "problem_context": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "sample_input": "3 2\n"}, "reference_outputs": ["1 1 1.50000\n"], "source_document_id": "p02399", "source_text": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 135, "cpu_time_ms": 10, "memory_kb": 15208}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s288463537", "group_id": "codeNet:p02400", "input_text": "execute();\n\nclass Main {\n\n public function execute()\n {\n while (true) {\n fscanf(STDIN, '%d %d', $height, $width);\n\n if (! $this->canExecute($width, $height)) return;\n\n $rect = new Rectangle($width, $height);\n $rect->draw();\n }\n }\n\n public function canExecute($width, $height)\n {\n return ($width != 0) && ($height != 0);\n }\n\n}\n\n\n/**\n * ????????¢???????????????\n */\nclass Rectangle {\n private $width;\n private $height;\n private $char = '#';\n\n public function __construct($width, $height)\n {\n $this->width = $width;\n $this->height = $height;\n }\n\n public function draw()\n {\n for ($line = 0; $line < $this->height; $line++) {\n $this->drawLine($this->width, $this->char);\n }\n $this->drawEmptyLine();\n }\n\n public function drawLine()\n {\n echo str_repeat($this->char, $this->width), PHP_EOL;\n }\n\n public function drawEmptyLine()\n {\n echo PHP_EOL;\n }\n\n}", "language": "PHP", "metadata": {"date": 1470049645, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02403.html", "problem_id": "p02403", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02403/input.txt", "sample_output_relpath": "derived/input_output/data/p02403/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02403/PHP/s056855157.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s056855157", "user_id": "u668475103"}, "prompt_components": {"gold_output": "####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##\n", "input_to_evaluate": "execute();\n\nclass Main {\n\n public function execute()\n {\n while (true) {\n fscanf(STDIN, '%d %d', $height, $width);\n\n if (! $this->canExecute($width, $height)) return;\n\n $rect = new Rectangle($width, $height);\n $rect->draw();\n }\n }\n\n public function canExecute($width, $height)\n {\n return ($width != 0) && ($height != 0);\n }\n\n}\n\n\n/**\n * ????????¢???????????????\n */\nclass Rectangle {\n private $width;\n private $height;\n private $char = '#';\n\n public function __construct($width, $height)\n {\n $this->width = $width;\n $this->height = $height;\n }\n\n public function draw()\n {\n for ($line = 0; $line < $this->height; $line++) {\n $this->drawLine($this->width, $this->char);\n }\n $this->drawEmptyLine();\n }\n\n public function drawLine()\n {\n echo str_repeat($this->char, $this->width), PHP_EOL;\n }\n\n public function drawEmptyLine()\n {\n echo PHP_EOL;\n }\n\n}", "problem_context": "Print a Rectangle\n\nDraw a rectangle which has a height of H cm and a width of W cm. Draw a 1-cm square by single '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the rectangle made of H × W '#'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n2 2\n0 0\n\nSample Output\n\n####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##", "sample_input": "3 4\n5 6\n2 2\n0 0\n"}, "reference_outputs": ["####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##\n"], "source_document_id": "p02403", "source_text": "Print a Rectangle\n\nDraw a rectangle which has a height of H cm and a width of W cm. Draw a 1-cm square by single '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the rectangle made of H × W '#'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n2 2\n0 0\n\nSample Output\n\n####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1066, "cpu_time_ms": 20, "memory_kb": 15432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s213844995", "group_id": "codeNet:p02404", "input_text": "execute();\n\n\nclass Rectangle\n{\n private $height;\n private $width;\n private $style;\n\n private $rectangle = [];\n\n public function __construct($height, $width, $style)\n {\n $this->height = $height;\n $this->width = $width;\n $this->style = $style;\n\n $this->rectangle = $this->make();\n }\n\n private function make()\n {\n $rectangle = [];\n for ($height = 0; $height < $this->height; $height++) {\n $rectangle[$height] = str_repeat($this->style, $this->width);\n }\n return $rectangle;\n }\n\n private function setColsInnerFrame($thickness, $style)\n {\n foreach ($this->rectangle as $height => $_) {\n for ($width = 0; $width < $thickness; $width++) {\n $this->rectangle[$height][$width] = $style;\n $this->rectangle[$height][$this->width - $width - 1] = $style;\n }\n }\n }\n\n private function setRowsInnerFrame($thickness, $style)\n {\n foreach ($this->rectangle as $height => $_) {\n if ($height >= $thickness) { return; }\n\n $this->rectangle[$height] = str_repeat($style, $this->width);\n $this->rectangle[$this->height - $height - 1] = str_repeat($style, $this->width);\n }\n }\n\n public function setCheckerboardPattern($style = '#')\n {\n $checkLine = str_pad('', $this->width + 1, $style.$this->style);\n\n foreach ($this->rectangle as $height => $_) {\n $row = substr($checkLine, $height % 2, $this->width);\n $this->rectangle[$height] = $row;\n }\n\n return $this;\n }\n\n public function setInnerFrame($thickness = 1, $style = '#')\n {\n if ($thickness > $this->width) {\n $thickness = $this->width;\n }\n\n $this->setRowsInnerFrame($thickness, $style);\n $this->setColsInnerFrame($thickness, $style);\n\n return $this;\n }\n\n public function get()\n {\n return implode(PHP_EOL, $this->rectangle).PHP_EOL;\n }\n}\n\nclass Main\n{\n public function execute()\n {\n while (true) {\n list($height, $width) = $this->getStdinExplodedBy(' ');\n if ($this->invalid($height, $width)) { return; }\n\n $rectangle = (new Rectangle($height, $width, '.'))\n ->setInnerFrame(1, '#')\n ->get();\n\n $this->draw($rectangle);\n }\n }\n\n private function getStdinExplodedBy($delimiter)\n {\n return explode($delimiter, trim(fgets(STDIN)));\n }\n\n private function invalid($height, $width)\n {\n return $height == 0 && $width == 0;\n }\n\n public function draw($shape)\n {\n echo $shape, PHP_EOL;\n }\n}", "language": "PHP", "metadata": {"date": 1470656852, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02404.html", "problem_id": "p02404", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02404/input.txt", "sample_output_relpath": "derived/input_output/data/p02404/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02404/PHP/s213844995.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s213844995", "user_id": "u173452553"}, "prompt_components": {"gold_output": "####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###\n", "input_to_evaluate": "execute();\n\n\nclass Rectangle\n{\n private $height;\n private $width;\n private $style;\n\n private $rectangle = [];\n\n public function __construct($height, $width, $style)\n {\n $this->height = $height;\n $this->width = $width;\n $this->style = $style;\n\n $this->rectangle = $this->make();\n }\n\n private function make()\n {\n $rectangle = [];\n for ($height = 0; $height < $this->height; $height++) {\n $rectangle[$height] = str_repeat($this->style, $this->width);\n }\n return $rectangle;\n }\n\n private function setColsInnerFrame($thickness, $style)\n {\n foreach ($this->rectangle as $height => $_) {\n for ($width = 0; $width < $thickness; $width++) {\n $this->rectangle[$height][$width] = $style;\n $this->rectangle[$height][$this->width - $width - 1] = $style;\n }\n }\n }\n\n private function setRowsInnerFrame($thickness, $style)\n {\n foreach ($this->rectangle as $height => $_) {\n if ($height >= $thickness) { return; }\n\n $this->rectangle[$height] = str_repeat($style, $this->width);\n $this->rectangle[$this->height - $height - 1] = str_repeat($style, $this->width);\n }\n }\n\n public function setCheckerboardPattern($style = '#')\n {\n $checkLine = str_pad('', $this->width + 1, $style.$this->style);\n\n foreach ($this->rectangle as $height => $_) {\n $row = substr($checkLine, $height % 2, $this->width);\n $this->rectangle[$height] = $row;\n }\n\n return $this;\n }\n\n public function setInnerFrame($thickness = 1, $style = '#')\n {\n if ($thickness > $this->width) {\n $thickness = $this->width;\n }\n\n $this->setRowsInnerFrame($thickness, $style);\n $this->setColsInnerFrame($thickness, $style);\n\n return $this;\n }\n\n public function get()\n {\n return implode(PHP_EOL, $this->rectangle).PHP_EOL;\n }\n}\n\nclass Main\n{\n public function execute()\n {\n while (true) {\n list($height, $width) = $this->getStdinExplodedBy(' ');\n if ($this->invalid($height, $width)) { return; }\n\n $rectangle = (new Rectangle($height, $width, '.'))\n ->setInnerFrame(1, '#')\n ->get();\n\n $this->draw($rectangle);\n }\n }\n\n private function getStdinExplodedBy($delimiter)\n {\n return explode($delimiter, trim(fgets(STDIN)));\n }\n\n private function invalid($height, $width)\n {\n return $height == 0 && $width == 0;\n }\n\n public function draw($shape)\n {\n echo $shape, PHP_EOL;\n }\n}", "problem_context": "Print a Frame\n\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm.\n\n##########\n#........#\n#........#\n#........#\n#........#\n##########\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the frame made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n3 ≤ H ≤ 300\n\n3 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n0 0\n\nSample Output\n\n####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###", "sample_input": "3 4\n5 6\n3 3\n0 0\n"}, "reference_outputs": ["####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###\n"], "source_document_id": "p02404", "source_text": "Print a Frame\n\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm.\n\n##########\n#........#\n#........#\n#........#\n#........#\n##########\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the frame made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n3 ≤ H ≤ 300\n\n3 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n0 0\n\nSample Output\n\n####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2766, "cpu_time_ms": 10, "memory_kb": 15408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s996921985", "group_id": "codeNet:p02405", "input_text": "", "language": "PHP", "metadata": {"date": 1491738515, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02405.html", "problem_id": "p02405", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02405/input.txt", "sample_output_relpath": "derived/input_output/data/p02405/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02405/PHP/s996921985.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s996921985", "user_id": "u458439832"}, "prompt_components": {"gold_output": "#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n", "input_to_evaluate": "", "problem_context": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "sample_input": "3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n"}, "reference_outputs": ["#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n"], "source_document_id": "p02405", "source_text": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 373, "cpu_time_ms": 10, "memory_kb": 14992}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s651006439", "group_id": "codeNet:p02405", "input_text": "0){\n if($a%10==3){\n $flag=true;\n }\n $a/=10;\n }\n if($flag){\n echo \" \" . $i;\n }\n if($i==$n)break;\n $i++;\n }\n ?>", "language": "PHP", "metadata": {"date": 1484228138, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02406.html", "problem_id": "p02406", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02406/input.txt", "sample_output_relpath": "derived/input_output/data/p02406/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02406/PHP/s612406177.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s612406177", "user_id": "u186082958"}, "prompt_components": {"gold_output": " 3 6 9 12 13 15 18 21 23 24 27 30\n", "input_to_evaluate": "0){\n if($a%10==3){\n $flag=true;\n }\n $a/=10;\n }\n if($flag){\n echo \" \" . $i;\n }\n if($i==$n)break;\n $i++;\n }\n ?>", "problem_context": "Structured Programming\n\nIn programming languages like C/C++, a goto statement provides an unconditional jump from the \"goto\" to a labeled statement. For example, a statement \"goto CHECK_NUM;\" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.\n\nNote that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.\n\nWrite a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.\n\nvoid call(int n){\nint i = 1;\nCHECK_NUM:\nint x = i;\nif ( x % 3 == 0 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nINCLUDE3:\nif ( x % 10 == 3 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nx /= 10;\nif ( x ) goto INCLUDE3;\nEND_CHECK_NUM:\nif ( ++i <= n ) goto CHECK_NUM;\n\ncout << endl;\n}\n\nInput\n\nAn integer n is given in a line.\n\nOutput\n\nPrint the output result of the above program for given integer n.\n\nConstraints\n\n3 ≤ n ≤ 10000\n\nSample Input\n\n30\n\nSample Output\n\n3 6 9 12 13 15 18 21 23 24 27 30\n\nPut a single space character before each element.", "sample_input": "30\n"}, "reference_outputs": [" 3 6 9 12 13 15 18 21 23 24 27 30\n"], "source_document_id": "p02406", "source_text": "Structured Programming\n\nIn programming languages like C/C++, a goto statement provides an unconditional jump from the \"goto\" to a labeled statement. For example, a statement \"goto CHECK_NUM;\" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.\n\nNote that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.\n\nWrite a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.\n\nvoid call(int n){\nint i = 1;\nCHECK_NUM:\nint x = i;\nif ( x % 3 == 0 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nINCLUDE3:\nif ( x % 10 == 3 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nx /= 10;\nif ( x ) goto INCLUDE3;\nEND_CHECK_NUM:\nif ( ++i <= n ) goto CHECK_NUM;\n\ncout << endl;\n}\n\nInput\n\nAn integer n is given in a line.\n\nOutput\n\nPrint the output result of the above program for given integer n.\n\nConstraints\n\n3 ≤ n ≤ 10000\n\nSample Input\n\n30\n\nSample Output\n\n3 6 9 12 13 15 18 21 23 24 27 30\n\nPut a single space character before each element.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 375, "cpu_time_ms": 10, "memory_kb": 15272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s180984926", "group_id": "codeNet:p02406", "input_text": "0){\n if($a%10==3){\n $flag=true;\n }\n $a/=10;\n }\n if($flag){\n echo \" \".$i;\n }\n if($i==$n)break;\n $i++;\n }\n echo \"\\n\";", "language": "PHP", "metadata": {"date": 1484228428, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02406.html", "problem_id": "p02406", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02406/input.txt", "sample_output_relpath": "derived/input_output/data/p02406/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02406/PHP/s180984926.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s180984926", "user_id": "u186082958"}, "prompt_components": {"gold_output": " 3 6 9 12 13 15 18 21 23 24 27 30\n", "input_to_evaluate": "0){\n if($a%10==3){\n $flag=true;\n }\n $a/=10;\n }\n if($flag){\n echo \" \".$i;\n }\n if($i==$n)break;\n $i++;\n }\n echo \"\\n\";", "problem_context": "Structured Programming\n\nIn programming languages like C/C++, a goto statement provides an unconditional jump from the \"goto\" to a labeled statement. For example, a statement \"goto CHECK_NUM;\" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.\n\nNote that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.\n\nWrite a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.\n\nvoid call(int n){\nint i = 1;\nCHECK_NUM:\nint x = i;\nif ( x % 3 == 0 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nINCLUDE3:\nif ( x % 10 == 3 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nx /= 10;\nif ( x ) goto INCLUDE3;\nEND_CHECK_NUM:\nif ( ++i <= n ) goto CHECK_NUM;\n\ncout << endl;\n}\n\nInput\n\nAn integer n is given in a line.\n\nOutput\n\nPrint the output result of the above program for given integer n.\n\nConstraints\n\n3 ≤ n ≤ 10000\n\nSample Input\n\n30\n\nSample Output\n\n3 6 9 12 13 15 18 21 23 24 27 30\n\nPut a single space character before each element.", "sample_input": "30\n"}, "reference_outputs": [" 3 6 9 12 13 15 18 21 23 24 27 30\n"], "source_document_id": "p02406", "source_text": "Structured Programming\n\nIn programming languages like C/C++, a goto statement provides an unconditional jump from the \"goto\" to a labeled statement. For example, a statement \"goto CHECK_NUM;\" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.\n\nNote that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.\n\nWrite a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.\n\nvoid call(int n){\nint i = 1;\nCHECK_NUM:\nint x = i;\nif ( x % 3 == 0 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nINCLUDE3:\nif ( x % 10 == 3 ){\ncout << \" \" << i;\ngoto END_CHECK_NUM;\n}\nx /= 10;\nif ( x ) goto INCLUDE3;\nEND_CHECK_NUM:\nif ( ++i <= n ) goto CHECK_NUM;\n\ncout << endl;\n}\n\nInput\n\nAn integer n is given in a line.\n\nOutput\n\nPrint the output result of the above program for given integer n.\n\nConstraints\n\n3 ≤ n ≤ 10000\n\nSample Input\n\n30\n\nSample Output\n\n3 6 9 12 13 15 18 21 23 24 27 30\n\nPut a single space character before each element.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 384, "cpu_time_ms": 150, "memory_kb": 15356}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s205925109", "group_id": "codeNet:p02406", "input_text": "0) echo join($missing_card_set,PHP_EOL),PHP_EOL;", "language": "PHP", "metadata": {"date": 1476413416, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02408.html", "problem_id": "p02408", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02408/input.txt", "sample_output_relpath": "derived/input_output/data/p02408/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02408/PHP/s079562271.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s079562271", "user_id": "u441889394"}, "prompt_components": {"gold_output": "S 1\nH 3\nH 7\nC 12\nD 8\n", "input_to_evaluate": "0) echo join($missing_card_set,PHP_EOL),PHP_EOL;", "problem_context": "Finding Missing Cards\n\nTaro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers).\n\nThe 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond.\n\nInput\n\nIn the first line, the number of cards n (n ≤ 52) is given.\n\nIn the following n lines, data of the n cards are given. Each card is given by a pair of a character and an integer which represent its suit and rank respectively. A suit is represented by 'S', 'H', 'C' and 'D' for spades, hearts, clubs and diamonds respectively. A rank is represented by an integer from 1 to 13.\n\nOutput\n\nPrint the missing cards. The same as the input format, each card should be printed with a character and an integer separated by a space character in a line.\nArrange the missing cards in the following priorities:\n\nPrint cards of spades, hearts, clubs and diamonds in this order.\n\nIf the suits are equal, print cards with lower ranks first.\n\nSample Input\n\n47\nS 10\nS 11\nS 12\nS 13\nH 1\nH 2\nS 6\nS 7\nS 8\nS 9\nH 6\nH 8\nH 9\nH 10\nH 11\nH 4\nH 5\nS 2\nS 3\nS 4\nS 5\nH 12\nH 13\nC 1\nC 2\nD 1\nD 2\nD 3\nD 4\nD 5\nD 6\nD 7\nC 3\nC 4\nC 5\nC 6\nC 7\nC 8\nC 9\nC 10\nC 11\nC 13\nD 9\nD 10\nD 11\nD 12\nD 13\n\nSample Output\n\nS 1\nH 3\nH 7\nC 12\nD 8\n\nNote\n\n      解説", "sample_input": "47\nS 10\nS 11\nS 12\nS 13\nH 1\nH 2\nS 6\nS 7\nS 8\nS 9\nH 6\nH 8\nH 9\nH 10\nH 11\nH 4\nH 5\nS 2\nS 3\nS 4\nS 5\nH 12\nH 13\nC 1\nC 2\nD 1\nD 2\nD 3\nD 4\nD 5\nD 6\nD 7\nC 3\nC 4\nC 5\nC 6\nC 7\nC 8\nC 9\nC 10\nC 11\nC 13\nD 9\nD 10\nD 11\nD 12\nD 13\n"}, "reference_outputs": ["S 1\nH 3\nH 7\nC 12\nD 8\n"], "source_document_id": "p02408", "source_text": "Finding Missing Cards\n\nTaro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers).\n\nThe 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond.\n\nInput\n\nIn the first line, the number of cards n (n ≤ 52) is given.\n\nIn the following n lines, data of the n cards are given. Each card is given by a pair of a character and an integer which represent its suit and rank respectively. A suit is represented by 'S', 'H', 'C' and 'D' for spades, hearts, clubs and diamonds respectively. A rank is represented by an integer from 1 to 13.\n\nOutput\n\nPrint the missing cards. The same as the input format, each card should be printed with a character and an integer separated by a space character in a line.\nArrange the missing cards in the following priorities:\n\nPrint cards of spades, hearts, clubs and diamonds in this order.\n\nIf the suits are equal, print cards with lower ranks first.\n\nSample Input\n\n47\nS 10\nS 11\nS 12\nS 13\nH 1\nH 2\nS 6\nS 7\nS 8\nS 9\nH 6\nH 8\nH 9\nH 10\nH 11\nH 4\nH 5\nS 2\nS 3\nS 4\nS 5\nH 12\nH 13\nC 1\nC 2\nD 1\nD 2\nD 3\nD 4\nD 5\nD 6\nD 7\nC 3\nC 4\nC 5\nC 6\nC 7\nC 8\nC 9\nC 10\nC 11\nC 13\nD 9\nD 10\nD 11\nD 12\nD 13\n\nSample Output\n\nS 1\nH 3\nH 7\nC 12\nD 8\n\nNote\n\n      解説", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 458, "cpu_time_ms": 10, "memory_kb": 15320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s920713601", "group_id": "codeNet:p02409", "input_text": "execute();\n\nclass Main\n{\n public function execute()\n {\n $house = new House();\n $n = getInput();\n for ($i = 0; $i < $n; $i++) {\n fscanf(STDIN, '%d %d %d %d', $b, $f, $r, $v);\n $house->put($b, $f, $r, $v);\n }\n $tenant = $house->merge();\n echo $house->merge2($tenant);\n }\n}\n\nclass House\n{\n private $room;\n private $floor;\n private $buildings;\n \n public function __construct()\n {\n $rooms = array_fill_keys(range(1, 10), 0);\n $floors = array_fill_keys(range(1, 3), $rooms);\n $buildings = array_fill_keys(range(1, 4), $floors);\n }\n \n public function put($b, $f, $r, $v)\n {\n $this->buildings[$b][$f][$r] = $v;\n }\n \n public function merge()\n {\n foreach ($this->buildings as $floors) {\n $floor = array();\n foreach ($floors as $rooms) {\n $floor[] = sprintf(' %s%s', implode(' ', $rooms), PHP_EOL);\n }\n $tenant[] = implode('', $floor);\n \n }\n return $tenant;\n }\n \n public function merge2($tenant)\n {\n return implode(str_repeat('#', 20) . \"\\n\", $tenant);\n }\n}\n\nfunction getInput()\n{\n return trim(getInput());\n}", "language": "PHP", "metadata": {"date": 1476189126, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02409.html", "problem_id": "p02409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02409/input.txt", "sample_output_relpath": "derived/input_output/data/p02409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02409/PHP/s920713601.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s920713601", "user_id": "u291836200"}, "prompt_components": {"gold_output": " 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n", "input_to_evaluate": "execute();\n\nclass Main\n{\n public function execute()\n {\n $house = new House();\n $n = getInput();\n for ($i = 0; $i < $n; $i++) {\n fscanf(STDIN, '%d %d %d %d', $b, $f, $r, $v);\n $house->put($b, $f, $r, $v);\n }\n $tenant = $house->merge();\n echo $house->merge2($tenant);\n }\n}\n\nclass House\n{\n private $room;\n private $floor;\n private $buildings;\n \n public function __construct()\n {\n $rooms = array_fill_keys(range(1, 10), 0);\n $floors = array_fill_keys(range(1, 3), $rooms);\n $buildings = array_fill_keys(range(1, 4), $floors);\n }\n \n public function put($b, $f, $r, $v)\n {\n $this->buildings[$b][$f][$r] = $v;\n }\n \n public function merge()\n {\n foreach ($this->buildings as $floors) {\n $floor = array();\n foreach ($floors as $rooms) {\n $floor[] = sprintf(' %s%s', implode(' ', $rooms), PHP_EOL);\n }\n $tenant[] = implode('', $floor);\n \n }\n return $tenant;\n }\n \n public function merge2($tenant)\n {\n return implode(str_repeat('#', 20) . \"\\n\", $tenant);\n }\n}\n\nfunction getInput()\n{\n return trim(getInput());\n}", "problem_context": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "sample_input": "3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n"}, "reference_outputs": [" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"], "source_document_id": "p02409", "source_text": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1282, "cpu_time_ms": 50, "memory_kb": 41924}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s258492567", "group_id": "codeNet:p02409", "input_text": " $value1){\n foreach($value1 as $key2 => $value2){\n print \" \".implode(\" \",$value2).\"\\n\";\n }\n if($key1 == $record_num - 1) exit;\n print $bar.\"\\n\";\n }", "language": "PHP", "metadata": {"date": 1499939523, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02409.html", "problem_id": "p02409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02409/input.txt", "sample_output_relpath": "derived/input_output/data/p02409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02409/PHP/s258492567.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s258492567", "user_id": "u571747694"}, "prompt_components": {"gold_output": " 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n", "input_to_evaluate": " $value1){\n foreach($value1 as $key2 => $value2){\n print \" \".implode(\" \",$value2).\"\\n\";\n }\n if($key1 == $record_num - 1) exit;\n print $bar.\"\\n\";\n }", "problem_context": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "sample_input": "3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n"}, "reference_outputs": [" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"], "source_document_id": "p02409", "source_text": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 628, "cpu_time_ms": 10, "memory_kb": 15276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s600168594", "group_id": "codeNet:p02409", "input_text": " $value) {\n foreach ($value as $k => $v) {\n echo ' ';\n echo implode(' ',$v);\n echo PHP_EOL;\n }\n echo '####################';\n echo PHP_EOL;\n }", "language": "PHP", "metadata": {"date": 1513245733, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02409.html", "problem_id": "p02409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02409/input.txt", "sample_output_relpath": "derived/input_output/data/p02409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02409/PHP/s600168594.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s600168594", "user_id": "u073923014"}, "prompt_components": {"gold_output": " 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n", "input_to_evaluate": " $value) {\n foreach ($value as $k => $v) {\n echo ' ';\n echo implode(' ',$v);\n echo PHP_EOL;\n }\n echo '####################';\n echo PHP_EOL;\n }", "problem_context": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "sample_input": "3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n"}, "reference_outputs": [" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"], "source_document_id": "p02409", "source_text": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 759, "cpu_time_ms": 10, "memory_kb": 9316}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s600433934", "group_id": "codeNet:p02409", "input_text": " $value) {\n if ($key != 0)\n echo '####################'. PHP_EOL;\n foreach ($value as $k => $v) {\n echo ' ';\n echo implode(' ',$v);\n echo PHP_EOL;\n }\n }", "language": "PHP", "metadata": {"date": 1513246255, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02409.html", "problem_id": "p02409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02409/input.txt", "sample_output_relpath": "derived/input_output/data/p02409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02409/PHP/s600433934.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s600433934", "user_id": "u073923014"}, "prompt_components": {"gold_output": " 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n", "input_to_evaluate": " $value) {\n if ($key != 0)\n echo '####################'. PHP_EOL;\n foreach ($value as $k => $v) {\n echo ' ';\n echo implode(' ',$v);\n echo PHP_EOL;\n }\n }", "problem_context": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "sample_input": "3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n"}, "reference_outputs": [" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"], "source_document_id": "p02409", "source_text": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 769, "cpu_time_ms": 10, "memory_kb": 9328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s915680759", "group_id": "codeNet:p02409", "input_text": " $value) {\n if ($key != 0)\n echo '####################'. PHP_EOL;\n foreach ($value as $k => $v) {\n echo ' ';\n echo implode(' ',$v);\n echo PHP_EOL;\n }\n }", "language": "PHP", "metadata": {"date": 1513246376, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02409.html", "problem_id": "p02409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02409/input.txt", "sample_output_relpath": "derived/input_output/data/p02409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02409/PHP/s915680759.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s915680759", "user_id": "u073923014"}, "prompt_components": {"gold_output": " 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n", "input_to_evaluate": " $value) {\n if ($key != 0)\n echo '####################'. PHP_EOL;\n foreach ($value as $k => $v) {\n echo ' ';\n echo implode(' ',$v);\n echo PHP_EOL;\n }\n }", "problem_context": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "sample_input": "3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n"}, "reference_outputs": [" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"], "source_document_id": "p02409", "source_text": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 832, "cpu_time_ms": 10, "memory_kb": 9336}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s690133147", "group_id": "codeNet:p02409", "input_text": "= 0 and $b < BUILD and\n $f >= 0 and $f < STEP and\n $r >= 0 and $r < ROOM and\n $v < NINZU\n )\n {\n switch($b)\n {\n case 0:\n $ninzu = $v + $array_bld1[$f][$r];\n break;\n case 1:\n $ninzu = $v + $array_bld2[$f][$r];\n break;\n case 2:\n $ninzu = $v + $array_bld3[$f][$r];\n break;\n case 3:\n $ninzu = $v + $array_bld4[$f][$r];\n break;\n default:\n echo \"error\\n\";\n break;\n }\n\n // 管理過程での入居者数確認\n if( 0 <= $ninzu and\n NINZU > $ninzu\n )\n {\n switch($b)\n {\n case 0:\n $array_bld1[$f][$r] = $ninzu;\n break;\n case 1:\n $array_bld2[$f][$r] = $ninzu;\n break;\n case 2:\n $array_bld3[$f][$r] = $ninzu;\n break;\n case 3:\n $array_bld4[$f][$r] = $ninzu;\n break;\n default:\n echo \"error\\n\";\n break;\n }\n }\n }\n }\n\n // 結果出力\n for($loop_cnt1 = 0; $loop_cnt1 < BUILD; $loop_cnt1++)\n {\n for($loop_cnt2 = 0; $loop_cnt2 < STEP; $loop_cnt2++)\n {\n for($loop_cnt3 = 0; $loop_cnt3 < ROOM; $loop_cnt3++)\n {\n switch($loop_cnt1)\n {\n case 0:\n echo $array_bld1[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n case 1:\n echo $array_bld2[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n case 2:\n echo $array_bld3[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n case 3:\n echo $array_bld4[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n default:\n echo \"error\\n\";\n break;\n }\n }\n echo \"\\n\";\n }\n if($loop_cnt1 != BUILD-1)\n {\n echo AIDA;\n echo \"\\n\";\n }\n }\n", "language": "PHP", "metadata": {"date": 1522720466, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02409.html", "problem_id": "p02409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02409/input.txt", "sample_output_relpath": "derived/input_output/data/p02409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02409/PHP/s690133147.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s690133147", "user_id": "u954858867"}, "prompt_components": {"gold_output": " 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n", "input_to_evaluate": "= 0 and $b < BUILD and\n $f >= 0 and $f < STEP and\n $r >= 0 and $r < ROOM and\n $v < NINZU\n )\n {\n switch($b)\n {\n case 0:\n $ninzu = $v + $array_bld1[$f][$r];\n break;\n case 1:\n $ninzu = $v + $array_bld2[$f][$r];\n break;\n case 2:\n $ninzu = $v + $array_bld3[$f][$r];\n break;\n case 3:\n $ninzu = $v + $array_bld4[$f][$r];\n break;\n default:\n echo \"error\\n\";\n break;\n }\n\n // 管理過程での入居者数確認\n if( 0 <= $ninzu and\n NINZU > $ninzu\n )\n {\n switch($b)\n {\n case 0:\n $array_bld1[$f][$r] = $ninzu;\n break;\n case 1:\n $array_bld2[$f][$r] = $ninzu;\n break;\n case 2:\n $array_bld3[$f][$r] = $ninzu;\n break;\n case 3:\n $array_bld4[$f][$r] = $ninzu;\n break;\n default:\n echo \"error\\n\";\n break;\n }\n }\n }\n }\n\n // 結果出力\n for($loop_cnt1 = 0; $loop_cnt1 < BUILD; $loop_cnt1++)\n {\n for($loop_cnt2 = 0; $loop_cnt2 < STEP; $loop_cnt2++)\n {\n for($loop_cnt3 = 0; $loop_cnt3 < ROOM; $loop_cnt3++)\n {\n switch($loop_cnt1)\n {\n case 0:\n echo $array_bld1[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n case 1:\n echo $array_bld2[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n case 2:\n echo $array_bld3[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n case 3:\n echo $array_bld4[$loop_cnt2][$loop_cnt3] , \" \";\n break;\n default:\n echo \"error\\n\";\n break;\n }\n }\n echo \"\\n\";\n }\n if($loop_cnt1 != BUILD-1)\n {\n echo AIDA;\n echo \"\\n\";\n }\n }\n", "problem_context": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "sample_input": "3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n"}, "reference_outputs": [" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"], "source_document_id": "p02409", "source_text": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4926, "cpu_time_ms": 10, "memory_kb": 9388}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s395333809", "group_id": "codeNet:p02411", "input_text": "= 80) {\n echo \"A\\n\";\n } elseif (($m + $f) < 80 && ($m + $f) >= 65 ) {\n echo \"B\\n\";\n } elseif (($m + $f) < 65 && ($m + $f) >= 50 ) {\n echo \"C\\n\";\n } elseif (($m + $f) < 50 && ($m + $f) >= 30 ) {\n if ($r >= 50) {\n echo \"C\\n\";\n } else {\n echo \"D\\n\";\n }\n } elseif (($m + $f) < 30 ) {\n echo \"F\\n\";\n }\n }\n}", "language": "PHP", "metadata": {"date": 1481768683, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02411.html", "problem_id": "p02411", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02411/input.txt", "sample_output_relpath": "derived/input_output/data/p02411/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02411/PHP/s395333809.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s395333809", "user_id": "u759791460"}, "prompt_components": {"gold_output": "A\nC\nF\n", "input_to_evaluate": "= 80) {\n echo \"A\\n\";\n } elseif (($m + $f) < 80 && ($m + $f) >= 65 ) {\n echo \"B\\n\";\n } elseif (($m + $f) < 65 && ($m + $f) >= 50 ) {\n echo \"C\\n\";\n } elseif (($m + $f) < 50 && ($m + $f) >= 30 ) {\n if ($r >= 50) {\n echo \"C\\n\";\n } else {\n echo \"D\\n\";\n }\n } elseif (($m + $f) < 30 ) {\n echo \"F\\n\";\n }\n }\n}", "problem_context": "Grading\n\nWrite a program which reads a list of student test scores and evaluates the performance for each student.\n\nThe test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup examination r (out of 100). If the student does not take the examination, the score is indicated by -1.\n\nThe final performance of a student is evaluated by the following procedure:\n\nIf the student does not take the midterm or final examination, the student's grade shall be F.\n\nIf the total score of the midterm and final examination is greater than or equal to 80, the student's grade shall be A.\n\nIf the total score of the midterm and final examination is greater than or equal to 65 and less than 80, the student's grade shall be B.\n\nIf the total score of the midterm and final examination is greater than or equal to 50 and less than 65, the student's grade shall be C.\n\nIf the total score of the midterm and final examination is greater than or equal to 30 and less than 50, the student's grade shall be D. However, if the score of the makeup examination is greater than or equal to 50, the grade shall be C.\n\nIf the total score of the midterm and final examination is less than 30, the student's grade shall be F.\n\nInput\n\nThe input consists of multiple datasets. For each dataset, three integers m, f and r are given in a line.\n\nThe input ends with three -1 for m, f and r respectively. Your program should not process for the terminal symbols.\n\nThe number of datasets (the number of students) does not exceed 50.\n\nOutput\n\nFor each dataset, print the grade (A, B, C, D or F) in a line.\n\nSample Input\n\n40 42 -1\n20 30 -1\n0 2 -1\n-1 -1 -1\n\nSample Output\n\nA\nC\nF", "sample_input": "40 42 -1\n20 30 -1\n0 2 -1\n-1 -1 -1\n"}, "reference_outputs": ["A\nC\nF\n"], "source_document_id": "p02411", "source_text": "Grading\n\nWrite a program which reads a list of student test scores and evaluates the performance for each student.\n\nThe test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup examination r (out of 100). If the student does not take the examination, the score is indicated by -1.\n\nThe final performance of a student is evaluated by the following procedure:\n\nIf the student does not take the midterm or final examination, the student's grade shall be F.\n\nIf the total score of the midterm and final examination is greater than or equal to 80, the student's grade shall be A.\n\nIf the total score of the midterm and final examination is greater than or equal to 65 and less than 80, the student's grade shall be B.\n\nIf the total score of the midterm and final examination is greater than or equal to 50 and less than 65, the student's grade shall be C.\n\nIf the total score of the midterm and final examination is greater than or equal to 30 and less than 50, the student's grade shall be D. However, if the score of the makeup examination is greater than or equal to 50, the grade shall be C.\n\nIf the total score of the midterm and final examination is less than 30, the student's grade shall be F.\n\nInput\n\nThe input consists of multiple datasets. For each dataset, three integers m, f and r are given in a line.\n\nThe input ends with three -1 for m, f and r respectively. Your program should not process for the terminal symbols.\n\nThe number of datasets (the number of students) does not exceed 50.\n\nOutput\n\nFor each dataset, print the grade (A, B, C, D or F) in a line.\n\nSample Input\n\n40 42 -1\n20 30 -1\n0 2 -1\n-1 -1 -1\n\nSample Output\n\nA\nC\nF", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 792, "cpu_time_ms": 10, "memory_kb": 15272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s487440324", "group_id": "codeNet:p02412", "input_text": " $n and\n 1 <= $m and 100 > $m and\n 1 <= $l and 100 > $l\n )\n {\n break;\n }\n }while(1);\n\n // Input < A(n*m)\n $arrayA = array();\n for($loop_n = 0; $loop_n < $n; $loop_n++)\n {\n $input = preg_split('/ /', trim(fgets(STDIN)));\n if($m == count($input))\n {\n $arrayA[] = $input;\n }\n else\n {\n $loop_n--;\n }\n }\n\n // Input < B(m*l)\n $arrayB = array();\n for($loop_m = 0; $loop_m < $m; $loop_m++)\n {\n $input = preg_split('/ /', trim(fgets(STDIN)));\n if($l == count($input))\n {\n $arrayB[] = $input;\n }\n else\n {\n $loop_m--;\n }\n }\n\n // Output < C(n*l)\n for($i = 0; $i < $n; $i++)\n {\n $ans = array();\n for($j = 0; $j < $l; $j++)\n {\n $c = 0;\n for($k = 0; $k < $m; $k++)\n {\n $c = $c + $arrayA[$i][$k] * $arrayB[$k][$j];\n }\n $ans[] = $c;\n }\n echo implode(' ' , $ans) . \"\\n\";\n }\n?>\n", "language": "PHP", "metadata": {"date": 1522912715, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02414.html", "problem_id": "p02414", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02414/input.txt", "sample_output_relpath": "derived/input_output/data/p02414/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02414/PHP/s866463209.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s866463209", "user_id": "u093488647"}, "prompt_components": {"gold_output": "1 8 5\n0 9 6\n4 23 14\n", "input_to_evaluate": " $n and\n 1 <= $m and 100 > $m and\n 1 <= $l and 100 > $l\n )\n {\n break;\n }\n }while(1);\n\n // Input < A(n*m)\n $arrayA = array();\n for($loop_n = 0; $loop_n < $n; $loop_n++)\n {\n $input = preg_split('/ /', trim(fgets(STDIN)));\n if($m == count($input))\n {\n $arrayA[] = $input;\n }\n else\n {\n $loop_n--;\n }\n }\n\n // Input < B(m*l)\n $arrayB = array();\n for($loop_m = 0; $loop_m < $m; $loop_m++)\n {\n $input = preg_split('/ /', trim(fgets(STDIN)));\n if($l == count($input))\n {\n $arrayB[] = $input;\n }\n else\n {\n $loop_m--;\n }\n }\n\n // Output < C(n*l)\n for($i = 0; $i < $n; $i++)\n {\n $ans = array();\n for($j = 0; $j < $l; $j++)\n {\n $c = 0;\n for($k = 0; $k < $m; $k++)\n {\n $c = $c + $arrayA[$i][$k] * $arrayB[$k][$j];\n }\n $ans[] = $c;\n }\n echo implode(' ' , $ans) . \"\\n\";\n }\n?>\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMatrix Multiplication\n\nWrite a program which reads a $n \\times m$ matrix $A$ and a $m \\times l$ matrix $B$, and prints their product, a $n \\times l$ matrix $C$. An element of matrix $C$ is obtained by the following formula:\n\n\\[\nc_{ij} = \\sum_{k=1}^m a_{ik}b_{kj}\n\\]\n\nwhere $a_{ij}$, $b_{ij}$ and $c_{ij}$ are elements of $A$, $B$ and $C$ respectively.\n\nInput\n\nIn the first line, three integers $n$, $m$ and $l$ are given separated by space characters\n\nIn the following lines, the $n \\times m$ matrix $A$ and the $m \\times l$ matrix $B$ are given.\n\nOutput\n\nPrint elements of the $n \\times l$ matrix $C$ ($c_{ij}$). Print a single space character between adjacent elements.\n\nConstraints\n\n$1 \\leq n, m, l \\leq 100$\n\n$0 \\leq a_{ij}, b_{ij} \\leq 10000$\n\nSample Input\n\n3 2 3\n1 2\n0 3\n4 5\n1 2 1\n0 3 2\n\nSample Output\n\n1 8 5\n0 9 6\n4 23 14\n\nNote\n\n      解説", "sample_input": "3 2 3\n1 2\n0 3\n4 5\n1 2 1\n0 3 2\n"}, "reference_outputs": ["1 8 5\n0 9 6\n4 23 14\n"], "source_document_id": "p02414", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMatrix Multiplication\n\nWrite a program which reads a $n \\times m$ matrix $A$ and a $m \\times l$ matrix $B$, and prints their product, a $n \\times l$ matrix $C$. An element of matrix $C$ is obtained by the following formula:\n\n\\[\nc_{ij} = \\sum_{k=1}^m a_{ik}b_{kj}\n\\]\n\nwhere $a_{ij}$, $b_{ij}$ and $c_{ij}$ are elements of $A$, $B$ and $C$ respectively.\n\nInput\n\nIn the first line, three integers $n$, $m$ and $l$ are given separated by space characters\n\nIn the following lines, the $n \\times m$ matrix $A$ and the $m \\times l$ matrix $B$ are given.\n\nOutput\n\nPrint elements of the $n \\times l$ matrix $C$ ($c_{ij}$). Print a single space character between adjacent elements.\n\nConstraints\n\n$1 \\leq n, m, l \\leq 100$\n\n$0 \\leq a_{ij}, b_{ij} \\leq 10000$\n\nSample Input\n\n3 2 3\n1 2\n0 3\n4 5\n1 2 1\n0 3 2\n\nSample Output\n\n1 8 5\n0 9 6\n4 23 14\n\nNote\n\n      解説", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1854, "cpu_time_ms": 9990, "memory_kb": 9668}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s911851022", "group_id": "codeNet:p02415", "input_text": " $count) {\n printf('%s : %d%s', $char, $count, PHP_EOL);\n}", "language": "PHP", "metadata": {"date": 1435129376, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02417.html", "problem_id": "p02417", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02417/input.txt", "sample_output_relpath": "derived/input_output/data/p02417/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02417/PHP/s940911376.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s940911376", "user_id": "u173452553"}, "prompt_components": {"gold_output": "a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n", "input_to_evaluate": " $count) {\n printf('%s : %d%s', $char, $count, PHP_EOL);\n}", "problem_context": "Counting Characters\n\nWrite a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.\n\nInput\n\nA sentence in English is given in several lines.\n\nOutput\n\nPrints the number of alphabetical letters in the following format:\n\na : The number of 'a'\nb : The number of 'b'\nc : The number of 'c'\n.\n.\nz : The number of 'z'\n\nConstraints\n\nThe number of characters in the sentence < 1200\n\nSample Input\n\nThis is a pen.\n\nSample Output\n\na : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0", "sample_input": "This is a pen.\n"}, "reference_outputs": ["a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n"], "source_document_id": "p02417", "source_text": "Counting Characters\n\nWrite a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.\n\nInput\n\nA sentence in English is given in several lines.\n\nOutput\n\nPrints the number of alphabetical letters in the following format:\n\na : The number of 'a'\nb : The number of 'b'\nc : The number of 'c'\n.\n.\nz : The number of 'z'\n\nConstraints\n\nThe number of characters in the sentence < 1200\n\nSample Input\n\nThis is a pen.\n\nSample Output\n\na : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 305, "cpu_time_ms": 10, "memory_kb": 6796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s670935704", "group_id": "codeNet:p02417", "input_text": " $count) {\n printf('%s : %d%s', $char, $count, PHP_EOL);\n}", "language": "PHP", "metadata": {"date": 1435132881, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02417.html", "problem_id": "p02417", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02417/input.txt", "sample_output_relpath": "derived/input_output/data/p02417/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02417/PHP/s670935704.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s670935704", "user_id": "u173452553"}, "prompt_components": {"gold_output": "a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n", "input_to_evaluate": " $count) {\n printf('%s : %d%s', $char, $count, PHP_EOL);\n}", "problem_context": "Counting Characters\n\nWrite a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.\n\nInput\n\nA sentence in English is given in several lines.\n\nOutput\n\nPrints the number of alphabetical letters in the following format:\n\na : The number of 'a'\nb : The number of 'b'\nc : The number of 'c'\n.\n.\nz : The number of 'z'\n\nConstraints\n\nThe number of characters in the sentence < 1200\n\nSample Input\n\nThis is a pen.\n\nSample Output\n\na : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0", "sample_input": "This is a pen.\n"}, "reference_outputs": ["a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n"], "source_document_id": "p02417", "source_text": "Counting Characters\n\nWrite a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.\n\nInput\n\nA sentence in English is given in several lines.\n\nOutput\n\nPrints the number of alphabetical letters in the following format:\n\na : The number of 'a'\nb : The number of 'b'\nc : The number of 'c'\n.\n.\nz : The number of 'z'\n\nConstraints\n\nThe number of characters in the sentence < 1200\n\nSample Input\n\nThis is a pen.\n\nSample Output\n\na : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 309, "cpu_time_ms": 10, "memory_kb": 6800}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s095230113", "group_id": "codeNet:p02417", "input_text": " $count) {\n printf('%s : %d%s', $char, $count, PHP_EOL);\n}", "language": "PHP", "metadata": {"date": 1435132928, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02417.html", "problem_id": "p02417", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02417/input.txt", "sample_output_relpath": "derived/input_output/data/p02417/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02417/PHP/s095230113.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s095230113", "user_id": "u173452553"}, "prompt_components": {"gold_output": "a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n", "input_to_evaluate": " $count) {\n printf('%s : %d%s', $char, $count, PHP_EOL);\n}", "problem_context": "Counting Characters\n\nWrite a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.\n\nInput\n\nA sentence in English is given in several lines.\n\nOutput\n\nPrints the number of alphabetical letters in the following format:\n\na : The number of 'a'\nb : The number of 'b'\nc : The number of 'c'\n.\n.\nz : The number of 'z'\n\nConstraints\n\nThe number of characters in the sentence < 1200\n\nSample Input\n\nThis is a pen.\n\nSample Output\n\na : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0", "sample_input": "This is a pen.\n"}, "reference_outputs": ["a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n"], "source_document_id": "p02417", "source_text": "Counting Characters\n\nWrite a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.\n\nInput\n\nA sentence in English is given in several lines.\n\nOutput\n\nPrints the number of alphabetical letters in the following format:\n\na : The number of 'a'\nb : The number of 'b'\nc : The number of 'c'\n.\n.\nz : The number of 'z'\n\nConstraints\n\nThe number of characters in the sentence < 1200\n\nSample Input\n\nThis is a pen.\n\nSample Output\n\na : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 305, "cpu_time_ms": 10, "memory_kb": 6796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s962951632", "group_id": "codeNet:p02418", "input_text": "", "language": "PHP", "metadata": {"date": 1488118361, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02418.html", "problem_id": "p02418", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02418/input.txt", "sample_output_relpath": "derived/input_output/data/p02418/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02418/PHP/s962951632.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s962951632", "user_id": "u064980217"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nRing\n\nWrite a program which finds a pattern $p$ in a ring shaped text $s$.\n\nInput\n\nIn the first line, the text $s$ is given.\n\nIn the second line, the pattern $p$ is given.\n\nOutput\n\nIf $p$ is in $s$, print Yes in a line, otherwise No.\n\nConstraints\n\n$1 \\leq $ length of $p \\leq $ length of $s \\leq 100$\n\n$s$ and $p$ consists of lower-case letters\n\nSample Input 1\n\nvanceknowledgetoad\nadvance\n\nSample Output 1\n\nYes\n\nSample Input 2\n\nvanceknowledgetoad\nadvanced\n\nSample Output 2\n\nNo", "sample_input": "vanceknowledgetoad\nadvance\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02418", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nRing\n\nWrite a program which finds a pattern $p$ in a ring shaped text $s$.\n\nInput\n\nIn the first line, the text $s$ is given.\n\nIn the second line, the pattern $p$ is given.\n\nOutput\n\nIf $p$ is in $s$, print Yes in a line, otherwise No.\n\nConstraints\n\n$1 \\leq $ length of $p \\leq $ length of $s \\leq 100$\n\n$s$ and $p$ consists of lower-case letters\n\nSample Input 1\n\nvanceknowledgetoad\nadvance\n\nSample Output 1\n\nYes\n\nSample Input 2\n\nvanceknowledgetoad\nadvanced\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 268, "cpu_time_ms": 10, "memory_kb": 15424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s149608668", "group_id": "codeNet:p02418", "input_text": "\n\n", "language": "PHP", "metadata": {"date": 1520505612, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02418.html", "problem_id": "p02418", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02418/input.txt", "sample_output_relpath": "derived/input_output/data/p02418/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02418/PHP/s960175190.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s960175190", "user_id": "u306567747"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nRing\n\nWrite a program which finds a pattern $p$ in a ring shaped text $s$.\n\nInput\n\nIn the first line, the text $s$ is given.\n\nIn the second line, the pattern $p$ is given.\n\nOutput\n\nIf $p$ is in $s$, print Yes in a line, otherwise No.\n\nConstraints\n\n$1 \\leq $ length of $p \\leq $ length of $s \\leq 100$\n\n$s$ and $p$ consists of lower-case letters\n\nSample Input 1\n\nvanceknowledgetoad\nadvance\n\nSample Output 1\n\nYes\n\nSample Input 2\n\nvanceknowledgetoad\nadvanced\n\nSample Output 2\n\nNo", "sample_input": "vanceknowledgetoad\nadvance\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02418", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nRing\n\nWrite a program which finds a pattern $p$ in a ring shaped text $s$.\n\nInput\n\nIn the first line, the text $s$ is given.\n\nIn the second line, the pattern $p$ is given.\n\nOutput\n\nIf $p$ is in $s$, print Yes in a line, otherwise No.\n\nConstraints\n\n$1 \\leq $ length of $p \\leq $ length of $s \\leq 100$\n\n$s$ and $p$ consists of lower-case letters\n\nSample Input 1\n\nvanceknowledgetoad\nadvance\n\nSample Output 1\n\nYes\n\nSample Input 2\n\nvanceknowledgetoad\nadvanced\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 202, "cpu_time_ms": 10, "memory_kb": 9184}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s488817521", "group_id": "codeNet:p02418", "input_text": "", "language": "PHP", "metadata": {"date": 1437027349, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02419.html", "problem_id": "p02419", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02419/input.txt", "sample_output_relpath": "derived/input_output/data/p02419/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02419/PHP/s903029520.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s903029520", "user_id": "u330842660"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Finding a Word\n\nWrite a program which reads a word W and a text T, and prints the number of word W which appears in text T\n\nT consists of string Ti separated by space characters and newlines. Count the number of Ti which equals to W. The word and text are case insensitive.\n\nConstraints\n\nThe length of W ≤ 10\n\nW consists of lower case letters\n\nThe length of T in a line ≤ 1000\n\nInput\n\nIn the first line, the word W is given. In the following lines, the text T is given separated by space characters and newlines.\n\n\"END_OF_TEXT\" indicates the end of the text.\n\nOutput\n\nPrint the number of W in the text.\n\nSample Input\n\ncomputer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the new era.\nProvides an outstanding computer environment.\nEND_OF_TEXT\n\nSample Output\n\n3", "sample_input": "computer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the new era.\nProvides an outstanding computer environment.\nEND_OF_TEXT\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02419", "source_text": "Finding a Word\n\nWrite a program which reads a word W and a text T, and prints the number of word W which appears in text T\n\nT consists of string Ti separated by space characters and newlines. Count the number of Ti which equals to W. The word and text are case insensitive.\n\nConstraints\n\nThe length of W ≤ 10\n\nW consists of lower case letters\n\nThe length of T in a line ≤ 1000\n\nInput\n\nIn the first line, the word W is given. In the following lines, the text T is given separated by space characters and newlines.\n\n\"END_OF_TEXT\" indicates the end of the text.\n\nOutput\n\nPrint the number of W in the text.\n\nSample Input\n\ncomputer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the new era.\nProvides an outstanding computer environment.\nEND_OF_TEXT\n\nSample Output\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 273, "cpu_time_ms": 10, "memory_kb": 6576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s685654216", "group_id": "codeNet:p02419", "input_text": "", "language": "PHP", "metadata": {"date": 1488122531, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02419.html", "problem_id": "p02419", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02419/input.txt", "sample_output_relpath": "derived/input_output/data/p02419/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02419/PHP/s685654216.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s685654216", "user_id": "u064980217"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Finding a Word\n\nWrite a program which reads a word W and a text T, and prints the number of word W which appears in text T\n\nT consists of string Ti separated by space characters and newlines. Count the number of Ti which equals to W. The word and text are case insensitive.\n\nConstraints\n\nThe length of W ≤ 10\n\nW consists of lower case letters\n\nThe length of T in a line ≤ 1000\n\nInput\n\nIn the first line, the word W is given. In the following lines, the text T is given separated by space characters and newlines.\n\n\"END_OF_TEXT\" indicates the end of the text.\n\nOutput\n\nPrint the number of W in the text.\n\nSample Input\n\ncomputer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the new era.\nProvides an outstanding computer environment.\nEND_OF_TEXT\n\nSample Output\n\n3", "sample_input": "computer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the new era.\nProvides an outstanding computer environment.\nEND_OF_TEXT\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02419", "source_text": "Finding a Word\n\nWrite a program which reads a word W and a text T, and prints the number of word W which appears in text T\n\nT consists of string Ti separated by space characters and newlines. Count the number of Ti which equals to W. The word and text are case insensitive.\n\nConstraints\n\nThe length of W ≤ 10\n\nW consists of lower case letters\n\nThe length of T in a line ≤ 1000\n\nInput\n\nIn the first line, the word W is given. In the following lines, the text T is given separated by space characters and newlines.\n\n\"END_OF_TEXT\" indicates the end of the text.\n\nOutput\n\nPrint the number of W in the text.\n\nSample Input\n\ncomputer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the new era.\nProvides an outstanding computer environment.\nEND_OF_TEXT\n\nSample Output\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 720, "cpu_time_ms": 10, "memory_kb": 15400}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s613079281", "group_id": "codeNet:p02420", "input_text": " $h_card){\n $t_score += 3;\n }elseif ($t_card < $h_card) {\n $h_score += 3;\n }else{\n $t_score += 1;\n $h_score += 1;\n }\n}\nprintf(\"%d %d%s\",$t_score,$h_score,PHP_EOL);\n?>", "language": "PHP", "metadata": {"date": 1492271675, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02421.html", "problem_id": "p02421", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02421/input.txt", "sample_output_relpath": "derived/input_output/data/p02421/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02421/PHP/s682097454.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s682097454", "user_id": "u458439832"}, "prompt_components": {"gold_output": "1 7\n", "input_to_evaluate": " $h_card){\n $t_score += 3;\n }elseif ($t_card < $h_card) {\n $h_score += 3;\n }else{\n $t_score += 1;\n $h_score += 1;\n }\n}\nprintf(\"%d %d%s\",$t_score,$h_score,PHP_EOL);\n?>", "problem_context": "Card Game\n\nTaro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro and Hanako respectively puts out a card.\nThe name of the animal consisting of alphabetical letters is written on each card, and the bigger one in lexicographical order becomes the winner of that turn. The winner obtains 3 points. In the case of a draw, they obtain 1 point each.\n\nWrite a program which reads a sequence of cards Taro and Hanako have and reports the final scores of the game.\n\nInput\n\nIn the first line, the number of cards n is given. In the following n lines, the cards for n turns are given respectively. For each line, the first string represents the Taro's card and the second one represents Hanako's card.\n\nConstraints\n\nn ≤ 1000\n\nThe length of the string ≤ 100\n\nOutput\n\nPrint the final scores of Taro and Hanako respectively. Put a single space character between them.\n\nSample Input\n\n3\ncat dog\nfish fish\nlion tiger\n\nSample Output\n\n1 7", "sample_input": "3\ncat dog\nfish fish\nlion tiger\n"}, "reference_outputs": ["1 7\n"], "source_document_id": "p02421", "source_text": "Card Game\n\nTaro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro and Hanako respectively puts out a card.\nThe name of the animal consisting of alphabetical letters is written on each card, and the bigger one in lexicographical order becomes the winner of that turn. The winner obtains 3 points. In the case of a draw, they obtain 1 point each.\n\nWrite a program which reads a sequence of cards Taro and Hanako have and reports the final scores of the game.\n\nInput\n\nIn the first line, the number of cards n is given. In the following n lines, the cards for n turns are given respectively. For each line, the first string represents the Taro's card and the second one represents Hanako's card.\n\nConstraints\n\nn ≤ 1000\n\nThe length of the string ≤ 100\n\nOutput\n\nPrint the final scores of Taro and Hanako respectively. Put a single space character between them.\n\nSample Input\n\n3\ncat dog\nfish fish\nlion tiger\n\nSample Output\n\n1 7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 401, "cpu_time_ms": 10, "memory_kb": 15224}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s137076482", "group_id": "codeNet:p02422", "input_text": "= 0; $i--) {\n $reversed[] = $chars[$i];\n }\n\n return $reversed;\n}\n\nfunction print_chars($chars, $from, $to)\n{\n for ($i = $from; $i <= $to; $i++) {\n echo $chars[$i];\n }\n echo \"\\n\";\n}", "language": "PHP", "metadata": {"date": 1423628954, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02422.html", "problem_id": "p02422", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02422/input.txt", "sample_output_relpath": "derived/input_output/data/p02422/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02422/PHP/s137076482.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s137076482", "user_id": "u256678932"}, "prompt_components": {"gold_output": "xaze\n", "input_to_evaluate": "= 0; $i--) {\n $reversed[] = $chars[$i];\n }\n\n return $reversed;\n}\n\nfunction print_chars($chars, $from, $to)\n{\n for ($i = $from; $i <= $to; $i++) {\n echo $chars[$i];\n }\n echo \"\\n\";\n}", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nTransformation\n\nWrite a program which performs a sequence of commands to a given string $str$. The command is one of:\n\nprint a b: print from the a-th character to the b-th character of $str$\n\nreverse a b: reverse from the a-th character to the b-th character of $str$\n\nreplace a b p: replace from the a-th character to the b-th character of $str$ with p\n\nNote that the indices of $str$ start with 0.\n\nInput\n\nIn the first line, a string $str$ is given. $str$ consists of lowercase letters. In the second line, the number of commands q is given. In the next q lines, each command is given in the above mentioned format.\n\nOutput\n\nFor each print command, print a string in a line.\n\nConstraints\n\n$1 \\leq $ length of $str \\leq 1000$\n\n$1 \\leq q \\leq 100$\n\n$0 \\leq a \\leq b < $ length of $str$\n\nfor replace command, $b - a + 1 = $ length of $p$\n\nSample Input 1\n\nabcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 1 4\n\nSample Output 1\n\nxaze\n\nSample Input 2\n\nxyz\n3\nprint 0 2\nreplace 0 2 abc\nprint 0 2\n\nSample Output 2\n\nxyz\nabc", "sample_input": "abcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 1 4\n"}, "reference_outputs": ["xaze\n"], "source_document_id": "p02422", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nTransformation\n\nWrite a program which performs a sequence of commands to a given string $str$. The command is one of:\n\nprint a b: print from the a-th character to the b-th character of $str$\n\nreverse a b: reverse from the a-th character to the b-th character of $str$\n\nreplace a b p: replace from the a-th character to the b-th character of $str$ with p\n\nNote that the indices of $str$ start with 0.\n\nInput\n\nIn the first line, a string $str$ is given. $str$ consists of lowercase letters. In the second line, the number of commands q is given. In the next q lines, each command is given in the above mentioned format.\n\nOutput\n\nFor each print command, print a string in a line.\n\nConstraints\n\n$1 \\leq $ length of $str \\leq 1000$\n\n$1 \\leq q \\leq 100$\n\n$0 \\leq a \\leq b < $ length of $str$\n\nfor replace command, $b - a + 1 = $ length of $p$\n\nSample Input 1\n\nabcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 1 4\n\nSample Output 1\n\nxaze\n\nSample Input 2\n\nxyz\n3\nprint 0 2\nreplace 0 2 abc\nprint 0 2\n\nSample Output 2\n\nxyz\nabc", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1397, "cpu_time_ms": 20, "memory_kb": 7184}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s612940676", "group_id": "codeNet:p02422", "input_text": "", "language": "PHP", "metadata": {"date": 1440070163, "filename_ext": "php", "original_language": "PHP", "problem_description_relpath": "problem_descriptions/p02422.html", "problem_id": "p02422", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02422/input.txt", "sample_output_relpath": "derived/input_output/data/p02422/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02422/PHP/s612940676.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s612940676", "user_id": "u604774382"}, "prompt_components": {"gold_output": "xaze\n", "input_to_evaluate": "", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nTransformation\n\nWrite a program which performs a sequence of commands to a given string $str$. The command is one of:\n\nprint a b: print from the a-th character to the b-th character of $str$\n\nreverse a b: reverse from the a-th character to the b-th character of $str$\n\nreplace a b p: replace from the a-th character to the b-th character of $str$ with p\n\nNote that the indices of $str$ start with 0.\n\nInput\n\nIn the first line, a string $str$ is given. $str$ consists of lowercase letters. In the second line, the number of commands q is given. In the next q lines, each command is given in the above mentioned format.\n\nOutput\n\nFor each print command, print a string in a line.\n\nConstraints\n\n$1 \\leq $ length of $str \\leq 1000$\n\n$1 \\leq q \\leq 100$\n\n$0 \\leq a \\leq b < $ length of $str$\n\nfor replace command, $b - a + 1 = $ length of $p$\n\nSample Input 1\n\nabcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 1 4\n\nSample Output 1\n\nxaze\n\nSample Input 2\n\nxyz\n3\nprint 0 2\nreplace 0 2 abc\nprint 0 2\n\nSample Output 2\n\nxyz\nabc", "sample_input": "abcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 1 4\n"}, "reference_outputs": ["xaze\n"], "source_document_id": "p02422", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nTransformation\n\nWrite a program which performs a sequence of commands to a given string $str$. The command is one of:\n\nprint a b: print from the a-th character to the b-th character of $str$\n\nreverse a b: reverse from the a-th character to the b-th character of $str$\n\nreplace a b p: replace from the a-th character to the b-th character of $str$ with p\n\nNote that the indices of $str$ start with 0.\n\nInput\n\nIn the first line, a string $str$ is given. $str$ consists of lowercase letters. In the second line, the number of commands q is given. In the next q lines, each command is given in the above mentioned format.\n\nOutput\n\nFor each print command, print a string in a line.\n\nConstraints\n\n$1 \\leq $ length of $str \\leq 1000$\n\n$1 \\leq q \\leq 100$\n\n$0 \\leq a \\leq b < $ length of $str$\n\nfor replace command, $b - a + 1 = $ length of $p$\n\nSample Input 1\n\nabcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 1 4\n\nSample Output 1\n\nxaze\n\nSample Input 2\n\nxyz\n3\nprint 0 2\nreplace 0 2 abc\nprint 0 2\n\nSample Output 2\n\nxyz\nabc", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 506, "cpu_time_ms": 10, "memory_kb": 15472}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s762956394", "group_id": "codeNet:p02534", "input_text": "= $N) {\n break;\n }\n\n if ($a == $b) {\n $count += 1;\n } else {\n $count += 2;\n }\n }\n}\necho $count;\n\n", "language": "PHP", "metadata": {"date": 1600545730, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/PHP/s465755831.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s465755831", "user_id": "u321847665"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "= $N) {\n break;\n }\n\n if ($a == $b) {\n $count += 1;\n } else {\n $count += 2;\n }\n }\n}\necho $count;\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 293, "cpu_time_ms": 700, "memory_kb": 16200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s185684900", "group_id": "codeNet:p02552", "input_text": "\n", "language": "PHP", "metadata": {"date": 1600031903, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02552.html", "problem_id": "p02552", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02552/input.txt", "sample_output_relpath": "derived/input_output/data/p02552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02552/PHP/s446518731.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s446518731", "user_id": "u669378280"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "sample_input": "1\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02552", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 255, "cpu_time_ms": 30, "memory_kb": 15980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s475403024", "group_id": "codeNet:p02552", "input_text": "", "language": "PHP", "metadata": {"date": 1600023922, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02552.html", "problem_id": "p02552", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02552/input.txt", "sample_output_relpath": "derived/input_output/data/p02552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02552/PHP/s030757435.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s030757435", "user_id": "u481734869"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "sample_input": "1\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02552", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 122, "cpu_time_ms": 23, "memory_kb": 16156}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s250525955", "group_id": "codeNet:p02552", "input_text": " $v)$ret[$j][] = $v;return $ret;}\n}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\\n\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n if($both == 0){\n $G[$a][] = $b;\n }elseif($both == 1){\n $G[$a][] = $b;\n $G[$b][] = $a;\n }else{\n $G[$b][] = $a;\n }\n }else{\n list($a, $b, $d) = $values;\n if($both == 0){\n $G[$a][] = [$b, $d];\n }elseif($both == 1){\n $G[$a][] = [$b, $d];\n $G[$b][] = [$a, $d];\n }else{\n $G[$b][] = [$a, $d];\n }\n }\n }\n return $G;\n}", "language": "PHP", "metadata": {"date": 1600537977, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02554.html", "problem_id": "p02554", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02554/input.txt", "sample_output_relpath": "derived/input_output/data/p02554/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02554/PHP/s098333864.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s098333864", "user_id": "u248209126"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $v)$ret[$j][] = $v;return $ret;}\n}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\\n\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n if($both == 0){\n $G[$a][] = $b;\n }elseif($both == 1){\n $G[$a][] = $b;\n $G[$b][] = $a;\n }else{\n $G[$b][] = $a;\n }\n }else{\n list($a, $b, $d) = $values;\n if($both == 0){\n $G[$a][] = [$b, $d];\n }elseif($both == 1){\n $G[$a][] = [$b, $d];\n $G[$b][] = [$a, $d];\n }else{\n $G[$b][] = [$a, $d];\n }\n }\n }\n return $G;\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHow many integer sequences A_1,A_2,\\ldots,A_N of length N satisfy all of the following conditions?\n\n0 \\leq A_i \\leq 9\n\nThere exists some i such that A_i=0 holds.\n\nThere exists some i such that A_i=9 holds.\n\nThe answer can be very large, so output it modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer modulo 10^9 + 7.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n2\n\nTwo sequences \\{0,9\\} and \\{9,0\\} satisfy all conditions.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n869121\n\nSample Output 3\n\n2511445", "sample_input": "2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02554", "source_text": "Score : 300 points\n\nProblem Statement\n\nHow many integer sequences A_1,A_2,\\ldots,A_N of length N satisfy all of the following conditions?\n\n0 \\leq A_i \\leq 9\n\nThere exists some i such that A_i=0 holds.\n\nThere exists some i such that A_i=9 holds.\n\nThe answer can be very large, so output it modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer modulo 10^9 + 7.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n2\n\nTwo sequences \\{0,9\\} and \\{9,0\\} satisfy all conditions.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n869121\n\nSample Output 3\n\n2511445", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3285, "cpu_time_ms": 152, "memory_kb": 16160}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s270408096", "group_id": "codeNet:p02573", "input_text": " $dummy) {\n if (!isset($memo[$k])) {\n $memo[$k] = 1;\n $stack[] = $k;\n $g[$k] = $cnt;\n }\n }\n if ($stack) {\n $t = array_pop($stack);\n } else {\n break;\n }\n }\n}\nprintf(\"%d\", max(array_count_values($g)));\n", "language": "PHP", "metadata": {"date": 1599950603, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02573.html", "problem_id": "p02573", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02573/input.txt", "sample_output_relpath": "derived/input_output/data/p02573/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02573/PHP/s270408096.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s270408096", "user_id": "u195912432"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $dummy) {\n if (!isset($memo[$k])) {\n $memo[$k] = 1;\n $stack[] = $k;\n $g[$k] = $cnt;\n }\n }\n if ($stack) {\n $t = array_pop($stack);\n } else {\n break;\n }\n }\n}\nprintf(\"%d\", max(array_count_values($g)));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "sample_input": "5 3\n1 2\n3 4\n5 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02573", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 802, "cpu_time_ms": 292, "memory_kb": 114496}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s591269841", "group_id": "codeNet:p02576", "input_text": "= $N){\n echo $T;\n exit;\n }\n\n elseif ($X * $i > $N){\n echo $T * $i;\n exit;\n }\n }\n", "language": "PHP", "metadata": {"date": 1598124483, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02576.html", "problem_id": "p02576", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02576/input.txt", "sample_output_relpath": "derived/input_output/data/p02576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02576/PHP/s591269841.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s591269841", "user_id": "u713151864"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "= $N){\n echo $T;\n exit;\n }\n\n elseif ($X * $i > $N){\n echo $T * $i;\n exit;\n }\n }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "sample_input": "20 12 6\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02576", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 27, "memory_kb": 16016}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s211048633", "group_id": "codeNet:p02576", "input_text": "$stdin = trim(fgets(STDIN));\n$array = explode(\" \", $stdin);\n\n$n = (int) $array[0];\n\n$x = (int) $array[1];\n\n$tako = $n / $x;\n\n$tako = ceil($tako);\n\n$t = (int) $array[2];\n\n$ans = $tako * $t;\n\necho $ans;", "language": "PHP", "metadata": {"date": 1598124247, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02576.html", "problem_id": "p02576", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02576/input.txt", "sample_output_relpath": "derived/input_output/data/p02576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02576/PHP/s211048633.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s211048633", "user_id": "u666025370"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "$stdin = trim(fgets(STDIN));\n$array = explode(\" \", $stdin);\n\n$n = (int) $array[0];\n\n$x = (int) $array[1];\n\n$tako = $n / $x;\n\n$tako = ceil($tako);\n\n$t = (int) $array[2];\n\n$ans = $tako * $t;\n\necho $ans;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "sample_input": "20 12 6\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02576", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 201, "cpu_time_ms": 25, "memory_kb": 16052}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s709997508", "group_id": "codeNet:p02576", "input_text": "\n", "language": "PHP", "metadata": {"date": 1597520083, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02582.html", "problem_id": "p02582", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02582/input.txt", "sample_output_relpath": "derived/input_output/data/p02582/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02582/PHP/s400112172.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s400112172", "user_id": "u566723265"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "sample_input": "RRS\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02582", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 387, "cpu_time_ms": 25, "memory_kb": 16224}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s721159963", "group_id": "codeNet:p02582", "input_text": "", "language": "PHP", "metadata": {"date": 1597572490, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02583.html", "problem_id": "p02583", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02583/input.txt", "sample_output_relpath": "derived/input_output/data/p02583/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02583/PHP/s344803474.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s344803474", "user_id": "u539675863"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "sample_input": "5\n4 4 9 7 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02583", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 562, "cpu_time_ms": 2379, "memory_kb": 133672}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s692920104", "group_id": "codeNet:p02583", "input_text": " $c && $b+$c > $a && $c+$a > $b) {\n $arr = [];\n $arr[] = $i;\n $arr[] = $j;\n $arr[] = $k;\n sort($arr);\n if (!in_array($arr, $comb_arr)) {\n $comb_arr[] = $arr;\n }\n }\n }\n }\n }\n}\n\necho count($comb_arr) . \"\\n\";", "language": "PHP", "metadata": {"date": 1597520224, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02583.html", "problem_id": "p02583", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02583/input.txt", "sample_output_relpath": "derived/input_output/data/p02583/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02583/PHP/s692920104.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s692920104", "user_id": "u527300007"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": " $c && $b+$c > $a && $c+$a > $b) {\n $arr = [];\n $arr[] = $i;\n $arr[] = $j;\n $arr[] = $k;\n sort($arr);\n if (!in_array($arr, $comb_arr)) {\n $comb_arr[] = $arr;\n }\n }\n }\n }\n }\n}\n\necho count($comb_arr) . \"\\n\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "sample_input": "5\n4 4 9 7 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02583", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 835, "cpu_time_ms": 2206, "memory_kb": 19940}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s680572040", "group_id": "codeNet:p02583", "input_text": " $l[$k]){\n $ans++;\n } \n }\n }\n }\n }\n echo $ans;", "language": "PHP", "metadata": {"date": 1597518540, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02583.html", "problem_id": "p02583", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02583/input.txt", "sample_output_relpath": "derived/input_output/data/p02583/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02583/PHP/s680572040.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s680572040", "user_id": "u800169017"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": " $l[$k]){\n $ans++;\n } \n }\n }\n }\n }\n echo $ans;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "sample_input": "5\n4 4 9 7 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02583", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 437, "cpu_time_ms": 51, "memory_kb": 16212}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s032204515", "group_id": "codeNet:p02584", "input_text": "= 0){\n\n $lcount = intdiv($K, $count);\n $point = $lcount * array_sum($value);\n $zan = $K - $lcount * $count;\n $max = max($point, $max);\n }else{\n if($K >= $count){\n $zan = $count-1;\n }else{\n $zan = $K;\n }\n }\n\n for($i=1;$i<=$zan;$i++){\n $tmp_point = 0;\n for($j=0;$j<$count;$j++){\n if($j === 0){\n for($k = 0;$k < $i; $k++){\n $tmp_point += $value[$k];\n }\n $tmp_max = max($tmp_point, $tmp_max);\n }else{\n if($j + $i > $count){\n $newj = $j + $i - $count -1;\n }else{\n $newj = $j + $i - 1;\n }\n $tmp_point -= $value[$j-1];\n $tmp_point += $value[$newj];\n $tmp_max = max($tmp_point, $tmp_max);\n }\n }\n\n\n }\n $max = max($max, $point + $tmp_max);\n\n\n}\necho $max;", "language": "PHP", "metadata": {"date": 1597543461, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02585.html", "problem_id": "p02585", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02585/input.txt", "sample_output_relpath": "derived/input_output/data/p02585/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02585/PHP/s355723102.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s355723102", "user_id": "u274811210"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "= 0){\n\n $lcount = intdiv($K, $count);\n $point = $lcount * array_sum($value);\n $zan = $K - $lcount * $count;\n $max = max($point, $max);\n }else{\n if($K >= $count){\n $zan = $count-1;\n }else{\n $zan = $K;\n }\n }\n\n for($i=1;$i<=$zan;$i++){\n $tmp_point = 0;\n for($j=0;$j<$count;$j++){\n if($j === 0){\n for($k = 0;$k < $i; $k++){\n $tmp_point += $value[$k];\n }\n $tmp_max = max($tmp_point, $tmp_max);\n }else{\n if($j + $i > $count){\n $newj = $j + $i - $count -1;\n }else{\n $newj = $j + $i - 1;\n }\n $tmp_point -= $value[$j-1];\n $tmp_point += $value[$newj];\n $tmp_max = max($tmp_point, $tmp_max);\n }\n }\n\n\n }\n $max = max($max, $point + $tmp_max);\n\n\n}\necho $max;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "sample_input": "5 2\n2 4 5 1 3\n3 4 -10 -8 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02585", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1549, "cpu_time_ms": 1845, "memory_kb": 17156}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s860726210", "group_id": "codeNet:p02585", "input_text": " 0) {\n $_max = $ss[$cur] + intdiv($_k, $loop_d) * $loop_s;\n $_k %= $loop_d;\n $s = $_max;\n for ($j = 0; $j < $_k; ++$j) {\n $cur = $p[$cur];\n $s += $c[$cur];\n $_max = max($_max, $s);\n }\n $max = max($max, $_max);\n } else {\n $max = max($max, max($ss));\n }\n}\necho $max;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1597542834, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02585.html", "problem_id": "p02585", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02585/input.txt", "sample_output_relpath": "derived/input_output/data/p02585/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02585/PHP/s860726210.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s860726210", "user_id": "u055687468"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": " 0) {\n $_max = $ss[$cur] + intdiv($_k, $loop_d) * $loop_s;\n $_k %= $loop_d;\n $s = $_max;\n for ($j = 0; $j < $_k; ++$j) {\n $cur = $p[$cur];\n $s += $c[$cur];\n $_max = max($_max, $s);\n }\n $max = max($max, $_max);\n } else {\n $max = max($max, max($ss));\n }\n}\necho $max;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "sample_input": "5 2\n2 4 5 1 3\n3 4 -10 -8 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02585", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1129, "cpu_time_ms": 3170, "memory_kb": 18204}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s217008727", "group_id": "codeNet:p02586", "input_text": " $predp[$j][3]) {\n $dp[$j][$k] = $dp[$j - 1][$k];\n } else {\n $dp[$j][$k] = $predp[$j][3];\n }\n }\n if (!isset($val[$i][$j])) continue;\n for ($k = 1; $k < 4; ++$k) {\n if ($dp[$j - 1][$k - 1] + $val[$i][$j] > $dp[$j][$k]) {\n $dp[$j][$k] = $dp[$j - 1][$k - 1] + $val[$i][$j];\n }\n if ($predp[$j][3] + $val[$i][$j] > $dp[$j][$k]) {\n $dp[$j][$k] = $predp[$j][3] + $val[$i][$j];\n }\n }\n }\n}\necho $dp[$C][3], PHP_EOL;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1598282075, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02586.html", "problem_id": "p02586", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02586/input.txt", "sample_output_relpath": "derived/input_output/data/p02586/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02586/PHP/s217008727.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s217008727", "user_id": "u055687468"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": " $predp[$j][3]) {\n $dp[$j][$k] = $dp[$j - 1][$k];\n } else {\n $dp[$j][$k] = $predp[$j][3];\n }\n }\n if (!isset($val[$i][$j])) continue;\n for ($k = 1; $k < 4; ++$k) {\n if ($dp[$j - 1][$k - 1] + $val[$i][$j] > $dp[$j][$k]) {\n $dp[$j][$k] = $dp[$j - 1][$k - 1] + $val[$i][$j];\n }\n if ($predp[$j][3] + $val[$i][$j] > $dp[$j][$k]) {\n $dp[$j][$k] = $predp[$j][3] + $val[$i][$j];\n }\n }\n }\n}\necho $dp[$C][3], PHP_EOL;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \\leq i \\leq R) and the j-th column (1 \\leq j \\leq C). The i-th item is at (r_i, c_i) and has the value v_i.\n\nTakahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).\n\nHe can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.\n\nFind the maximum possible sum of the values of items he picks up.\n\nConstraints\n\n1 \\leq R, C \\leq 3000\n\n1 \\leq K \\leq \\min(2 \\times 10^5, R \\times C)\n\n1 \\leq r_i \\leq R\n\n1 \\leq c_i \\leq C\n\n(r_i, c_i) \\neq (r_j, c_j) (i \\neq j)\n\n1 \\leq v_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR C K\nr_1 c_1 v_1\nr_2 c_2 v_2\n:\nr_K c_K v_K\n\nOutput\n\nPrint the maximum possible sum of the values of items Takahashi picks up.\n\nSample Input 1\n\n2 2 3\n1 1 3\n2 1 4\n1 2 5\n\nSample Output 1\n\n8\n\nHe has two ways to get to the goal:\n\nVisit (1, 1), (1, 2), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 5 = 8.\n\nVisit (1, 1), (2, 1), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 4 = 7.\n\nThus, the maximum possible sum of the values of items he picks up is 8.\n\nSample Input 2\n\n2 5 5\n1 1 3\n2 4 20\n1 2 1\n1 3 4\n1 4 2\n\nSample Output 2\n\n29\n\nWe have four items in the 1-st row. The optimal choices are as follows:\n\nVisit (1, 1) (1, 2), (1, 3), (1, 4), (2, 4), and (2, 5), in this order, and pick up all items except the one on (1, 2). Then, the total value of the items he picks up will be 3 + 4 + 2 + 20 = 29.\n\nSample Input 3\n\n4 5 10\n2 5 12\n1 5 12\n2 3 15\n1 2 20\n1 1 28\n2 4 26\n3 2 27\n4 5 21\n3 5 10\n1 3 10\n\nSample Output 3\n\n142", "sample_input": "2 2 3\n1 1 3\n2 1 4\n1 2 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02586", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \\leq i \\leq R) and the j-th column (1 \\leq j \\leq C). The i-th item is at (r_i, c_i) and has the value v_i.\n\nTakahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).\n\nHe can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.\n\nFind the maximum possible sum of the values of items he picks up.\n\nConstraints\n\n1 \\leq R, C \\leq 3000\n\n1 \\leq K \\leq \\min(2 \\times 10^5, R \\times C)\n\n1 \\leq r_i \\leq R\n\n1 \\leq c_i \\leq C\n\n(r_i, c_i) \\neq (r_j, c_j) (i \\neq j)\n\n1 \\leq v_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR C K\nr_1 c_1 v_1\nr_2 c_2 v_2\n:\nr_K c_K v_K\n\nOutput\n\nPrint the maximum possible sum of the values of items Takahashi picks up.\n\nSample Input 1\n\n2 2 3\n1 1 3\n2 1 4\n1 2 5\n\nSample Output 1\n\n8\n\nHe has two ways to get to the goal:\n\nVisit (1, 1), (1, 2), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 5 = 8.\n\nVisit (1, 1), (2, 1), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 4 = 7.\n\nThus, the maximum possible sum of the values of items he picks up is 8.\n\nSample Input 2\n\n2 5 5\n1 1 3\n2 4 20\n1 2 1\n1 3 4\n1 4 2\n\nSample Output 2\n\n29\n\nWe have four items in the 1-st row. The optimal choices are as follows:\n\nVisit (1, 1) (1, 2), (1, 3), (1, 4), (2, 4), and (2, 5), in this order, and pick up all items except the one on (1, 2). Then, the total value of the items he picks up will be 3 + 4 + 2 + 20 = 29.\n\nSample Input 3\n\n4 5 10\n2 5 12\n1 5 12\n2 3 15\n1 2 20\n1 1 28\n2 4 26\n3 2 27\n4 5 21\n3 5 10\n1 3 10\n\nSample Output 3\n\n142", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1176, "cpu_time_ms": 3309, "memory_kb": 37240}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s785621857", "group_id": "codeNet:p02586", "input_text": " $dp[$j][3]) {\n $dp[$j][$k] = $dp[$j - 1][$k];\n } else {\n $dp[$j][$k] = $dp[$j][3];\n }\n }\n if (!isset($val[$i][$j])) continue;\n for ($k = 3; $k >= 1; --$k) {\n if ($dp[$j][$k - 1] + $val[$i][$j] > $dp[$j][$k]) {\n $dp[$j][$k] = $dp[$j][$k - 1] + $val[$i][$j];\n }\n }\n }\n}\necho $dp[$C][3], PHP_EOL;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1598281632, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02586.html", "problem_id": "p02586", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02586/input.txt", "sample_output_relpath": "derived/input_output/data/p02586/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02586/PHP/s785621857.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s785621857", "user_id": "u055687468"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": " $dp[$j][3]) {\n $dp[$j][$k] = $dp[$j - 1][$k];\n } else {\n $dp[$j][$k] = $dp[$j][3];\n }\n }\n if (!isset($val[$i][$j])) continue;\n for ($k = 3; $k >= 1; --$k) {\n if ($dp[$j][$k - 1] + $val[$i][$j] > $dp[$j][$k]) {\n $dp[$j][$k] = $dp[$j][$k - 1] + $val[$i][$j];\n }\n }\n }\n}\necho $dp[$C][3], PHP_EOL;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \\leq i \\leq R) and the j-th column (1 \\leq j \\leq C). The i-th item is at (r_i, c_i) and has the value v_i.\n\nTakahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).\n\nHe can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.\n\nFind the maximum possible sum of the values of items he picks up.\n\nConstraints\n\n1 \\leq R, C \\leq 3000\n\n1 \\leq K \\leq \\min(2 \\times 10^5, R \\times C)\n\n1 \\leq r_i \\leq R\n\n1 \\leq c_i \\leq C\n\n(r_i, c_i) \\neq (r_j, c_j) (i \\neq j)\n\n1 \\leq v_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR C K\nr_1 c_1 v_1\nr_2 c_2 v_2\n:\nr_K c_K v_K\n\nOutput\n\nPrint the maximum possible sum of the values of items Takahashi picks up.\n\nSample Input 1\n\n2 2 3\n1 1 3\n2 1 4\n1 2 5\n\nSample Output 1\n\n8\n\nHe has two ways to get to the goal:\n\nVisit (1, 1), (1, 2), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 5 = 8.\n\nVisit (1, 1), (2, 1), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 4 = 7.\n\nThus, the maximum possible sum of the values of items he picks up is 8.\n\nSample Input 2\n\n2 5 5\n1 1 3\n2 4 20\n1 2 1\n1 3 4\n1 4 2\n\nSample Output 2\n\n29\n\nWe have four items in the 1-st row. The optimal choices are as follows:\n\nVisit (1, 1) (1, 2), (1, 3), (1, 4), (2, 4), and (2, 5), in this order, and pick up all items except the one on (1, 2). Then, the total value of the items he picks up will be 3 + 4 + 2 + 20 = 29.\n\nSample Input 3\n\n4 5 10\n2 5 12\n1 5 12\n2 3 15\n1 2 20\n1 1 28\n2 4 26\n3 2 27\n4 5 21\n3 5 10\n1 3 10\n\nSample Output 3\n\n142", "sample_input": "2 2 3\n1 1 3\n2 1 4\n1 2 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02586", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \\leq i \\leq R) and the j-th column (1 \\leq j \\leq C). The i-th item is at (r_i, c_i) and has the value v_i.\n\nTakahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).\n\nHe can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.\n\nFind the maximum possible sum of the values of items he picks up.\n\nConstraints\n\n1 \\leq R, C \\leq 3000\n\n1 \\leq K \\leq \\min(2 \\times 10^5, R \\times C)\n\n1 \\leq r_i \\leq R\n\n1 \\leq c_i \\leq C\n\n(r_i, c_i) \\neq (r_j, c_j) (i \\neq j)\n\n1 \\leq v_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR C K\nr_1 c_1 v_1\nr_2 c_2 v_2\n:\nr_K c_K v_K\n\nOutput\n\nPrint the maximum possible sum of the values of items Takahashi picks up.\n\nSample Input 1\n\n2 2 3\n1 1 3\n2 1 4\n1 2 5\n\nSample Output 1\n\n8\n\nHe has two ways to get to the goal:\n\nVisit (1, 1), (1, 2), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 5 = 8.\n\nVisit (1, 1), (2, 1), and (2, 2), in this order. In this case, the total value of the items he can pick up is 3 + 4 = 7.\n\nThus, the maximum possible sum of the values of items he picks up is 8.\n\nSample Input 2\n\n2 5 5\n1 1 3\n2 4 20\n1 2 1\n1 3 4\n1 4 2\n\nSample Output 2\n\n29\n\nWe have four items in the 1-st row. The optimal choices are as follows:\n\nVisit (1, 1) (1, 2), (1, 3), (1, 4), (2, 4), and (2, 5), in this order, and pick up all items except the one on (1, 2). Then, the total value of the items he picks up will be 3 + 4 + 2 + 20 = 29.\n\nSample Input 3\n\n4 5 10\n2 5 12\n1 5 12\n2 3 15\n1 2 20\n1 1 28\n2 4 26\n3 2 27\n4 5 21\n3 5 10\n1 3 10\n\nSample Output 3\n\n142", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 923, "cpu_time_ms": 2342, "memory_kb": 36696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s860631767", "group_id": "codeNet:p02586", "input_text": "= 30) {\n echo('OK');\n } else {\n echo('NO');\n };\n?>", "language": "PHP", "metadata": {"date": 1596417081, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02594.html", "problem_id": "p02594", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02594/input.txt", "sample_output_relpath": "derived/input_output/data/p02594/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02594/PHP/s904435412.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s904435412", "user_id": "u803565203"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "= 30) {\n echo('OK');\n } else {\n echo('NO');\n };\n?>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.\n\nThe current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?\n\nConstraints\n\n-40 \\leq X \\leq 40\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint Yes if you will turn on the air conditioner; print No otherwise.\n\nSample Input 1\n\n25\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n30\n\nSample Output 2\n\nYes", "sample_input": "25\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02594", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.\n\nThe current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?\n\nConstraints\n\n-40 \\leq X \\leq 40\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint Yes if you will turn on the air conditioner; print No otherwise.\n\nSample Input 1\n\n25\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n30\n\nSample Output 2\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 118, "cpu_time_ms": 21, "memory_kb": 16196}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s521993193", "group_id": "codeNet:p02595", "input_text": "1){\n $ans = intdiv($R+$L, 2);\n //echo \"RL:\".$R.\" \".$L.\" \".$ans.PHP_EOL;\n $cut = 0;\n for ($i=0; $i<$n; $i++) {\n $cnt = intdiv($ans + $a[$i]-1, $ans)-1;\n if($cnt > 0){\n $cut += $cnt;\n }\n }\n //echo $cut.PHP_EOL;\n \n if($cut <= $k){\n $R = $ans;\n }else{\n $L = $ans;\n }\n \n }\n\n echo $R;\n", "language": "PHP", "metadata": {"date": 1596422071, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02598.html", "problem_id": "p02598", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02598/input.txt", "sample_output_relpath": "derived/input_output/data/p02598/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02598/PHP/s340001638.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s340001638", "user_id": "u800169017"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "1){\n $ans = intdiv($R+$L, 2);\n //echo \"RL:\".$R.\" \".$L.\" \".$ans.PHP_EOL;\n $cut = 0;\n for ($i=0; $i<$n; $i++) {\n $cnt = intdiv($ans + $a[$i]-1, $ans)-1;\n if($cnt > 0){\n $cut += $cnt;\n }\n }\n //echo $cut.PHP_EOL;\n \n if($cut <= $k){\n $R = $ans;\n }else{\n $L = $ans;\n }\n \n }\n\n echo $R;\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N logs of lengths A_1,A_2,\\cdots A_N.\n\nWe can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0 1) {\n $mid = intdiv($ok + $ng, 2);\n $cnt = 0;\n\n $ok2 = 10 ** 9;\n for ($i = 0; $i < $n; ++$i) {\n $ng2 = -1;\n while (abs($ok2 - $ng2) > 1) {\n $mid2 = intdiv($ok2 + $ng2, 2);\n if ($mid2 * $mid >= $a[$i]) $ok2 = $mid2;\n else $ng2 = $mid2;\n }\n $cnt += $ok2 - 1;\n }\n if ($cnt <= $k) $ok = $mid;\n else $ng = $mid;\n}\necho $ok;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1596420985, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02598.html", "problem_id": "p02598", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02598/input.txt", "sample_output_relpath": "derived/input_output/data/p02598/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02598/PHP/s329720534.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s329720534", "user_id": "u055687468"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": " 1) {\n $mid = intdiv($ok + $ng, 2);\n $cnt = 0;\n\n $ok2 = 10 ** 9;\n for ($i = 0; $i < $n; ++$i) {\n $ng2 = -1;\n while (abs($ok2 - $ng2) > 1) {\n $mid2 = intdiv($ok2 + $ng2, 2);\n if ($mid2 * $mid >= $a[$i]) $ok2 = $mid2;\n else $ng2 = $mid2;\n }\n $cnt += $ok2 - 1;\n }\n if ($cnt <= $k) $ok = $mid;\n else $ng = $mid;\n}\necho $ok;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N logs of lengths A_1,A_2,\\cdots A_N.\n\nWe can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0= 400 and $x < 600) {\n echo '8'.PHP_EOL;\n} else if ($x >= 600 and $x < 800) {\n echo '7'.PHP_EOL;\n} else if ($x >= 800 and $x < 1000) {\n echo '6'.PHP_EOL;\n} else if ($x >= 1000 and $x < 1200) {\n echo '5'.PHP_EOL;\n} else if ($x >= 1200 and $x < 1400) {\n echo '4'.PHP_EOL;\n} else if ($x >= 1400 and $x < 1600) {\n echo '3'.PHP_EOL;\n} else if ($x >= 1600 and $x < 1800) {\n echo '2'.PHP_EOL;\n} else if ($x >= 1800 and $x < 2000) {\n echo '1'.PHP_EOL;\n}", "language": "PHP", "metadata": {"date": 1595725711, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02600.html", "problem_id": "p02600", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02600/input.txt", "sample_output_relpath": "derived/input_output/data/p02600/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02600/PHP/s459323254.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s459323254", "user_id": "u016536213"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "= 400 and $x < 600) {\n echo '8'.PHP_EOL;\n} else if ($x >= 600 and $x < 800) {\n echo '7'.PHP_EOL;\n} else if ($x >= 800 and $x < 1000) {\n echo '6'.PHP_EOL;\n} else if ($x >= 1000 and $x < 1200) {\n echo '5'.PHP_EOL;\n} else if ($x >= 1200 and $x < 1400) {\n echo '4'.PHP_EOL;\n} else if ($x >= 1400 and $x < 1600) {\n echo '3'.PHP_EOL;\n} else if ($x >= 1600 and $x < 1800) {\n echo '2'.PHP_EOL;\n} else if ($x >= 1800 and $x < 2000) {\n echo '1'.PHP_EOL;\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nM-kun is a competitor in AtCoder, whose highest rating is X.\n\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\nFrom 400 through 599: 8-kyu\n\nFrom 600 through 799: 7-kyu\n\nFrom 800 through 999: 6-kyu\n\nFrom 1000 through 1199: 5-kyu\n\nFrom 1200 through 1399: 4-kyu\n\nFrom 1400 through 1599: 3-kyu\n\nFrom 1600 through 1799: 2-kyu\n\nFrom 1800 through 1999: 1-kyu\n\nWhat kyu does M-kun have?\n\nConstraints\n\n400 \\leq X \\leq 1999\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the kyu M-kun has, as an integer.\nFor example, if he has 8-kyu, print 8.\n\nSample Input 1\n\n725\n\nSample Output 1\n\n7\n\nM-kun's highest rating is 725, which corresponds to 7-kyu.\n\nThus, 7 is the correct output.\n\nSample Input 2\n\n1600\n\nSample Output 2\n\n2\n\nM-kun's highest rating is 1600, which corresponds to 2-kyu.\n\nThus, 2 is the correct output.", "sample_input": "725\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02600", "source_text": "Score: 100 points\n\nProblem Statement\n\nM-kun is a competitor in AtCoder, whose highest rating is X.\n\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\nFrom 400 through 599: 8-kyu\n\nFrom 600 through 799: 7-kyu\n\nFrom 800 through 999: 6-kyu\n\nFrom 1000 through 1199: 5-kyu\n\nFrom 1200 through 1399: 4-kyu\n\nFrom 1400 through 1599: 3-kyu\n\nFrom 1600 through 1799: 2-kyu\n\nFrom 1800 through 1999: 1-kyu\n\nWhat kyu does M-kun have?\n\nConstraints\n\n400 \\leq X \\leq 1999\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the kyu M-kun has, as an integer.\nFor example, if he has 8-kyu, print 8.\n\nSample Input 1\n\n725\n\nSample Output 1\n\n7\n\nM-kun's highest rating is 725, which corresponds to 7-kyu.\n\nThus, 7 is the correct output.\n\nSample Input 2\n\n1600\n\nSample Output 2\n\n2\n\nM-kun's highest rating is 1600, which corresponds to 2-kyu.\n\nThus, 2 is the correct output.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 509, "cpu_time_ms": 28, "memory_kb": 16256}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s560315736", "group_id": "codeNet:p02601", "input_text": " ($card['green'] * $kaisu) && ($card['green'] * $kaisu) > ($card['red'] * $kaisu)){\n echo \"Yes\";\n}else{\n echo \"No\";\n}\n\n?>", "language": "PHP", "metadata": {"date": 1595726685, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02601.html", "problem_id": "p02601", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02601/input.txt", "sample_output_relpath": "derived/input_output/data/p02601/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02601/PHP/s560315736.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s560315736", "user_id": "u649004367"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " ($card['green'] * $kaisu) && ($card['green'] * $kaisu) > ($card['red'] * $kaisu)){\n echo \"Yes\";\n}else{\n echo \"No\";\n}\n\n?>", "problem_context": "Score: 200 points\n\nProblem Statement\n\nM-kun has the following three cards:\n\nA red card with the integer A.\n\nA green card with the integer B.\n\nA blue card with the integer C.\n\nHe is a genius magician who can do the following operation at most K times:\n\nChoose one of the three cards and multiply the written integer by 2.\n\nHis magic is successful if both of the following conditions are satisfied after the operations:\n\nThe integer on the green card is strictly greater than the integer on the red card.\n\nThe integer on the blue card is strictly greater than the integer on the green card.\n\nDetermine whether the magic can be successful.\n\nConstraints\n\n1 \\leq A, B, C \\leq 7\n\n1 \\leq K \\leq 7\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\nK\n\nOutput\n\nIf the magic can be successful, print Yes; otherwise, print No.\n\nSample Input 1\n\n7 2 5\n3\n\nSample Output 1\n\nYes\n\nThe magic will be successful if, for example, he does the following operations:\n\nFirst, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.\n\nSecond, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.\n\nThird, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.\n\nSample Input 2\n\n7 4 2\n3\n\nSample Output 2\n\nNo\n\nHe has no way to succeed in the magic with at most three operations.", "sample_input": "7 2 5\n3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02601", "source_text": "Score: 200 points\n\nProblem Statement\n\nM-kun has the following three cards:\n\nA red card with the integer A.\n\nA green card with the integer B.\n\nA blue card with the integer C.\n\nHe is a genius magician who can do the following operation at most K times:\n\nChoose one of the three cards and multiply the written integer by 2.\n\nHis magic is successful if both of the following conditions are satisfied after the operations:\n\nThe integer on the green card is strictly greater than the integer on the red card.\n\nThe integer on the blue card is strictly greater than the integer on the green card.\n\nDetermine whether the magic can be successful.\n\nConstraints\n\n1 \\leq A, B, C \\leq 7\n\n1 \\leq K \\leq 7\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\nK\n\nOutput\n\nIf the magic can be successful, print Yes; otherwise, print No.\n\nSample Input 1\n\n7 2 5\n3\n\nSample Output 1\n\nYes\n\nThe magic will be successful if, for example, he does the following operations:\n\nFirst, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.\n\nSecond, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.\n\nThird, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.\n\nSample Input 2\n\n7 4 2\n3\n\nSample Output 2\n\nNo\n\nHe has no way to succeed in the magic with at most three operations.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 281, "cpu_time_ms": 24, "memory_kb": 16172}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s748367840", "group_id": "codeNet:p02604", "input_text": " $k) return PHP_INT_MAX;\n if ($d === $n || count($lxs) + count($lys) - 2 === $k) return calc($lxs, $lys);\n $res[] = dfs($k, $d + 1, $lxs, $lys);\n $_lxs = $lxs;\n $_lys = $lys;\n $_lxs[$x[$d]] = true;\n $_lys[$y[$d]] = true;\n $res[] = dfs($k, $d + 1, $_lxs, $lys);\n $res[] = dfs($k, $d + 1, $lxs, $_lys);\n $res[] = dfs($k, $d + 1, $_lxs, $_lys);\n return min($res);\n}\nfunction calc($lxs, $lys)\n{\n global $n, $x, $y, $p;\n $res = 0;\n $lxs = array_keys($lxs);\n $lys = array_keys($lys);\n for ($i = 0; $i < $n; ++$i) {\n $dist = PHP_INT_MAX;\n foreach ($lxs as $lx)\n $dist = min($dist, abs($x[$i] - $lx));\n foreach ($lys as $ly)\n $dist = min($dist, abs($y[$i] - $ly));\n $res += $dist * $p[$i];\n }\n return $res;\n}\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1595729255, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02604.html", "problem_id": "p02604", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02604/input.txt", "sample_output_relpath": "derived/input_output/data/p02604/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02604/PHP/s748367840.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s748367840", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2900\n900\n0\n0\n", "input_to_evaluate": " $k) return PHP_INT_MAX;\n if ($d === $n || count($lxs) + count($lys) - 2 === $k) return calc($lxs, $lys);\n $res[] = dfs($k, $d + 1, $lxs, $lys);\n $_lxs = $lxs;\n $_lys = $lys;\n $_lxs[$x[$d]] = true;\n $_lys[$y[$d]] = true;\n $res[] = dfs($k, $d + 1, $_lxs, $lys);\n $res[] = dfs($k, $d + 1, $lxs, $_lys);\n $res[] = dfs($k, $d + 1, $_lxs, $_lys);\n return min($res);\n}\nfunction calc($lxs, $lys)\n{\n global $n, $x, $y, $p;\n $res = 0;\n $lxs = array_keys($lxs);\n $lys = array_keys($lys);\n for ($i = 0; $i < $n; ++$i) {\n $dist = PHP_INT_MAX;\n foreach ($lxs as $lx)\n $dist = min($dist, abs($x[$i] - $lx));\n foreach ($lys as $ly)\n $dist = min($dist, abs($y[$i] - $ly));\n $res += $dist * $p[$i];\n }\n return $res;\n}\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nNew AtCoder City has an infinite grid of streets, as follows:\n\nAt the center of the city stands a clock tower. Let (0, 0) be the coordinates of this point.\n\nA straight street, which we will call East-West Main Street, runs east-west and passes the clock tower. It corresponds to the x-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to East-West Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, y = -2, y = -1, y = 1, y = 2, \\ldots in the two-dimensional coordinate plane.\n\nA straight street, which we will call North-South Main Street, runs north-south and passes the clock tower. It corresponds to the y-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to North-South Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, x = -2, x = -1, x = 1, x = 2, \\ldots in the two-dimensional coordinate plane.\n\nThere are N residential areas in New AtCoder City. The i-th area is located at the intersection with the coordinates (X_i, Y_i) and has a population of P_i. Each citizen in the city lives in one of these areas.\n\nThe city currently has only two railroads, stretching infinitely, one along East-West Main Street and the other along North-South Main Street.\n\nM-kun, the mayor, thinks that they are not enough for the commuters, so he decides to choose K streets and build a railroad stretching infinitely along each of those streets.\n\nLet the walking distance of each citizen be the distance from his/her residential area to the nearest railroad.\n\nM-kun wants to build railroads so that the sum of the walking distances of all citizens, S, is minimized.\n\nFor each K = 0, 1, 2, \\dots, N, what is the minimum possible value of S after building railroads?\n\nConstraints\n\n1 \\leq N \\leq 15\n\n-10 \\ 000 \\leq X_i \\leq 10 \\ 000\n\n-10 \\ 000 \\leq Y_i \\leq 10 \\ 000\n\n1 \\leq P_i \\leq 1 \\ 000 \\ 000\n\nThe locations of the N residential areas, (X_i, Y_i), are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1 P_1\nX_2 Y_2 P_2\n: : :\nX_N Y_N P_N\n\nOutput\n\nPrint the answer in N+1 lines.\n\nThe i-th line (i = 1, \\ldots, N+1) should contain the minimum possible value of S after building railroads for the case K = i-1.\n\nSample Input 1\n\n3\n1 2 300\n3 3 600\n1 4 800\n\nSample Output 1\n\n2900\n900\n0\n0\n\nWhen K = 0, the residents of Area 1, 2, and 3 have to walk the distances of 1, 3, and 1, respectively, to reach a railroad.\n\nThus, the sum of the walking distances of all citizens, S, is 1 \\times 300 + 3 \\times 600 + 1 \\times 800 = 2900.\n\nWhen K = 1, if we build a railroad along the street corresponding to the line y = 4 in the coordinate plane, the walking distances of the citizens of Area 1, 2, and 3 become 1, 1, and 0, respectively.\n\nThen, S = 1 \\times 300 + 1 \\times 600 + 0 \\times 800 = 900.\n\nWe have many other options for where we build the railroad, but none of them makes S less than 900.\n\nWhen K = 2, if we build a railroad along the street corresponding to the lines x = 1 and x = 3 in the coordinate plane, all citizens can reach a railroad with the walking distance of 0, so S = 0. We can also have S = 0 when K = 3.\n\nThe figure below shows the optimal way to build railroads for the cases K = 0, 1, 2.\n\nThe street painted blue represents the roads along which we build railroads.\n\nSample Input 2\n\n5\n3 5 400\n5 3 700\n5 5 1000\n5 7 700\n7 5 400\n\nSample Output 2\n\n13800\n1600\n0\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the cases K = 1, 2.\n\nSample Input 3\n\n6\n2 5 1000\n5 2 1100\n5 5 1700\n-2 -5 900\n-5 -2 600\n-5 -5 2200\n\nSample Output 3\n\n26700\n13900\n3200\n1200\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 3.\n\nSample Input 4\n\n8\n2 2 286017\n3 1 262355\n2 -2 213815\n1 -3 224435\n-2 -2 136860\n-3 -1 239338\n-2 2 217647\n-1 3 141903\n\nSample Output 4\n\n2576709\n1569381\n868031\n605676\n366338\n141903\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 4.", "sample_input": "3\n1 2 300\n3 3 600\n1 4 800\n"}, "reference_outputs": ["2900\n900\n0\n0\n"], "source_document_id": "p02604", "source_text": "Score: 500 points\n\nProblem Statement\n\nNew AtCoder City has an infinite grid of streets, as follows:\n\nAt the center of the city stands a clock tower. Let (0, 0) be the coordinates of this point.\n\nA straight street, which we will call East-West Main Street, runs east-west and passes the clock tower. It corresponds to the x-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to East-West Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, y = -2, y = -1, y = 1, y = 2, \\ldots in the two-dimensional coordinate plane.\n\nA straight street, which we will call North-South Main Street, runs north-south and passes the clock tower. It corresponds to the y-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to North-South Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, x = -2, x = -1, x = 1, x = 2, \\ldots in the two-dimensional coordinate plane.\n\nThere are N residential areas in New AtCoder City. The i-th area is located at the intersection with the coordinates (X_i, Y_i) and has a population of P_i. Each citizen in the city lives in one of these areas.\n\nThe city currently has only two railroads, stretching infinitely, one along East-West Main Street and the other along North-South Main Street.\n\nM-kun, the mayor, thinks that they are not enough for the commuters, so he decides to choose K streets and build a railroad stretching infinitely along each of those streets.\n\nLet the walking distance of each citizen be the distance from his/her residential area to the nearest railroad.\n\nM-kun wants to build railroads so that the sum of the walking distances of all citizens, S, is minimized.\n\nFor each K = 0, 1, 2, \\dots, N, what is the minimum possible value of S after building railroads?\n\nConstraints\n\n1 \\leq N \\leq 15\n\n-10 \\ 000 \\leq X_i \\leq 10 \\ 000\n\n-10 \\ 000 \\leq Y_i \\leq 10 \\ 000\n\n1 \\leq P_i \\leq 1 \\ 000 \\ 000\n\nThe locations of the N residential areas, (X_i, Y_i), are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1 P_1\nX_2 Y_2 P_2\n: : :\nX_N Y_N P_N\n\nOutput\n\nPrint the answer in N+1 lines.\n\nThe i-th line (i = 1, \\ldots, N+1) should contain the minimum possible value of S after building railroads for the case K = i-1.\n\nSample Input 1\n\n3\n1 2 300\n3 3 600\n1 4 800\n\nSample Output 1\n\n2900\n900\n0\n0\n\nWhen K = 0, the residents of Area 1, 2, and 3 have to walk the distances of 1, 3, and 1, respectively, to reach a railroad.\n\nThus, the sum of the walking distances of all citizens, S, is 1 \\times 300 + 3 \\times 600 + 1 \\times 800 = 2900.\n\nWhen K = 1, if we build a railroad along the street corresponding to the line y = 4 in the coordinate plane, the walking distances of the citizens of Area 1, 2, and 3 become 1, 1, and 0, respectively.\n\nThen, S = 1 \\times 300 + 1 \\times 600 + 0 \\times 800 = 900.\n\nWe have many other options for where we build the railroad, but none of them makes S less than 900.\n\nWhen K = 2, if we build a railroad along the street corresponding to the lines x = 1 and x = 3 in the coordinate plane, all citizens can reach a railroad with the walking distance of 0, so S = 0. We can also have S = 0 when K = 3.\n\nThe figure below shows the optimal way to build railroads for the cases K = 0, 1, 2.\n\nThe street painted blue represents the roads along which we build railroads.\n\nSample Input 2\n\n5\n3 5 400\n5 3 700\n5 5 1000\n5 7 700\n7 5 400\n\nSample Output 2\n\n13800\n1600\n0\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the cases K = 1, 2.\n\nSample Input 3\n\n6\n2 5 1000\n5 2 1100\n5 5 1700\n-2 -5 900\n-5 -2 600\n-5 -5 2200\n\nSample Output 3\n\n26700\n13900\n3200\n1200\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 3.\n\nSample Input 4\n\n8\n2 2 286017\n3 1 262355\n2 -2 213815\n1 -3 224435\n-2 -2 136860\n-3 -1 239338\n-2 2 217647\n-1 3 141903\n\nSample Output 4\n\n2576709\n1569381\n868031\n605676\n366338\n141903\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 4.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1359, "cpu_time_ms": 3308, "memory_kb": 16228}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s284278684", "group_id": "codeNet:p02606", "input_text": "\n", "language": "PHP", "metadata": {"date": 1594516742, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02606.html", "problem_id": "p02606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02606/input.txt", "sample_output_relpath": "derived/input_output/data/p02606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02606/PHP/s284278684.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s284278684", "user_id": "u972534279"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many multiples of d are there among the integers between L and R (inclusive)?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq L \\leq R \\leq 100\n\n1 \\leq d \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R d\n\nOutput\n\nPrint the number of multiples of d among the integers between L and R (inclusive).\n\nSample Input 1\n\n5 10 2\n\nSample Output 1\n\n3\n\nAmong the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.\n\nSample Input 2\n\n6 20 7\n\nSample Output 2\n\n2\n\nAmong the integers between 6 and 20, there are two multiples of 7: 7 and 14.\n\nSample Input 3\n\n1 100 1\n\nSample Output 3\n\n100", "sample_input": "5 10 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02606", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many multiples of d are there among the integers between L and R (inclusive)?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq L \\leq R \\leq 100\n\n1 \\leq d \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R d\n\nOutput\n\nPrint the number of multiples of d among the integers between L and R (inclusive).\n\nSample Input 1\n\n5 10 2\n\nSample Output 1\n\n3\n\nAmong the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.\n\nSample Input 2\n\n6 20 7\n\nSample Output 2\n\n2\n\nAmong the integers between 6 and 20, there are two multiples of 7: 7 and 14.\n\nSample Input 3\n\n1 100 1\n\nSample Output 3\n\n100", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 184, "cpu_time_ms": 19, "memory_kb": 15984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s393270186", "group_id": "codeNet:p02607", "input_text": " $point) {\n if (!($index % 2 == 0)) {\n if (!($point % 2 == 0)) {\n array_push($counts, $point);\n }\n }\n}\necho count($counts);\n", "language": "PHP", "metadata": {"date": 1594522792, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02607.html", "problem_id": "p02607", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02607/input.txt", "sample_output_relpath": "derived/input_output/data/p02607/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02607/PHP/s393270186.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s393270186", "user_id": "u514633273"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $point) {\n if (!($index % 2 == 0)) {\n if (!($point % 2 == 0)) {\n array_push($counts, $point);\n }\n }\n}\necho count($counts);\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "sample_input": "5\n1 3 4 5 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02607", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 258, "cpu_time_ms": 29, "memory_kb": 16144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s207869452", "group_id": "codeNet:p02608", "input_text": " $l || $j > $l || $k > $l) {\n continue 2;\n }\n if ($i * $i + $j * $j + $k * $k + $i * $j + $j * $k + $i * $k == $l) {\n $ans++;\n $memo[] = \"$i-$j-$k\";\n }\n }\n }\n }\n if ($l > 6) {\n $ans *= 3;\n }\n echo $ans.\"\\n\";\n}\n", "language": "PHP", "metadata": {"date": 1594520058, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02608.html", "problem_id": "p02608", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02608/input.txt", "sample_output_relpath": "derived/input_output/data/p02608/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02608/PHP/s207869452.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s207869452", "user_id": "u430474060"}, "prompt_components": {"gold_output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n", "input_to_evaluate": " $l || $j > $l || $k > $l) {\n continue 2;\n }\n if ($i * $i + $j * $j + $k * $k + $i * $j + $j * $k + $i * $k == $l) {\n $ans++;\n $memo[] = \"$i-$j-$k\";\n }\n }\n }\n }\n if ($l > 6) {\n $ans *= 3;\n }\n echo $ans.\"\\n\";\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "sample_input": "20\n"}, "reference_outputs": ["0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"], "source_document_id": "p02608", "source_text": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 943, "cpu_time_ms": 2206, "memory_kb": 16172}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s448810895", "group_id": "codeNet:p02619", "input_text": "", "language": "PHP", "metadata": {"date": 1592788011, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02627.html", "problem_id": "p02627", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02627/input.txt", "sample_output_relpath": "derived/input_output/data/p02627/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02627/PHP/s770630266.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s770630266", "user_id": "u717740055"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "sample_input": "B\n"}, "reference_outputs": ["A\n"], "source_document_id": "p02627", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 116, "cpu_time_ms": 25, "memory_kb": 16144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s038637036", "group_id": "codeNet:p02627", "input_text": "", "language": "PHP", "metadata": {"date": 1592787839, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02627.html", "problem_id": "p02627", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02627/input.txt", "sample_output_relpath": "derived/input_output/data/p02627/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02627/PHP/s038637036.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s038637036", "user_id": "u099640467"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "sample_input": "B\n"}, "reference_outputs": ["A\n"], "source_document_id": "p02627", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 154, "cpu_time_ms": 25, "memory_kb": 16044}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s809900140", "group_id": "codeNet:p02628", "input_text": "", "language": "PHP", "metadata": {"date": 1592790241, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02628.html", "problem_id": "p02628", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02628/input.txt", "sample_output_relpath": "derived/input_output/data/p02628/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02628/PHP/s809900140.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s809900140", "user_id": "u717740055"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "sample_input": "5 3\n50 100 80 120 80\n"}, "reference_outputs": ["210\n"], "source_document_id": "p02628", "source_text": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 275, "cpu_time_ms": 24, "memory_kb": 16284}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s717366300", "group_id": "codeNet:p02628", "input_text": "26){\n $tmp_n /= 26;\n $c++;\n}\n//echo $c;\n$syo = array();\nfor($i=$c;$i>0;$i--){\n $syo[] = (int)($n/pow(26,$i));\n $n -= pow(26,$i)*(int)($n/pow(26,$i));\n $z++;\n}\n\nforeach($syo as $v){\n echo $abc[$v];\n}\necho $abc[$end];", "language": "PHP", "metadata": {"date": 1592793001, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/PHP/s132278820.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s132278820", "user_id": "u553494195"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "26){\n $tmp_n /= 26;\n $c++;\n}\n//echo $c;\n$syo = array();\nfor($i=$c;$i>0;$i--){\n $syo[] = (int)($n/pow(26,$i));\n $n -= pow(26,$i)*(int)($n/pow(26,$i));\n $z++;\n}\n\nforeach($syo as $v){\n echo $abc[$v];\n}\necho $abc[$end];", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 433, "cpu_time_ms": 26, "memory_kb": 16164}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s587104569", "group_id": "codeNet:p02630", "input_text": " $array) {\n if($value === 0) {\n echo $index+1;\n }\n}", "language": "PHP", "metadata": {"date": 1599651305, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02639/input.txt", "sample_output_relpath": "derived/input_output/data/p02639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02639/PHP/s013840071.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s013840071", "user_id": "u695721877"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $array) {\n if($value === 0) {\n echo $index+1;\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "sample_input": "0 2 3 4 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02639", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 154, "cpu_time_ms": 21, "memory_kb": 15980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s177956584", "group_id": "codeNet:p02639", "input_text": " $abs) {\n $min = $abs;\n $ans = $i;\n } \n} \necho $ans;", "language": "PHP", "metadata": {"date": 1592248756, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02641/input.txt", "sample_output_relpath": "derived/input_output/data/p02641/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02641/PHP/s166482818.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s166482818", "user_id": "u574084351"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": " $abs) {\n $min = $abs;\n $ans = $i;\n } \n} \necho $ans;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 414, "cpu_time_ms": 20, "memory_kb": 16136}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s932014142", "group_id": "codeNet:p02641", "input_text": "=$sum_b){\n echo \"YES\";\n}else{\n echo \"NO\";\n}", "language": "PHP", "metadata": {"date": 1592101952, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02646/input.txt", "sample_output_relpath": "derived/input_output/data/p02646/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02646/PHP/s562763586.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s562763586", "user_id": "u553494195"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": " =$sum_b){\n echo \"YES\";\n}else{\n echo \"NO\";\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "sample_input": "1 2\n3 1\n3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02646", "source_text": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 193, "cpu_time_ms": 18, "memory_kb": 16096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s496669780", "group_id": "codeNet:p02646", "input_text": " 0) {\n echo \"NO\";\n exit();\n }\n\n $tijimaruKyori = (int)$chaceTime * (int)$V;\n\n if ($tijimaruKyori > $distance) {\n echo \"YES\";\n exit();\n }\n\n echo \"NO\";\n", "language": "PHP", "metadata": {"date": 1592099099, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02646/input.txt", "sample_output_relpath": "derived/input_output/data/p02646/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02646/PHP/s496669780.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s496669780", "user_id": "u149182854"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": " 0) {\n echo \"NO\";\n exit();\n }\n\n $tijimaruKyori = (int)$chaceTime * (int)$V;\n\n if ($tijimaruKyori > $distance) {\n echo \"YES\";\n exit();\n }\n\n echo \"NO\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "sample_input": "1 2\n3 1\n3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02646", "source_text": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 816, "cpu_time_ms": 22, "memory_kb": 16456}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s773963502", "group_id": "codeNet:p02657", "input_text": " $i) { \n while ($i < 0xFFFFFF) { //$iの上限を設定 \n if ($n % $i == 0) { //$nが$iで割り切れた場合 \n $result[] = $i; //$iを素因数として配列に格納 \n $n /= $i; //$nを$iで割って$nに代入。 \n } \n $i++; //$iに1をプラス\n } \n}\necho count($result);\n?>\n", "language": "PHP", "metadata": {"date": 1590977510, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02660.html", "problem_id": "p02660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02660/input.txt", "sample_output_relpath": "derived/input_output/data/p02660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02660/PHP/s515832475.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s515832475", "user_id": "u308307475"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $i) { \n while ($i < 0xFFFFFF) { //$iの上限を設定 \n if ($n % $i == 0) { //$nが$iで割り切れた場合 \n $result[] = $i; //$iを素因数として配列に格納 \n $n /= $i; //$nを$iで割って$nに代入。 \n } \n $i++; //$iに1をプラス\n } \n}\necho count($result);\n?>\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "sample_input": "24\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02660", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 525, "cpu_time_ms": 2206, "memory_kb": 16096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s581586519", "group_id": "codeNet:p02660", "input_text": "\n", "language": "PHP", "metadata": {"date": 1590976856, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02660.html", "problem_id": "p02660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02660/input.txt", "sample_output_relpath": "derived/input_output/data/p02660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02660/PHP/s581586519.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s581586519", "user_id": "u308307475"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "sample_input": "24\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02660", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 515, "cpu_time_ms": 19, "memory_kb": 16172}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s670167509", "group_id": "codeNet:p02662", "input_text": "=$v;\n });\n $N = count($A);\n rsort($A);\n (function () use ($A) {\n $num = 0;\n foreach ($A as $v) {\n $num += $v;\n if ($num >= $S) {\n return;\n }\n }\n echo 0;\n exit;\n })();\n sort($A);\n\n $total = 0;\n\n $map = [0=>1];\n foreach ($A as $i => $av) {\n $nmap = [];\n foreach ($map as $mp => $mv) {\n if ($mp + $av <= $S) {\n $nmap[$mp + $av] += $mv;\n }\n $nmap[$mp] += ($mv * 2)%998244353;\n }\n // $map[$av] += $powmap[$i];\n krsort($nmap);\n $map = $nmap;\n // var_dump([$av, $map]);\n }\n\n $total = $map[$S];\n echo ($total%998244353).PHP_EOL;\n})();\n// 1<=e1<=e2<=e3\n// f({e1}) = {e1} = 0\n// f({e2}) = {e2} = 0\n// f({e3}) = {e3} = 1\n// f({e1,e2}) => {e1}+{e2}+{e1,e2} = 0,0,1 = 1\n// f({e1,e3}) => {e1}+{e3}+{e1,e3} = 0,1,0 = 1\n// f({e2,e3}) => {e2}+{e3}+{e2,e3} = 0,1,0 = 1\n// f({e1,e2,e3}) => {e1}+{e2}+{e3}+{e1,e2}+{e1,e3}+{e2,e3}+{e1,e2,e3} = 0,0,1,1,0,0,0=2\n\n// {e1}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e2}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e3}<{e1,e3},{e2,e3},{e1,e2,e3}\n// {e1,e2}<={e1,e3},{e2,e3}\n// {e1,e2}<{e1,e2,e3}\n// {e1,e3}<={e2,e3}\n// {e1,e3}<{e1,e2,e3}\n// {e2,e3}<{e1,e2,e3}\n\n// {e1}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e2}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e3}<{e1,e3},{e2,e3},{e1,e2,e3}\n// {e1,e2}<={e1,e3},{e2,e3}\n// {e1,e2}<{e1,e2,e3}\n// {e1,e3}<={e2,e3}\n// {e1,e3}<{e1,e2,e3}\n// {e2,e3}<{e1,e2,e3}\n", "language": "PHP", "metadata": {"date": 1591587703, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02662.html", "problem_id": "p02662", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02662/input.txt", "sample_output_relpath": "derived/input_output/data/p02662/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02662/PHP/s670167509.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s670167509", "user_id": "u641616639"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "=$v;\n });\n $N = count($A);\n rsort($A);\n (function () use ($A) {\n $num = 0;\n foreach ($A as $v) {\n $num += $v;\n if ($num >= $S) {\n return;\n }\n }\n echo 0;\n exit;\n })();\n sort($A);\n\n $total = 0;\n\n $map = [0=>1];\n foreach ($A as $i => $av) {\n $nmap = [];\n foreach ($map as $mp => $mv) {\n if ($mp + $av <= $S) {\n $nmap[$mp + $av] += $mv;\n }\n $nmap[$mp] += ($mv * 2)%998244353;\n }\n // $map[$av] += $powmap[$i];\n krsort($nmap);\n $map = $nmap;\n // var_dump([$av, $map]);\n }\n\n $total = $map[$S];\n echo ($total%998244353).PHP_EOL;\n})();\n// 1<=e1<=e2<=e3\n// f({e1}) = {e1} = 0\n// f({e2}) = {e2} = 0\n// f({e3}) = {e3} = 1\n// f({e1,e2}) => {e1}+{e2}+{e1,e2} = 0,0,1 = 1\n// f({e1,e3}) => {e1}+{e3}+{e1,e3} = 0,1,0 = 1\n// f({e2,e3}) => {e2}+{e3}+{e2,e3} = 0,1,0 = 1\n// f({e1,e2,e3}) => {e1}+{e2}+{e3}+{e1,e2}+{e1,e3}+{e2,e3}+{e1,e2,e3} = 0,0,1,1,0,0,0=2\n\n// {e1}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e2}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e3}<{e1,e3},{e2,e3},{e1,e2,e3}\n// {e1,e2}<={e1,e3},{e2,e3}\n// {e1,e2}<{e1,e2,e3}\n// {e1,e3}<={e2,e3}\n// {e1,e3}<{e1,e2,e3}\n// {e2,e3}<{e1,e2,e3}\n\n// {e1}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e2}<{e1,e2},{e1,e3},{e2,e3},{e1,e2,e3}\n// {e3}<{e1,e3},{e2,e3},{e1,e2,e3}\n// {e1,e2}<={e1,e3},{e2,e3}\n// {e1,e2}<{e1,e2,e3}\n// {e1,e3}<={e2,e3}\n// {e1,e3}<{e1,e2,e3}\n// {e2,e3}<{e1,e2,e3}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N and another positive integer S.\n\nFor a non-empty subset T of the set \\{1, 2, \\ldots , N \\}, let us define f(T) as follows:\n\nf(T) is the number of different non-empty subsets \\{x_1, x_2, \\ldots , x_k \\} of T such that A_{x_1}+A_{x_2}+\\cdots +A_{x_k} = S.\n\nFind the sum of f(T) over all 2^N-1 subsets T of \\{1, 2, \\ldots , N \\}. Since the sum can be enormous, print it modulo 998244353.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3000\n\n1 \\leq S \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN S\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the sum of f(T) modulo 998244353.\n\nSample Input 1\n\n3 4\n2 2 4\n\nSample Output 1\n\n6\n\nFor each T, the value of f(T) is shown below. The sum of these values is 6.\n\nf(\\{1\\}) = 0\n\nf(\\{2\\}) = 0\n\nf(\\{3\\}) = 1 (One subset \\{3\\} satisfies the condition.)\n\nf(\\{1, 2\\}) = 1 (\\{1, 2\\})\n\nf(\\{2, 3\\}) = 1 (\\{3\\})\n\nf(\\{1, 3\\}) = 1 (\\{3\\})\n\nf(\\{1, 2, 3\\}) = 2 (\\{1, 2\\}, \\{3\\})\n\nSample Input 2\n\n5 8\n9 9 9 9 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n10 10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n3296", "sample_input": "3 4\n2 2 4\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02662", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N and another positive integer S.\n\nFor a non-empty subset T of the set \\{1, 2, \\ldots , N \\}, let us define f(T) as follows:\n\nf(T) is the number of different non-empty subsets \\{x_1, x_2, \\ldots , x_k \\} of T such that A_{x_1}+A_{x_2}+\\cdots +A_{x_k} = S.\n\nFind the sum of f(T) over all 2^N-1 subsets T of \\{1, 2, \\ldots , N \\}. Since the sum can be enormous, print it modulo 998244353.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3000\n\n1 \\leq S \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN S\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the sum of f(T) modulo 998244353.\n\nSample Input 1\n\n3 4\n2 2 4\n\nSample Output 1\n\n6\n\nFor each T, the value of f(T) is shown below. The sum of these values is 6.\n\nf(\\{1\\}) = 0\n\nf(\\{2\\}) = 0\n\nf(\\{3\\}) = 1 (One subset \\{3\\} satisfies the condition.)\n\nf(\\{1, 2\\}) = 1 (\\{1, 2\\})\n\nf(\\{2, 3\\}) = 1 (\\{3\\})\n\nf(\\{1, 3\\}) = 1 (\\{3\\})\n\nf(\\{1, 2, 3\\}) = 2 (\\{1, 2\\}, \\{3\\})\n\nSample Input 2\n\n5 8\n9 9 9 9 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n10 10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n3296", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2250, "cpu_time_ms": 2388, "memory_kb": 93648}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s352532055", "group_id": "codeNet:p02664", "input_text": " 0 && $arr[$i - 1] === 'P') {\n $score++;\n }\n }\n echo PHP_EOL . $score;\n}", "language": "PHP", "metadata": {"date": 1593242894, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02664.html", "problem_id": "p02664", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02664/input.txt", "sample_output_relpath": "derived/input_output/data/p02664/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02664/PHP/s352532055.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s352532055", "user_id": "u195912432"}, "prompt_components": {"gold_output": "PDPDPDP\n", "input_to_evaluate": " 0 && $arr[$i - 1] === 'P') {\n $score++;\n }\n }\n echo PHP_EOL . $score;\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFor a string S consisting of the uppercase English letters P and D, let the doctoral and postdoctoral quotient of S be the total number of occurrences of D and PD in S as contiguous substrings. For example, if S = PPDDP, it contains two occurrences of D and one occurrence of PD as contiguous substrings, so the doctoral and postdoctoral quotient of S is 3.\n\nWe have a string T consisting of P, D, and ?.\n\nAmong the strings that can be obtained by replacing each ? in T with P or D, find one with the maximum possible doctoral and postdoctoral quotient.\n\nConstraints\n\n1 \\leq |T| \\leq 2 \\times 10^5\n\nT consists of P, D, and ?.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\n\nOutput\n\nPrint one string with the maximum possible doctoral and postdoctoral quotient among the strings that can be obtained by replacing each ? in T with P or D.\nIf there are multiple such strings, you may print any of them.\n\nSample Input 1\n\nPD?D??P\n\nSample Output 1\n\nPDPDPDP\n\nThis string contains three occurrences of D and three occurrences of PD as contiguous substrings, so its doctoral and postdoctoral quotient is 6, which is the maximum doctoral and postdoctoral quotient of a string obtained by replacing each ? in T with P or D.\n\nSample Input 2\n\nP?P?\n\nSample Output 2\n\nPDPD", "sample_input": "PD?D??P\n"}, "reference_outputs": ["PDPDPDP\n"], "source_document_id": "p02664", "source_text": "Score : 200 points\n\nProblem Statement\n\nFor a string S consisting of the uppercase English letters P and D, let the doctoral and postdoctoral quotient of S be the total number of occurrences of D and PD in S as contiguous substrings. For example, if S = PPDDP, it contains two occurrences of D and one occurrence of PD as contiguous substrings, so the doctoral and postdoctoral quotient of S is 3.\n\nWe have a string T consisting of P, D, and ?.\n\nAmong the strings that can be obtained by replacing each ? in T with P or D, find one with the maximum possible doctoral and postdoctoral quotient.\n\nConstraints\n\n1 \\leq |T| \\leq 2 \\times 10^5\n\nT consists of P, D, and ?.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\n\nOutput\n\nPrint one string with the maximum possible doctoral and postdoctoral quotient among the strings that can be obtained by replacing each ? in T with P or D.\nIf there are multiple such strings, you may print any of them.\n\nSample Input 1\n\nPD?D??P\n\nSample Output 1\n\nPDPDPDP\n\nThis string contains three occurrences of D and three occurrences of PD as contiguous substrings, so its doctoral and postdoctoral quotient is 6, which is the maximum doctoral and postdoctoral quotient of a string obtained by replacing each ? in T with P or D.\n\nSample Input 2\n\nP?P?\n\nSample Output 2\n\nPDPD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 382, "cpu_time_ms": 30, "memory_kb": 16384}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s018583098", "group_id": "codeNet:p02664", "input_text": "= 0 ){\n $ans += $k;\n $list[] = $last;\n unset($copy[$i]);\n}elseif($array[$length-1] === \"1\") {\n $ans += $k;\n $list[] = $length-1;\n unset($copy[$i]);\n}else{\n if(count($list) === 0){\n echo 0;\n exit;\n }\n $k--;\n}\nkrsort($copy);\n$reverse = 0;\n$truth = 0;\n$next = count($list)-1;\n//$next = $list[$list_count];\nforeach($copy as $key=>$value){\n\n if( $next >= 0 && $key < $list[$next]){\n\n while ($key < $list[$next]) {\n if($array[$list[$next]] === \"1\"){\n\n if($next % 2 === 0){\n $truth++;\n $k--;\n }else{\n $reverse++;\n }\n\n }\n// if ($next === 0) {\n// break;\n// }\n\n $next--;\n if($next < 0){\n break;\n }\n }\n\n\n }\n if( $next === -1 || $key > $list[$next]){\n\n if($value === \"1\"){\n if($next % 2 === 0){\n $truth++;\n }else{\n $reverse++;\n }\n\n }\n $tmp = $truth ;\n $truth = $reverse;\n $reverse = $tmp;\n $ans += $k + $truth;\n }\n}\necho $ans;\n\n", "language": "PHP", "metadata": {"date": 1590872030, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02667.html", "problem_id": "p02667", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02667/input.txt", "sample_output_relpath": "derived/input_output/data/p02667/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02667/PHP/s053365510.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s053365510", "user_id": "u274811210"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "= 0 ){\n $ans += $k;\n $list[] = $last;\n unset($copy[$i]);\n}elseif($array[$length-1] === \"1\") {\n $ans += $k;\n $list[] = $length-1;\n unset($copy[$i]);\n}else{\n if(count($list) === 0){\n echo 0;\n exit;\n }\n $k--;\n}\nkrsort($copy);\n$reverse = 0;\n$truth = 0;\n$next = count($list)-1;\n//$next = $list[$list_count];\nforeach($copy as $key=>$value){\n\n if( $next >= 0 && $key < $list[$next]){\n\n while ($key < $list[$next]) {\n if($array[$list[$next]] === \"1\"){\n\n if($next % 2 === 0){\n $truth++;\n $k--;\n }else{\n $reverse++;\n }\n\n }\n// if ($next === 0) {\n// break;\n// }\n\n $next--;\n if($next < 0){\n break;\n }\n }\n\n\n }\n if( $next === -1 || $key > $list[$next]){\n\n if($value === \"1\"){\n if($next % 2 === 0){\n $truth++;\n }else{\n $reverse++;\n }\n\n }\n $tmp = $truth ;\n $truth = $reverse;\n $reverse = $tmp;\n $ans += $k + $truth;\n }\n}\necho $ans;\n\n", "problem_context": "Score : 900 points\n\nProblem Statement\n\nTakahashi has an empty string S and a variable x whose initial value is 0.\n\nAlso, we have a string T consisting of 0 and 1.\n\nNow, Takahashi will do the operation with the following two steps |T| times.\n\nInsert a 0 or a 1 at any position of S of his choice.\n\nThen, increment x by the sum of the digits in the odd positions (first, third, fifth, ...) of S. For example, if S is 01101, the digits in the odd positions are 0, 1, 1 from left to right, so x is incremented by 2.\n\nPrint the maximum possible final value of x in a sequence of operations such that S equals T in the end.\n\nConstraints\n\n1 \\leq |T| \\leq 2 \\times 10^5\n\nT consists of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\n\nOutput\n\nPrint the maximum possible final value of x in a sequence of operations such that S equals T in the end.\n\nSample Input 1\n\n1101\n\nSample Output 1\n\n5\n\nBelow is one sequence of operations that maximizes the final value of x to 5.\n\nInsert a 1 at the beginning of S. S becomes 1, and x is incremented by 1.\n\nInsert a 0 to the immediate right of the first character of S. S becomes 10, and x is incremented by 1.\n\nInsert a 1 to the immediate right of the second character of S. S becomes 101, and x is incremented by 2.\n\nInsert a 1 at the beginning of S. S becomes 1101, and x is incremented by 1.\n\nSample Input 2\n\n0111101101\n\nSample Output 2\n\n26", "sample_input": "1101\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02667", "source_text": "Score : 900 points\n\nProblem Statement\n\nTakahashi has an empty string S and a variable x whose initial value is 0.\n\nAlso, we have a string T consisting of 0 and 1.\n\nNow, Takahashi will do the operation with the following two steps |T| times.\n\nInsert a 0 or a 1 at any position of S of his choice.\n\nThen, increment x by the sum of the digits in the odd positions (first, third, fifth, ...) of S. For example, if S is 01101, the digits in the odd positions are 0, 1, 1 from left to right, so x is incremented by 2.\n\nPrint the maximum possible final value of x in a sequence of operations such that S equals T in the end.\n\nConstraints\n\n1 \\leq |T| \\leq 2 \\times 10^5\n\nT consists of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\n\nOutput\n\nPrint the maximum possible final value of x in a sequence of operations such that S equals T in the end.\n\nSample Input 1\n\n1101\n\nSample Output 1\n\n5\n\nBelow is one sequence of operations that maximizes the final value of x to 5.\n\nInsert a 1 at the beginning of S. S becomes 1, and x is incremented by 1.\n\nInsert a 0 to the immediate right of the first character of S. S becomes 10, and x is incremented by 1.\n\nInsert a 1 to the immediate right of the second character of S. S becomes 101, and x is incremented by 2.\n\nInsert a 1 at the beginning of S. S becomes 1101, and x is incremented by 1.\n\nSample Input 2\n\n0111101101\n\nSample Output 2\n\n26", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2457, "cpu_time_ms": 74, "memory_kb": 42112}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s361406903", "group_id": "codeNet:p02669", "input_text": " $v)$ret[$j][] = $v;return $ret;}\n}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n if($both == 0){\n $G[$a][] = $b;\n }elseif($both == 1){\n $G[$a][] = $b;\n $G[$b][] = $a;\n }else{\n $G[$b][] = $a;\n }\n }else{\n list($a, $b, $d) = $values;\n if($both == 0){\n $G[$a][] = [$b, $d];\n }elseif($both == 1){\n $G[$a][] = [$b, $d];\n $G[$b][] = [$a, $d];\n }else{\n $G[$b][] = [$a, $d];\n }\n }\n }\n return $G;\n}", "language": "PHP", "metadata": {"date": 1590349850, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02669.html", "problem_id": "p02669", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02669/input.txt", "sample_output_relpath": "derived/input_output/data/p02669/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02669/PHP/s361406903.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s361406903", "user_id": "u248209126"}, "prompt_components": {"gold_output": "20\n19\n26\n3821859835\n23441258666\n", "input_to_evaluate": " $v)$ret[$j][] = $v;return $ret;}\n}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n if($both == 0){\n $G[$a][] = $b;\n }elseif($both == 1){\n $G[$a][] = $b;\n $G[$b][] = $a;\n }else{\n $G[$b][] = $a;\n }\n }else{\n list($a, $b, $d) = $values;\n if($both == 0){\n $G[$a][] = [$b, $d];\n }elseif($both == 1){\n $G[$a][] = [$b, $d];\n $G[$b][] = [$a, $d];\n }else{\n $G[$b][] = [$a, $d];\n }\n }\n }\n return $G;\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou start with the number 0 and you want to reach the number N.\n\nYou can change the number, paying a certain amount of coins, with the following operations:\n\nMultiply the number by 2, paying A coins.\n\nMultiply the number by 3, paying B coins.\n\nMultiply the number by 5, paying C coins.\n\nIncrease or decrease the number by 1, paying D coins.\n\nYou can perform these operations in arbitrary order and an arbitrary number of times.\n\nWhat is the minimum number of coins you need to reach N?\n\nYou have to solve T testcases.\n\nConstraints\n\n1 \\le T \\le 10\n\n1 \\le N \\le 10^{18}\n\n1 \\le A, B, C, D \\le 10^9\n\nAll numbers N, A, B, C, D are integers.\n\nInput\n\nThe input is given from Standard Input. The first line of the input is\n\nT\n\nThen, T lines follow describing the T testcases.\nEach of the T lines has the format\n\nN A B C D\n\nOutput\n\nFor each testcase, print the answer on Standard Output followed by a newline.\n\nSample Input 1\n\n5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n\nSample Output 1\n\n20\n19\n26\n3821859835\n23441258666\n\nFor the first testcase, a sequence of moves that achieves the minimum cost of 20 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 1 to multiply by 2 (x = 4).\n\nPay 2 to multiply by 3 (x = 12).\n\nPay 8 to decrease by 1 (x = 11).\n\nFor the second testcase, a sequence of moves that achieves the minimum cost of 19 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 2 to multiply by 5 (x = 10).\n\nPay 8 to increase by 1 (x = 11).", "sample_input": "5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n"}, "reference_outputs": ["20\n19\n26\n3821859835\n23441258666\n"], "source_document_id": "p02669", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou start with the number 0 and you want to reach the number N.\n\nYou can change the number, paying a certain amount of coins, with the following operations:\n\nMultiply the number by 2, paying A coins.\n\nMultiply the number by 3, paying B coins.\n\nMultiply the number by 5, paying C coins.\n\nIncrease or decrease the number by 1, paying D coins.\n\nYou can perform these operations in arbitrary order and an arbitrary number of times.\n\nWhat is the minimum number of coins you need to reach N?\n\nYou have to solve T testcases.\n\nConstraints\n\n1 \\le T \\le 10\n\n1 \\le N \\le 10^{18}\n\n1 \\le A, B, C, D \\le 10^9\n\nAll numbers N, A, B, C, D are integers.\n\nInput\n\nThe input is given from Standard Input. The first line of the input is\n\nT\n\nThen, T lines follow describing the T testcases.\nEach of the T lines has the format\n\nN A B C D\n\nOutput\n\nFor each testcase, print the answer on Standard Output followed by a newline.\n\nSample Input 1\n\n5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n\nSample Output 1\n\n20\n19\n26\n3821859835\n23441258666\n\nFor the first testcase, a sequence of moves that achieves the minimum cost of 20 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 1 to multiply by 2 (x = 4).\n\nPay 2 to multiply by 3 (x = 12).\n\nPay 8 to decrease by 1 (x = 11).\n\nFor the second testcase, a sequence of moves that achieves the minimum cost of 19 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 2 to multiply by 5 (x = 10).\n\nPay 8 to increase by 1 (x = 11).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3811, "cpu_time_ms": 148, "memory_kb": 17252}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s745042495", "group_id": "codeNet:p02670", "input_text": " $x){\n $y = $currentY[$i];\n $f = $fill[$y][$x];\n if($x > 0){\n if($map[$y][$x-1] > $map[$y][$x] + $f){\n $map[$y][$x-1] = $map[$y][$x] + $f;\n $nextY[] = $y;\n $nextX[] = $x-1;\n }\n }\n if($y > 0){\n if($map[$y-1][$x] > $map[$y][$x] + $f){\n $map[$y-1][$x] = $map[$y][$x] + $f;\n $nextY[] = $y-1;\n $nextX[] = $x;\n }\n }\n if($x < $N-1){\n if($map[$y][$x+1] > $map[$y][$x] + $f){\n $map[$y][$x+1] = $map[$y][$x] + $f;\n $nextY[] = $y;\n $nextX[] = $x+1;\n }\n }\n if($y < $N-1){\n if($map[$y+1][$x] > $map[$y][$x] + $f){\n $map[$y+1][$x] = $map[$y][$x] + $f;\n $nextY[] = $y+1;\n $nextX[] = $x;\n }\n }\n }\n $currentX = $nextX;\n $currentY = $nextY;\n }\n}\necho $cost;\n//o($map);\n\nfunction str(){return trim(fgets(STDIN));}\nfunction ints($n = false){\n if($n===false){\n return array_map('intval',explode(' ',trim(fgets(STDIN))));\n }else{$ret = [];for($i = 0; $i < $n; $i++)foreach(array_map('intval',explode(' ',trim(fgets(STDIN)))) as $j => $v)$ret[$j][] = $v;return $ret;}\n}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n if($both == 0){\n $G[$a][] = $b;\n }elseif($both == 1){\n $G[$a][] = $b;\n $G[$b][] = $a;\n }else{\n $G[$b][] = $a;\n }\n }else{\n list($a, $b, $d) = $values;\n if($both == 0){\n $G[$a][] = [$b, $d];\n }elseif($both == 1){\n $G[$a][] = [$b, $d];\n $G[$b][] = [$a, $d];\n }else{\n $G[$b][] = [$a, $d];\n }\n }\n }\n return $G;\n}\n", "language": "PHP", "metadata": {"date": 1590285911, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02670.html", "problem_id": "p02670", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02670/input.txt", "sample_output_relpath": "derived/input_output/data/p02670/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02670/PHP/s745042495.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s745042495", "user_id": "u248209126"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $x){\n $y = $currentY[$i];\n $f = $fill[$y][$x];\n if($x > 0){\n if($map[$y][$x-1] > $map[$y][$x] + $f){\n $map[$y][$x-1] = $map[$y][$x] + $f;\n $nextY[] = $y;\n $nextX[] = $x-1;\n }\n }\n if($y > 0){\n if($map[$y-1][$x] > $map[$y][$x] + $f){\n $map[$y-1][$x] = $map[$y][$x] + $f;\n $nextY[] = $y-1;\n $nextX[] = $x;\n }\n }\n if($x < $N-1){\n if($map[$y][$x+1] > $map[$y][$x] + $f){\n $map[$y][$x+1] = $map[$y][$x] + $f;\n $nextY[] = $y;\n $nextX[] = $x+1;\n }\n }\n if($y < $N-1){\n if($map[$y+1][$x] > $map[$y][$x] + $f){\n $map[$y+1][$x] = $map[$y][$x] + $f;\n $nextY[] = $y+1;\n $nextX[] = $x;\n }\n }\n }\n $currentX = $nextX;\n $currentY = $nextY;\n }\n}\necho $cost;\n//o($map);\n\nfunction str(){return trim(fgets(STDIN));}\nfunction ints($n = false){\n if($n===false){\n return array_map('intval',explode(' ',trim(fgets(STDIN))));\n }else{$ret = [];for($i = 0; $i < $n; $i++)foreach(array_map('intval',explode(' ',trim(fgets(STDIN)))) as $j => $v)$ret[$j][] = $v;return $ret;}\n}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n if($both == 0){\n $G[$a][] = $b;\n }elseif($both == 1){\n $G[$a][] = $b;\n $G[$b][] = $a;\n }else{\n $G[$b][] = $a;\n }\n }else{\n list($a, $b, $d) = $values;\n if($both == 0){\n $G[$a][] = [$b, $d];\n }elseif($both == 1){\n $G[$a][] = [$b, $d];\n $G[$b][] = [$a, $d];\n }else{\n $G[$b][] = [$a, $d];\n }\n }\n }\n return $G;\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nTonight, in your favourite cinema they are giving the movie Joker and all seats are occupied. In the cinema there are N rows with N seats each, forming an N\\times N square. We denote with 1, 2,\\dots, N the viewers in the first row (from left to right); with N+1, \\dots, 2N the viewers in the second row (from left to right); and so on until the last row, whose viewers are denoted by N^2-N+1,\\dots, N^2.\n\nAt the end of the movie, the viewers go out of the cinema in a certain order: the i-th viewer leaving her seat is the one denoted by the number P_i. The viewer P_{i+1} waits until viewer P_i has left the cinema before leaving her seat.\nTo exit from the cinema, a viewer must move from seat to seat until she exits the square of seats (any side of the square is a valid exit). A viewer can move from a seat to one of its 4 adjacent seats (same row or same column).\nWhile leaving the cinema, it might be that a certain viewer x goes through a seat currently occupied by viewer y; in that case viewer y will hate viewer x forever. Each viewer chooses the way that minimizes the number of viewers that will hate her forever.\n\nCompute the number of pairs of viewers (x, y) such that y will hate x forever.\n\nConstraints\n\n2 \\le N \\le 500\n\nThe sequence P_1, P_2, \\dots, P_{N^2} is a permutation of \\{1, 2, \\dots, N^2\\}.\n\nInput\n\nThe input is given from Standard Input in the format\n\nN\nP_1 P_2 \\cdots P_{N^2}\n\nOutput\n\nIf ans is the number of pairs of viewers described in the statement, you should print on Standard Output\n\nans\n\nSample Input 1\n\n3\n1 3 7 9 5 4 8 6 2\n\nSample Output 1\n\n1\n\nBefore the end of the movie, the viewers are arranged in the cinema as follows:\n\n1 2 3\n4 5 6\n7 8 9\n\nThe first four viewers leaving the cinema (1, 3, 7, 9) can leave the cinema without going through any seat, so they will not be hated by anybody.\n\nThen, viewer 5 must go through one of the seats where viewers 2, 4, 6, 8 are currently seated while leaving the cinema; hence he will be hated by at least one of those viewers.\n\nFinally the remaining viewers can leave the cinema (in the order 4, 8, 6, 2) without going through any occupied seat (actually, they can leave the cinema without going through any seat at all).\n\nSample Input 2\n\n4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30\n\nSample Output 3\n\n11", "sample_input": "3\n1 3 7 9 5 4 8 6 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02670", "source_text": "Score : 700 points\n\nProblem Statement\n\nTonight, in your favourite cinema they are giving the movie Joker and all seats are occupied. In the cinema there are N rows with N seats each, forming an N\\times N square. We denote with 1, 2,\\dots, N the viewers in the first row (from left to right); with N+1, \\dots, 2N the viewers in the second row (from left to right); and so on until the last row, whose viewers are denoted by N^2-N+1,\\dots, N^2.\n\nAt the end of the movie, the viewers go out of the cinema in a certain order: the i-th viewer leaving her seat is the one denoted by the number P_i. The viewer P_{i+1} waits until viewer P_i has left the cinema before leaving her seat.\nTo exit from the cinema, a viewer must move from seat to seat until she exits the square of seats (any side of the square is a valid exit). A viewer can move from a seat to one of its 4 adjacent seats (same row or same column).\nWhile leaving the cinema, it might be that a certain viewer x goes through a seat currently occupied by viewer y; in that case viewer y will hate viewer x forever. Each viewer chooses the way that minimizes the number of viewers that will hate her forever.\n\nCompute the number of pairs of viewers (x, y) such that y will hate x forever.\n\nConstraints\n\n2 \\le N \\le 500\n\nThe sequence P_1, P_2, \\dots, P_{N^2} is a permutation of \\{1, 2, \\dots, N^2\\}.\n\nInput\n\nThe input is given from Standard Input in the format\n\nN\nP_1 P_2 \\cdots P_{N^2}\n\nOutput\n\nIf ans is the number of pairs of viewers described in the statement, you should print on Standard Output\n\nans\n\nSample Input 1\n\n3\n1 3 7 9 5 4 8 6 2\n\nSample Output 1\n\n1\n\nBefore the end of the movie, the viewers are arranged in the cinema as follows:\n\n1 2 3\n4 5 6\n7 8 9\n\nThe first four viewers leaving the cinema (1, 3, 7, 9) can leave the cinema without going through any seat, so they will not be hated by anybody.\n\nThen, viewer 5 must go through one of the seats where viewers 2, 4, 6, 8 are currently seated while leaving the cinema; hence he will be hated by at least one of those viewers.\n\nFinally the remaining viewers can leave the cinema (in the order 4, 8, 6, 2) without going through any occupied seat (actually, they can leave the cinema without going through any seat at all).\n\nSample Input 2\n\n4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30\n\nSample Output 3\n\n11", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4550, "cpu_time_ms": 2207, "memory_kb": 48560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s544182673", "group_id": "codeNet:p02675", "input_text": "", "language": "PHP", "metadata": {"date": 1589764011, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02675.html", "problem_id": "p02675", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02675/input.txt", "sample_output_relpath": "derived/input_output/data/p02675/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02675/PHP/s327509644.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s327509644", "user_id": "u075074066"}, "prompt_components": {"gold_output": "pon\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "sample_input": "16\n"}, "reference_outputs": ["pon\n"], "source_document_id": "p02675", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 463, "cpu_time_ms": 17, "memory_kb": 16032}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s463334030", "group_id": "codeNet:p02676", "input_text": "", "language": "PHP", "metadata": {"date": 1589770815, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02676/input.txt", "sample_output_relpath": "derived/input_output/data/p02676/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02676/PHP/s336607136.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s336607136", "user_id": "u428459330"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "sample_input": "7\nnikoandsolstice\n"}, "reference_outputs": ["nikoand...\n"], "source_document_id": "p02676", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 133, "cpu_time_ms": 19, "memory_kb": 16196}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s908278420", "group_id": "codeNet:p02676", "input_text": "", "language": "PHP", "metadata": {"date": 1589768461, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02676/input.txt", "sample_output_relpath": "derived/input_output/data/p02676/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02676/PHP/s908278420.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s908278420", "user_id": "u428459330"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "sample_input": "7\nnikoandsolstice\n"}, "reference_outputs": ["nikoand...\n"], "source_document_id": "p02676", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 150, "cpu_time_ms": 18, "memory_kb": 16148}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s546963707", "group_id": "codeNet:p02676", "input_text": " $a,\"b\" => $b];\n}\n\n$cnt = 0;\nfor($i = 0;$i < $n;$i++){\n for($j = 0;$j < $n;$j++){\n if($i < $j) continue;\n if($ab[$i][\"a\"] * $ab[$j][\"a\"]\n +\n $ab[$i][\"b\"] * $ab[$j][\"b\"] !== 0) {\n $cnt++;\n }\n }\n}\necho $cnt % 1000000007;", "language": "PHP", "metadata": {"date": 1589768752, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02679.html", "problem_id": "p02679", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02679/input.txt", "sample_output_relpath": "derived/input_output/data/p02679/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02679/PHP/s332765617.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s332765617", "user_id": "u115338184"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": " $a,\"b\" => $b];\n}\n\n$cnt = 0;\nfor($i = 0;$i < $n;$i++){\n for($j = 0;$j < $n;$j++){\n if($i < $j) continue;\n if($ab[$i][\"a\"] * $ab[$j][\"a\"]\n +\n $ab[$i][\"b\"] * $ab[$j][\"b\"] !== 0) {\n $cnt++;\n }\n }\n}\necho $cnt % 1000000007;", "problem_context": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "sample_input": "3\n1 2\n-1 1\n2 -1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02679", "source_text": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 367, "cpu_time_ms": 2208, "memory_kb": 95704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s315360966", "group_id": "codeNet:p02681", "input_text": "\n", "language": "PHP", "metadata": {"date": 1589159004, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02681/input.txt", "sample_output_relpath": "derived/input_output/data/p02681/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02681/PHP/s865513477.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s865513477", "user_id": "u769447691"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "sample_input": "chokudai\nchokudaiz\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02681", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 169, "cpu_time_ms": 17, "memory_kb": 16196}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s897471797", "group_id": "codeNet:p02682", "input_text": "= $k) {\n echo $k;\n} else if ($a + $b >= $k) {\n echo $a;\n} else {\n echo $a + ($k - ($a + $b)) * -1;\n}", "language": "PHP", "metadata": {"date": 1592516276, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/PHP/s897471797.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s897471797", "user_id": "u080998910"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= $k) {\n echo $k;\n} else if ($a + $b >= $k) {\n echo $a;\n} else {\n echo $a + ($k - ($a + $b)) * -1;\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 175, "cpu_time_ms": 26, "memory_kb": 16140}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s607707304", "group_id": "codeNet:p02682", "input_text": "= $K;\n}\n\nfunction full_up_with_abc($A, $B, $C, $K){\n return ($A + $B + $C) >= $K;\n}\n", "language": "PHP", "metadata": {"date": 1589472906, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/PHP/s607707304.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s607707304", "user_id": "u727703358"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= $K;\n}\n\nfunction full_up_with_abc($A, $B, $C, $K){\n return ($A + $B + $C) >= $K;\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 431, "cpu_time_ms": 19, "memory_kb": 16276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s070631358", "group_id": "codeNet:p02682", "input_text": " $h_arr[$b - 1]) {\n $ng_nums[] = $b;\n } elseif($h_arr[$a - 1] == $h_arr[$b - 1]) {\n $ng_nums[] = $a;\n $ng_nums[] = $b;\n } else\n {\n $ng_nums[] = $a;\n }\n}\n$ng_nums = array_unique($ng_nums);\n// for ($i=0; $i < count($ng_nums); $i++) { \n// echo \"ng_nums = \".$ng_nums[$i].PHP_EOL;\n// }\n\n$h_nums = array_diff($h_nums, $ng_nums);\n$h_nums = array_values($h_nums);\n// for ($i=0; $i < count($h_nums); $i++) { \n// echo \"h_nums = \". $h_nums[$i].PHP_EOL;\n// }\n\necho count($h_nums);\n\nreturn;\n?>\n", "language": "PHP", "metadata": {"date": 1588555803, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/PHP/s133862010.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s133862010", "user_id": "u280911573"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $h_arr[$b - 1]) {\n $ng_nums[] = $b;\n } elseif($h_arr[$a - 1] == $h_arr[$b - 1]) {\n $ng_nums[] = $a;\n $ng_nums[] = $b;\n } else\n {\n $ng_nums[] = $a;\n }\n}\n$ng_nums = array_unique($ng_nums);\n// for ($i=0; $i < count($ng_nums); $i++) { \n// echo \"ng_nums = \".$ng_nums[$i].PHP_EOL;\n// }\n\n$h_nums = array_diff($h_nums, $ng_nums);\n$h_nums = array_values($h_nums);\n// for ($i=0; $i < count($h_nums); $i++) { \n// echo \"h_nums = \". $h_nums[$i].PHP_EOL;\n// }\n\necho count($h_nums);\n\nreturn;\n?>\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 991, "cpu_time_ms": 144, "memory_kb": 39300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s828710744", "group_id": "codeNet:p02689", "input_text": "max($map[$i])){\n ++$ans;\n }\n }else{\n ++$ans;\n }\n ++$i;\n}\necho $ans;", "language": "PHP", "metadata": {"date": 1588555435, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/PHP/s828710744.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s828710744", "user_id": "u281500237"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "max($map[$i])){\n ++$ans;\n }\n }else{\n ++$ans;\n }\n ++$i;\n}\necho $ans;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 363, "cpu_time_ms": 161, "memory_kb": 58512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s974076935", "group_id": "codeNet:p02690", "input_text": " MAX) break;\n $a[$x] = $tmp;\n $a[-$x] = -$tmp;\n $x++;\n}\n\nfscanf(STDIN, \"%d\", $N);\n\n$cnt = count($a);\nforeach ($a as $k1 => $v1) {\n foreach ($a as $k2 => $v2) {\n if ($v1 - $v2 === $N) {\n printf(\"%d %d\", $k1, $k2);\n break 2;\n }\n }\n}\n", "language": "PHP", "metadata": {"date": 1588824963, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02690.html", "problem_id": "p02690", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02690/input.txt", "sample_output_relpath": "derived/input_output/data/p02690/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02690/PHP/s974076935.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s974076935", "user_id": "u195912432"}, "prompt_components": {"gold_output": "2 -1\n", "input_to_evaluate": " MAX) break;\n $a[$x] = $tmp;\n $a[-$x] = -$tmp;\n $x++;\n}\n\nfscanf(STDIN, \"%d\", $N);\n\n$cnt = count($a);\nforeach ($a as $k1 => $v1) {\n foreach ($a as $k2 => $v2) {\n if ($v1 - $v2 === $N) {\n printf(\"%d %d\", $k1, $k2);\n break 2;\n }\n }\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "sample_input": "33\n"}, "reference_outputs": ["2 -1\n"], "source_document_id": "p02690", "source_text": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 383, "cpu_time_ms": 18, "memory_kb": 16192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s589110792", "group_id": "codeNet:p02690", "input_text": "\n", "language": "PHP", "metadata": {"date": 1588558180, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02690.html", "problem_id": "p02690", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02690/input.txt", "sample_output_relpath": "derived/input_output/data/p02690/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02690/PHP/s675472686.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s675472686", "user_id": "u280911573"}, "prompt_components": {"gold_output": "2 -1\n", "input_to_evaluate": "\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "sample_input": "33\n"}, "reference_outputs": ["2 -1\n"], "source_document_id": "p02690", "source_text": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 334, "cpu_time_ms": 2206, "memory_kb": 16548}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s023846318", "group_id": "codeNet:p02691", "input_text": " i( i(", "language": "PHP", "metadata": {"date": 1588472409, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/PHP/s108901062.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s108901062", "user_id": "u362320853"}, "prompt_components": {"gold_output": "OK\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 309, "cpu_time_ms": 16, "memory_kb": 16104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s079046047", "group_id": "codeNet:p02693", "input_text": "fscanf(STDIN, \"%d %d %d\", $k,$a,$b);\n//$input = fgets(STDIN);\n//$k = (int)explode('', $input)[0];\n//$a = (int)explode('', $input)[1];\n//$b = (int)explode('', $input)[2];\n\nfor($i = $a; $i < $b; $i++) {\n if (($i % $k) === 0) {\n echo 'OK';\n }else {\n echo 'NO';\n }\n}\n", "language": "PHP", "metadata": {"date": 1588469945, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/PHP/s079046047.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s079046047", "user_id": "u887493548"}, "prompt_components": {"gold_output": "OK\n", "input_to_evaluate": "fscanf(STDIN, \"%d %d %d\", $k,$a,$b);\n//$input = fgets(STDIN);\n//$k = (int)explode('', $input)[0];\n//$a = (int)explode('', $input)[1];\n//$b = (int)explode('', $input)[2];\n\nfor($i = $a; $i < $b; $i++) {\n if (($i % $k) === 0) {\n echo 'OK';\n }else {\n echo 'NO';\n }\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 272, "cpu_time_ms": 20, "memory_kb": 15936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s486049707", "group_id": "codeNet:p02693", "input_text": "=$b){\n $result[] = $i; \n }\n }\n $i++;\n}\nif(isset($result)){\n echo \"OK\";\n}else{\n echo \"NG\";\n}\n?>", "language": "PHP", "metadata": {"date": 1588469767, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/PHP/s486049707.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s486049707", "user_id": "u835322333"}, "prompt_components": {"gold_output": "OK\n", "input_to_evaluate": "=$b){\n $result[] = $i; \n }\n }\n $i++;\n}\nif(isset($result)){\n echo \"OK\";\n}else{\n echo \"NG\";\n}\n?>", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 20, "memory_kb": 16176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s763600773", "group_id": "codeNet:p02693", "input_text": "$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "language": "PHP", "metadata": {"date": 1588468309, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/PHP/s763600773.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s763600773", "user_id": "u248209126"}, "prompt_components": {"gold_output": "OK\n", "input_to_evaluate": "$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2679, "cpu_time_ms": 19, "memory_kb": 16096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s108663141", "group_id": "codeNet:p02694", "input_text": "= $S){\n print(\"unsafe\");\n} else {\n print(\"safe\");\n}", "language": "PHP", "metadata": {"date": 1587961257, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/PHP/s910863364.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s910863364", "user_id": "u383001678"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "= $S){\n print(\"unsafe\");\n} else {\n print(\"safe\");\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 153, "cpu_time_ms": 17, "memory_kb": 16060}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s779942693", "group_id": "codeNet:p02701", "input_text": "$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "language": "PHP", "metadata": {"date": 1587346034, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02708.html", "problem_id": "p02708", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02708/input.txt", "sample_output_relpath": "derived/input_output/data/p02708/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02708/PHP/s693210902.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s693210902", "user_id": "u248209126"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$M = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "sample_input": "3 2\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02708", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3480, "cpu_time_ms": 28, "memory_kb": 16232}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s582827423", "group_id": "codeNet:p02712", "input_text": "", "language": "PHP", "metadata": {"date": 1587914911, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02712/input.txt", "sample_output_relpath": "derived/input_output/data/p02712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02712/PHP/s582827423.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s582827423", "user_id": "u702883392"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "sample_input": "15\n"}, "reference_outputs": ["60\n"], "source_document_id": "p02712", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 228, "cpu_time_ms": 64, "memory_kb": 16064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s241398300", "group_id": "codeNet:p02712", "input_text": "= $i) {\n if ($i % 5 === 0 && $i % 3 === 0) {\n } elseif ($i % 5 === 0) {\n } elseif ($i % 3 === 0) {\n } else {\n $sum += $i;\n }\n $i++;\n}\n\necho $sum;\n?>", "language": "PHP", "metadata": {"date": 1586741517, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02712/input.txt", "sample_output_relpath": "derived/input_output/data/p02712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02712/PHP/s241398300.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s241398300", "user_id": "u608103149"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "= $i) {\n if ($i % 5 === 0 && $i % 3 === 0) {\n } elseif ($i % 5 === 0) {\n } elseif ($i % 3 === 0) {\n } else {\n $sum += $i;\n }\n $i++;\n}\n\necho $sum;\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "sample_input": "15\n"}, "reference_outputs": ["60\n"], "source_document_id": "p02712", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 235, "cpu_time_ms": 83, "memory_kb": 16108}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s246383525", "group_id": "codeNet:p02719", "input_text": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n$sc = new scan();\n$n = $sc->nextInt();\n$k = $sc->nextInt();\n\nif ($n % $k == 0) {\n echo 0;\n} else {\n $flag = true;\n\n while ($flag) {\n if (abs($n-$k) < $n) {\n $n = abs($n-$k);\n } else {\n $flag = false;\n }\n }\n \n echo $n;\n}", "language": "PHP", "metadata": {"date": 1586049924, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02719.html", "problem_id": "p02719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02719/input.txt", "sample_output_relpath": "derived/input_output/data/p02719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02719/PHP/s836061612.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s836061612", "user_id": "u514110614"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n$sc = new scan();\n$n = $sc->nextInt();\n$k = $sc->nextInt();\n\nif ($n % $k == 0) {\n echo 0;\n} else {\n $flag = true;\n\n while ($flag) {\n if (abs($n-$k) < $n) {\n $n = abs($n-$k);\n } else {\n $flag = false;\n }\n }\n \n echo $n;\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "sample_input": "7 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02719", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 960, "cpu_time_ms": 2104, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s750330743", "group_id": "codeNet:p02719", "input_text": "$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$N = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "language": "PHP", "metadata": {"date": 1586048917, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02719.html", "problem_id": "p02719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02719/input.txt", "sample_output_relpath": "derived/input_output/data/p02719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02719/PHP/s757027727.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s757027727", "user_id": "u248209126"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$N = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "sample_input": "7 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02719", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2610, "cpu_time_ms": 11, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s040826549", "group_id": "codeNet:p02720", "input_text": "", "language": "PHP", "metadata": {"date": 1585445216, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/PHP/s192839120.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s192839120", "user_id": "u234241034"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 213, "cpu_time_ms": 12, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s031524609", "group_id": "codeNet:p02723", "input_text": "", "language": "PHP", "metadata": {"date": 1585444163, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/PHP/s031524609.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s031524609", "user_id": "u234241034"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 234, "cpu_time_ms": 11, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s932057701", "group_id": "codeNet:p02724", "input_text": " 0) {\n return $n *= factorial($n - 1);\n }\n return 1;\n }\n function is_palindrome($s) { // 回文か\n return $s == strrev($s);\n }\n\n", "language": "PHP", "metadata": {"date": 1585444463, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02724.html", "problem_id": "p02724", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02724/input.txt", "sample_output_relpath": "derived/input_output/data/p02724/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02724/PHP/s932057701.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s932057701", "user_id": "u269461568"}, "prompt_components": {"gold_output": "2020\n", "input_to_evaluate": " 0) {\n return $n *= factorial($n - 1);\n }\n return 1;\n }\n function is_palindrome($s) { // 回文か\n return $s == strrev($s);\n }\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "sample_input": "1024\n"}, "reference_outputs": ["2020\n"], "source_document_id": "p02724", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 839, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s129824623", "group_id": "codeNet:p02724", "input_text": " $max){\n\t\t$max = $distance[$i]-$distance[$i-1];\n\t\t$check = $i;\n\t}\n}\n\n$ans = 0;\nif($check == 0){\n\tfor($i=1; $i<$home[1]; $i++){\n\t\t$ans += $distance[$i]-$distance[$i-1];\n\t}\n}else{\n\tfor($i=$check; $i<$home[1]-1; $i++){\n\t\t$ans += $distance[$i+1]-$distance[$i];\n\t}\n\t$ans += ($home[0] - $distance[$home[1]-1]) + $distance[0];\n\tfor($i=0; $i<$check-1; $i++){\n\t\t$ans += $distance[$i+1]-$distance[$i];\n\t}\n}\necho $ans;", "language": "PHP", "metadata": {"date": 1588816689, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02725/input.txt", "sample_output_relpath": "derived/input_output/data/p02725/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02725/PHP/s142966156.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s142966156", "user_id": "u127740906"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": " $max){\n\t\t$max = $distance[$i]-$distance[$i-1];\n\t\t$check = $i;\n\t}\n}\n\n$ans = 0;\nif($check == 0){\n\tfor($i=1; $i<$home[1]; $i++){\n\t\t$ans += $distance[$i]-$distance[$i-1];\n\t}\n}else{\n\tfor($i=$check; $i<$home[1]-1; $i++){\n\t\t$ans += $distance[$i+1]-$distance[$i];\n\t}\n\t$ans += ($home[0] - $distance[$home[1]-1]) + $distance[0];\n\tfor($i=0; $i<$check-1; $i++){\n\t\t$ans += $distance[$i+1]-$distance[$i];\n\t}\n}\necho $ans;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 639, "cpu_time_ms": 173, "memory_kb": 39980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s200242278", "group_id": "codeNet:p02725", "input_text": "> 1) ** 2) % MOD;\n if ($x % 2 === 1) $res = modMul($res, $n);\n return $res;\n}\n\n// 階乗\nfunction modFac($n)\n{\n if ($n === 0) return 1;\n return modMul($n, modFac($n - 1));\n}\n\n// 順列\nfunction nPr($n, $r)\n{\n if ($r === 0) return 1;\n return modDiv(modFac($n), modFac($n - $r));\n}\n\n// 組み合わせ\nfunction nCr($n, $r)\n{\n $r = min($r, $n - $r);\n if ($r === 0) return 1;\n return modDiv(nPr($n, $r), modFac($r));\n}", "language": "PHP", "metadata": {"date": 1586567523, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02728.html", "problem_id": "p02728", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02728/input.txt", "sample_output_relpath": "derived/input_output/data/p02728/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02728/PHP/s136214243.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s136214243", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2\n1\n1\n", "input_to_evaluate": "> 1) ** 2) % MOD;\n if ($x % 2 === 1) $res = modMul($res, $n);\n return $res;\n}\n\n// 階乗\nfunction modFac($n)\n{\n if ($n === 0) return 1;\n return modMul($n, modFac($n - 1));\n}\n\n// 順列\nfunction nPr($n, $r)\n{\n if ($r === 0) return 1;\n return modDiv(modFac($n), modFac($n - $r));\n}\n\n// 組み合わせ\nfunction nCr($n, $r)\n{\n $r = min($r, $n - $r);\n if ($r === 0) return 1;\n return modDiv(nPr($n, $r), modFac($r));\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i.\nFor each k=1, ..., N, solve the problem below:\n\nConsider writing a number on each vertex in the tree in the following manner:\n\nFirst, write 1 on Vertex k.\n\nThen, for each of the numbers 2, ..., N in this order, write the number on the vertex chosen as follows:\n\nChoose a vertex that still does not have a number written on it and is adjacent to a vertex with a number already written on it. If there are multiple such vertices, choose one of them at random.\n\nFind the number of ways in which we can write the numbers on the vertices, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq a_i,b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nFor each k=1, 2, ..., N in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n3\n1 2\n1 3\n\nSample Output 1\n\n2\n1\n1\n\nThe graph in this input is as follows:\n\nFor k=1, there are two ways in which we can write the numbers on the vertices, as follows:\n\nWriting 1, 2, 3 on Vertex 1, 2, 3, respectively\n\nWriting 1, 3, 2 on Vertex 1, 2, 3, respectively\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n1\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n5\n1 2\n2 3\n3 4\n3 5\n\nSample Output 3\n\n2\n8\n12\n3\n3\n\nThe graph in this input is as follows:\n\nSample Input 4\n\n8\n1 2\n2 3\n3 4\n3 5\n3 6\n6 7\n6 8\n\nSample Output 4\n\n40\n280\n840\n120\n120\n504\n72\n72\n\nThe graph in this input is as follows:", "sample_input": "3\n1 2\n1 3\n"}, "reference_outputs": ["2\n1\n1\n"], "source_document_id": "p02728", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i.\nFor each k=1, ..., N, solve the problem below:\n\nConsider writing a number on each vertex in the tree in the following manner:\n\nFirst, write 1 on Vertex k.\n\nThen, for each of the numbers 2, ..., N in this order, write the number on the vertex chosen as follows:\n\nChoose a vertex that still does not have a number written on it and is adjacent to a vertex with a number already written on it. If there are multiple such vertices, choose one of them at random.\n\nFind the number of ways in which we can write the numbers on the vertices, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq a_i,b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nFor each k=1, 2, ..., N in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n3\n1 2\n1 3\n\nSample Output 1\n\n2\n1\n1\n\nThe graph in this input is as follows:\n\nFor k=1, there are two ways in which we can write the numbers on the vertices, as follows:\n\nWriting 1, 2, 3 on Vertex 1, 2, 3, respectively\n\nWriting 1, 3, 2 on Vertex 1, 2, 3, respectively\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n1\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n5\n1 2\n2 3\n3 4\n3 5\n\nSample Output 3\n\n2\n8\n12\n3\n3\n\nThe graph in this input is as follows:\n\nSample Input 4\n\n8\n1 2\n2 3\n3 4\n3 5\n3 6\n6 7\n6 8\n\nSample Output 4\n\n40\n280\n840\n120\n120\n504\n72\n72\n\nThe graph in this input is as follows:", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1957, "cpu_time_ms": 3156, "memory_kb": 211448}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s532317694", "group_id": "codeNet:p02729", "input_text": " 1) $res += $n * ($n - 1) / 2;\nif ($m > 1) $res += $m * ($m - 1) / 2;\necho $res;", "language": "PHP", "metadata": {"date": 1584925757, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/PHP/s532317694.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s532317694", "user_id": "u163865296"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " 1) $res += $n * ($n - 1) / 2;\nif ($m > 1) $res += $m * ($m - 1) / 2;\necho $res;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 136, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s895611035", "group_id": "codeNet:p02731", "input_text": " $v) {\n $kumi_sum += $v * ($v - 1) / 2;\n}\nfor ($i = 0; $i < $n; $i++) {\n $ans[] = $kumi_sum - ($cnt[$a[$i]] - 1);\n}\necho implode(PHP_EOL, $ans);", "language": "PHP", "metadata": {"date": 1584936434, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/PHP/s631857863.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s631857863", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": " $v) {\n $kumi_sum += $v * ($v - 1) / 2;\n}\nfor ($i = 0; $i < $n; $i++) {\n $ans[] = $kumi_sum - ($cnt[$a[$i]] - 1);\n}\necho implode(PHP_EOL, $ans);", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 415, "cpu_time_ms": 86, "memory_kb": 36840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s733881085", "group_id": "codeNet:p02732", "input_text": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n// From https://qiita.com/yoshikyoto/items/6924478283dbdd549e4b\nlist($N)=sscanf(trim(fgets(STDIN)),\"%d\");\n$sc = new Scanner();\n$A = array();\nfor($i=0;$i<$N;$i++){\n $A[$i] = $sc->nextInt();\n}\nfor($e=0;$e<$N;$e++){\n $pat=array();\n $cnt=0;\n for($i=0;$i<$N;$i++){\n if($i != $e){\n if($target =(array_key_exists($A[$i],$pat) ) === FALSE){\n $pat[$A[$i]] = 1;\n }else{\n $pat[$A[$i]]+= 1;\n };\n }\n }\n foreach($pat as $value){\n for($i=$value-1;$i>=1;$i--){\n $cnt += $i;\n }\n }\n printf($cnt.\"\\n\");\n}", "language": "PHP", "metadata": {"date": 1584929972, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/PHP/s733881085.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s733881085", "user_id": "u394563938"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n// From https://qiita.com/yoshikyoto/items/6924478283dbdd549e4b\nlist($N)=sscanf(trim(fgets(STDIN)),\"%d\");\n$sc = new Scanner();\n$A = array();\nfor($i=0;$i<$N;$i++){\n $A[$i] = $sc->nextInt();\n}\nfor($e=0;$e<$N;$e++){\n $pat=array();\n $cnt=0;\n for($i=0;$i<$N;$i++){\n if($i != $e){\n if($target =(array_key_exists($A[$i],$pat) ) === FALSE){\n $pat[$A[$i]] = 1;\n }else{\n $pat[$A[$i]]+= 1;\n };\n }\n }\n foreach($pat as $value){\n for($i=$value-1;$i>=1;$i--){\n $cnt += $i;\n }\n }\n printf($cnt.\"\\n\");\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1356, "cpu_time_ms": 2104, "memory_kb": 33612}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s531977669", "group_id": "codeNet:p02741", "input_text": "", "language": "PHP", "metadata": {"date": 1584241810, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02742.html", "problem_id": "p02742", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02742/input.txt", "sample_output_relpath": "derived/input_output/data/p02742/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02742/PHP/s131835667.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s131835667", "user_id": "u608103149"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "sample_input": "4 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02742", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 179, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s908541205", "group_id": "codeNet:p02742", "input_text": "", "language": "PHP", "metadata": {"date": 1583719992, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02747.html", "problem_id": "p02747", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02747/input.txt", "sample_output_relpath": "derived/input_output/data/p02747/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02747/PHP/s568140932.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s568140932", "user_id": "u359933779"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA Hitachi string is a concatenation of one or more copies of the string hi.\n\nFor example, hi and hihi are Hitachi strings, while ha and hii are not.\n\nGiven a string S, determine whether S is a Hitachi string.\n\nConstraints\n\nThe length of S is between 1 and 10 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a Hitachi string, print Yes; otherwise, print No.\n\nSample Input 1\n\nhihi\n\nSample Output 1\n\nYes\n\nhihi is the concatenation of two copies of hi, so it is a Hitachi string.\n\nSample Input 2\n\nhi\n\nSample Output 2\n\nYes\n\nSample Input 3\n\nha\n\nSample Output 3\n\nNo", "sample_input": "hihi\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02747", "source_text": "Score : 100 points\n\nProblem Statement\n\nA Hitachi string is a concatenation of one or more copies of the string hi.\n\nFor example, hi and hihi are Hitachi strings, while ha and hii are not.\n\nGiven a string S, determine whether S is a Hitachi string.\n\nConstraints\n\nThe length of S is between 1 and 10 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a Hitachi string, print Yes; otherwise, print No.\n\nSample Input 1\n\nhihi\n\nSample Output 1\n\nYes\n\nhihi is the concatenation of two copies of hi, so it is a Hitachi string.\n\nSample Input 2\n\nhi\n\nSample Output 2\n\nYes\n\nSample Input 3\n\nha\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 292, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s528354880", "group_id": "codeNet:p02747", "input_text": "", "language": "PHP", "metadata": {"date": 1584292796, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02753.html", "problem_id": "p02753", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02753/input.txt", "sample_output_relpath": "derived/input_output/data/p02753/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02753/PHP/s784534043.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s784534043", "user_id": "u234241034"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "sample_input": "ABA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02753", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 282, "cpu_time_ms": 11, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s162476484", "group_id": "codeNet:p02754", "input_text": " $A) {\n \n $K = $A;\n \n } else {\n \n $K = $J;\n }\n \n $numOfBlue = $I * $A + $K;\n}\n\necho $numOfBlue;", "language": "PHP", "metadata": {"date": 1585679897, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/PHP/s526379381.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s526379381", "user_id": "u424467986"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": " $A) {\n \n $K = $A;\n \n } else {\n \n $K = $J;\n }\n \n $numOfBlue = $I * $A + $K;\n}\n\necho $numOfBlue;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s866982646", "group_id": "codeNet:p02754", "input_text": "= $n) {\n $diff = $length - $n;\n $result = $result - $diff;\n break;\n }\n $length = $length + $red;\n if ($length >= $n) {\n break;\n }\n}\necho $result;", "language": "PHP", "metadata": {"date": 1584395776, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/PHP/s866982646.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s866982646", "user_id": "u332793929"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "= $n) {\n $diff = $length - $n;\n $result = $result - $diff;\n break;\n }\n $length = $length + $red;\n if ($length >= $n) {\n break;\n }\n}\necho $result;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 372, "cpu_time_ms": 2104, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s040557210", "group_id": "codeNet:p02754", "input_text": "", "language": "PHP", "metadata": {"date": 1583706860, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/PHP/s040557210.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s040557210", "user_id": "u255302563"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 179, "cpu_time_ms": 10, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s851072679", "group_id": "codeNet:p02754", "input_text": "", "language": "PHP", "metadata": {"date": 1585004674, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02755.html", "problem_id": "p02755", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02755/input.txt", "sample_output_relpath": "derived/input_output/data/p02755/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02755/PHP/s558803641.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s558803641", "user_id": "u852613820"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "sample_input": "2 2\n"}, "reference_outputs": ["25\n"], "source_document_id": "p02755", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 451, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s225041501", "group_id": "codeNet:p02755", "input_text": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n\n$sc = new Scanner();\n$S = $sc->next();\n$Q = $sc->nextInt();\n$reverse = false;\n\nfor($i = 0; $i < $Q; ++$i) {\n\t$T = $sc->nextInt();\n\tif($T === 1) {\n\t\tif($reverse) {\n\t\t\t$reverse = false;\n\t\t} else {\n\t\t\t$reverse = true;\n\t\t}\n\t} else {\n\t\tif($reverse) {\n\t\t\t$reverse = false;\n\t\t\t$S = strrev($S);\n\t\t}\n\t\t$F = $sc->nextInt();\n\t\tif($F === 1) {\n\t\t\t$S = $sc->next() . $S;\n\t\t} else {\n\t\t\t$S = $S . $sc->next();\n\t\t}\n\t}\n}\nif($reverse) {\n\t$reverse = false;\n\t$S = strrev($S);\n}\n\nout::println($S);\n\n", "language": "PHP", "metadata": {"date": 1583635482, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/PHP/s252926903.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s252926903", "user_id": "u798514691"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n\n$sc = new Scanner();\n$S = $sc->next();\n$Q = $sc->nextInt();\n$reverse = false;\n\nfor($i = 0; $i < $Q; ++$i) {\n\t$T = $sc->nextInt();\n\tif($T === 1) {\n\t\tif($reverse) {\n\t\t\t$reverse = false;\n\t\t} else {\n\t\t\t$reverse = true;\n\t\t}\n\t} else {\n\t\tif($reverse) {\n\t\t\t$reverse = false;\n\t\t\t$S = strrev($S);\n\t\t}\n\t\t$F = $sc->nextInt();\n\t\tif($F === 1) {\n\t\t\t$S = $sc->next() . $S;\n\t\t} else {\n\t\t\t$S = $S . $sc->next();\n\t\t}\n\t}\n}\nif($reverse) {\n\t$reverse = false;\n\t$S = strrev($S);\n}\n\nout::println($S);\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1258, "cpu_time_ms": 2104, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s335775764", "group_id": "codeNet:p02756", "input_text": "", "language": "PHP", "metadata": {"date": 1583638978, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02757.html", "problem_id": "p02757", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02757/input.txt", "sample_output_relpath": "derived/input_output/data/p02757/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02757/PHP/s296611278.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s296611278", "user_id": "u087786978"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi has a string S of length N consisting of digits from 0 through 9.\n\nHe loves the prime number P. He wants to know how many non-empty (contiguous) substrings of S - there are N \\times (N + 1) / 2 of them - are divisible by P when regarded as integers written in base ten.\n\nHere substrings starting with a 0 also count, and substrings originated from different positions in S are distinguished, even if they are equal as strings or integers.\n\nCompute this count to help Takahashi.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS consists of digits.\n\n|S| = N\n\n2 \\leq P \\leq 10000\n\nP is a prime number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nS\n\nOutput\n\nPrint the number of non-empty (contiguous) substrings of S that are divisible by P when regarded as an integer written in base ten.\n\nSample Input 1\n\n4 3\n3543\n\nSample Output 1\n\n6\n\nHere S = 3543. There are ten non-empty (contiguous) substrings of S:\n\n3: divisible by 3.\n\n35: not divisible by 3.\n\n354: divisible by 3.\n\n3543: divisible by 3.\n\n5: not divisible by 3.\n\n54: divisible by 3.\n\n543: divisible by 3.\n\n4: not divisible by 3.\n\n43: not divisible by 3.\n\n3: divisible by 3.\n\nSix of these are divisible by 3, so print 6.\n\nSample Input 2\n\n4 2\n2020\n\nSample Output 2\n\n10\n\nHere S = 2020. There are ten non-empty (contiguous) substrings of S, all of which are divisible by 2, so print 10.\n\nNote that substrings beginning with a 0 also count.\n\nSample Input 3\n\n20 11\n33883322005544116655\n\nSample Output 3\n\n68", "sample_input": "4 3\n3543\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02757", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi has a string S of length N consisting of digits from 0 through 9.\n\nHe loves the prime number P. He wants to know how many non-empty (contiguous) substrings of S - there are N \\times (N + 1) / 2 of them - are divisible by P when regarded as integers written in base ten.\n\nHere substrings starting with a 0 also count, and substrings originated from different positions in S are distinguished, even if they are equal as strings or integers.\n\nCompute this count to help Takahashi.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS consists of digits.\n\n|S| = N\n\n2 \\leq P \\leq 10000\n\nP is a prime number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nS\n\nOutput\n\nPrint the number of non-empty (contiguous) substrings of S that are divisible by P when regarded as an integer written in base ten.\n\nSample Input 1\n\n4 3\n3543\n\nSample Output 1\n\n6\n\nHere S = 3543. There are ten non-empty (contiguous) substrings of S:\n\n3: divisible by 3.\n\n35: not divisible by 3.\n\n354: divisible by 3.\n\n3543: divisible by 3.\n\n5: not divisible by 3.\n\n54: divisible by 3.\n\n543: divisible by 3.\n\n4: not divisible by 3.\n\n43: not divisible by 3.\n\n3: divisible by 3.\n\nSix of these are divisible by 3, so print 6.\n\nSample Input 2\n\n4 2\n2020\n\nSample Output 2\n\n10\n\nHere S = 2020. There are ten non-empty (contiguous) substrings of S, all of which are divisible by 2, so print 10.\n\nNote that substrings beginning with a 0 also count.\n\nSample Input 3\n\n20 11\n33883322005544116655\n\nSample Output 3\n\n68", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 459, "cpu_time_ms": 2125, "memory_kb": 1982968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s758333688", "group_id": "codeNet:p02759", "input_text": "", "language": "PHP", "metadata": {"date": 1583889378, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02759/input.txt", "sample_output_relpath": "derived/input_output/data/p02759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02759/PHP/s758333688.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s758333688", "user_id": "u602977641"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "sample_input": "5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02759", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 87, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s584061494", "group_id": "codeNet:p02759", "input_text": "\n", "language": "PHP", "metadata": {"date": 1583120649, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02760.html", "problem_id": "p02760", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02760/input.txt", "sample_output_relpath": "derived/input_output/data/p02760/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02760/PHP/s637630753.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s637630753", "user_id": "u267871108"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "sample_input": "84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02760", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 584, "cpu_time_ms": 11, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s323397225", "group_id": "codeNet:p02760", "input_text": "\n", "language": "PHP", "metadata": {"date": 1583116737, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02760.html", "problem_id": "p02760", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02760/input.txt", "sample_output_relpath": "derived/input_output/data/p02760/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02760/PHP/s323397225.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s323397225", "user_id": "u868297566"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "sample_input": "84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02760", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 759, "cpu_time_ms": 13, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s691950465", "group_id": "codeNet:p02763", "input_text": "= 10) {\n echo($R).PHP_EOL;\n} else {\n $ans = $R + (100 * (10 - $N));\n echo $ans.PHP_EOL;\n}", "language": "PHP", "metadata": {"date": 1587611048, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02765.html", "problem_id": "p02765", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02765/input.txt", "sample_output_relpath": "derived/input_output/data/p02765/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02765/PHP/s490182768.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s490182768", "user_id": "u534321688"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "= 10) {\n echo($R).PHP_EOL;\n} else {\n $ans = $R + (100 * (10 - $N));\n echo $ans.PHP_EOL;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "sample_input": "2 2919\n"}, "reference_outputs": ["3719\n"], "source_document_id": "p02765", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 144, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s277461391", "group_id": "codeNet:p02765", "input_text": " $c) $r = $c;\n}\n\necho $r;\n", "language": "PHP", "metadata": {"date": 1582789957, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02765.html", "problem_id": "p02765", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02765/input.txt", "sample_output_relpath": "derived/input_output/data/p02765/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02765/PHP/s277461391.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s277461391", "user_id": "u527998189"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": " $c) $r = $c;\n}\n\necho $r;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "sample_input": "2 2919\n"}, "reference_outputs": ["3719\n"], "source_document_id": "p02765", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 294, "cpu_time_ms": 13, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s653586420", "group_id": "codeNet:p02765", "input_text": "= 10){\n echo $R;\n}else{\n echo $R + 100 * (10 -$N);\n}", "language": "PHP", "metadata": {"date": 1582423356, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02765.html", "problem_id": "p02765", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02765/input.txt", "sample_output_relpath": "derived/input_output/data/p02765/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02765/PHP/s653586420.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s653586420", "user_id": "u274811210"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "= 10){\n echo $R;\n}else{\n echo $R + 100 * (10 -$N);\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "sample_input": "2 2919\n"}, "reference_outputs": ["3719\n"], "source_document_id": "p02765", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 103, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s156407791", "group_id": "codeNet:p02766", "input_text": "$b){$a=$b;return 1;}return 0;}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array: \";\n echo implode(\" \", addIndex($val)).\"\\n\";\n }else{\n echo \"array:array\\n\";\n if(isCleanArray($val)){\n foreach($val as $row)echo implode(\" \", addIndex($row)).\"\\n\";\n }else{\n foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\nfunction addIndex($val){\n if(!isCleanArray($val)){\n $val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);\n }\n return $val;\n}\nfunction isCleanArray($array){\n $clean = true;\n $i = 0;\n foreach($array as $k => $v){\n if($k != $i++)$clean = false;\n }\n return $clean;\n}\n/**\n * 座圧対象の配列を渡すと以下の値を返す\n * ・圧縮された配列\n * ・復元用のMap\n * ・圧縮用のMap\n **/\nfunction atsu($array){\n $a = array_flip($array);\n $fuku = array_flip($a);\n sort($fuku);\n $atsu = array_flip($fuku);\n foreach($array as $i => $val)$array[$i] = $atsu[$val];\n return [$array, $fuku, $atsu];\n}\n//配列の最大公約数\nfunction gcdAll($array){\n $gcd = $array[0];\n for($i = 1; $i < count($array); $i++){\n $gcd = gcd($gcd, $array[$i]);\n }\n return $gcd;\n}\n\n//最大公約数\nfunction gcd($m, $n){\n if(!$n)return $m;\n return gcd($n, $m % $n);\n}\n\n//配列の最小公倍数\nfunction lcmAll($array){\n $lcm = $array[0];\n for($i = 1; $i < count($array); $i++){\n $lcm = lcm($lcm, $array[$i]);\n }\n return $lcm;\n}\n\n//最小公倍数\nfunction lcm($a, $b) {\n return $a / gcd($a, $b) * $b;\n}\n//ビットカウント-1の数を数える\nfunction popcount($x){\n $con = 0;\n while ($x) {\n $x &= $x-1;\n ++$con;\n }\n return $con;\n}\n", "language": "PHP", "metadata": {"date": 1582423421, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02766.html", "problem_id": "p02766", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02766/input.txt", "sample_output_relpath": "derived/input_output/data/p02766/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02766/PHP/s678559006.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s678559006", "user_id": "u248209126"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$b){$a=$b;return 1;}return 0;}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array: \";\n echo implode(\" \", addIndex($val)).\"\\n\";\n }else{\n echo \"array:array\\n\";\n if(isCleanArray($val)){\n foreach($val as $row)echo implode(\" \", addIndex($row)).\"\\n\";\n }else{\n foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\nfunction addIndex($val){\n if(!isCleanArray($val)){\n $val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);\n }\n return $val;\n}\nfunction isCleanArray($array){\n $clean = true;\n $i = 0;\n foreach($array as $k => $v){\n if($k != $i++)$clean = false;\n }\n return $clean;\n}\n/**\n * 座圧対象の配列を渡すと以下の値を返す\n * ・圧縮された配列\n * ・復元用のMap\n * ・圧縮用のMap\n **/\nfunction atsu($array){\n $a = array_flip($array);\n $fuku = array_flip($a);\n sort($fuku);\n $atsu = array_flip($fuku);\n foreach($array as $i => $val)$array[$i] = $atsu[$val];\n return [$array, $fuku, $atsu];\n}\n//配列の最大公約数\nfunction gcdAll($array){\n $gcd = $array[0];\n for($i = 1; $i < count($array); $i++){\n $gcd = gcd($gcd, $array[$i]);\n }\n return $gcd;\n}\n\n//最大公約数\nfunction gcd($m, $n){\n if(!$n)return $m;\n return gcd($n, $m % $n);\n}\n\n//配列の最小公倍数\nfunction lcmAll($array){\n $lcm = $array[0];\n for($i = 1; $i < count($array); $i++){\n $lcm = lcm($lcm, $array[$i]);\n }\n return $lcm;\n}\n\n//最小公倍数\nfunction lcm($a, $b) {\n return $a / gcd($a, $b) * $b;\n}\n//ビットカウント-1の数を数える\nfunction popcount($x){\n $con = 0;\n while ($x) {\n $x &= $x-1;\n ++$con;\n }\n return $con;\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "sample_input": "11 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02766", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2466, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s435321333", "group_id": "codeNet:p02767", "input_text": " $i; $i++) {\n $tmp = 0;\n foreach ($inputs as $input) {\n $x = $input - $i;\n $y = pow($x, 2);\n #echo join(\", \", [$input, $i, $n, $x, $y]) . \"\\n\";\n $tmp += $y;\n }\n #echo \"=\" . $tmp . \"\\n\";\n $decs[] = $tmp;\n}\n#echo join(\",\", $decs) . \"\\n\";\necho min($decs);\n", "language": "PHP", "metadata": {"date": 1582526300, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02767.html", "problem_id": "p02767", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02767/input.txt", "sample_output_relpath": "derived/input_output/data/p02767/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02767/PHP/s435321333.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s435321333", "user_id": "u024780318"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": " $i; $i++) {\n $tmp = 0;\n foreach ($inputs as $input) {\n $x = $input - $i;\n $y = pow($x, 2);\n #echo join(\", \", [$input, $i, $n, $x, $y]) . \"\\n\";\n $tmp += $y;\n }\n #echo \"=\" . $tmp . \"\\n\";\n $decs[] = $tmp;\n}\n#echo join(\",\", $decs) . \"\\n\";\necho min($decs);\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "sample_input": "2\n1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 466, "cpu_time_ms": 10, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s393135123", "group_id": "codeNet:p02767", "input_text": "", "language": "PHP", "metadata": {"date": 1582915474, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02772.html", "problem_id": "p02772", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02772/input.txt", "sample_output_relpath": "derived/input_output/data/p02772/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02772/PHP/s244770661.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s244770661", "user_id": "u255302563"}, "prompt_components": {"gold_output": "APPROVED\n", "input_to_evaluate": "", "problem_context": "Score: 200 points\n\nProblem Statement\n\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.\n\nAccording to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:\n\nAll even numbers written on the document are divisible by 3 or 5.\n\nIf the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.\n\nNotes\n\nThe condition in the statement can be rephrased as \"If x is an even number written on the document, x is divisible by 3 or 5\".\nHere \"if\" and \"or\" are logical terms.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nIf the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.\n\nSample Input 1\n\n5\n6 7 9 10 31\n\nSample Output 1\n\nAPPROVED\n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\nSample Input 2\n\n3\n28 27 24\n\nSample Output 2\n\nDENIED\n\n28 violates the condition, so the immigrant should not be allowed entry.", "sample_input": "5\n6 7 9 10 31\n"}, "reference_outputs": ["APPROVED\n"], "source_document_id": "p02772", "source_text": "Score: 200 points\n\nProblem Statement\n\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.\n\nAccording to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:\n\nAll even numbers written on the document are divisible by 3 or 5.\n\nIf the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.\n\nNotes\n\nThe condition in the statement can be rephrased as \"If x is an even number written on the document, x is divisible by 3 or 5\".\nHere \"if\" and \"or\" are logical terms.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nIf the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.\n\nSample Input 1\n\n5\n6 7 9 10 31\n\nSample Output 1\n\nAPPROVED\n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\nSample Input 2\n\n3\n28 27 24\n\nSample Output 2\n\nDENIED\n\n28 violates the condition, so the immigrant should not be allowed entry.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 390, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s117995379", "group_id": "codeNet:p02772", "input_text": "\n", "language": "PHP", "metadata": {"date": 1582921933, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02778.html", "problem_id": "p02778", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02778/input.txt", "sample_output_relpath": "derived/input_output/data/p02778/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02778/PHP/s466220656.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s466220656", "user_id": "u371132735"}, "prompt_components": {"gold_output": "xxxxxxx\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "sample_input": "sardine\n"}, "reference_outputs": ["xxxxxxx\n"], "source_document_id": "p02778", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 106, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s686220585", "group_id": "codeNet:p02778", "input_text": "\n", "language": "PHP", "metadata": {"date": 1582351428, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02778.html", "problem_id": "p02778", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02778/input.txt", "sample_output_relpath": "derived/input_output/data/p02778/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02778/PHP/s686220585.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s686220585", "user_id": "u868297566"}, "prompt_components": {"gold_output": "xxxxxxx\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "sample_input": "sardine\n"}, "reference_outputs": ["xxxxxxx\n"], "source_document_id": "p02778", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 111, "cpu_time_ms": 10, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s352708898", "group_id": "codeNet:p02778", "input_text": "", "language": "PHP", "metadata": {"date": 1590060125, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02779/input.txt", "sample_output_relpath": "derived/input_output/data/p02779/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02779/PHP/s976602355.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s976602355", "user_id": "u075074066"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "sample_input": "5\n2 6 1 4 5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02779", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 203, "cpu_time_ms": 40, "memory_kb": 33780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s262208509", "group_id": "codeNet:p02779", "input_text": "", "language": "PHP", "metadata": {"date": 1581282258, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02779/input.txt", "sample_output_relpath": "derived/input_output/data/p02779/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02779/PHP/s589562902.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s589562902", "user_id": "u598696606"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "sample_input": "5\n2 6 1 4 5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02779", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 245, "cpu_time_ms": 11, "memory_kb": 8696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s361336759", "group_id": "codeNet:p02779", "input_text": "\n", "language": "PHP", "metadata": {"date": 1581280402, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02779/input.txt", "sample_output_relpath": "derived/input_output/data/p02779/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02779/PHP/s361336759.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s361336759", "user_id": "u159975271"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "sample_input": "5\n2 6 1 4 5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02779", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 298, "memory_kb": 63604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s910399993", "group_id": "codeNet:p02780", "input_text": " $v) {\n $p[$i]++;\n}\n$max = 0;\n$s = 0;\n$q = new SplQueue();\nfor ($i = 0; $i < count($p); ++$i) {\n $s += $p[$i];\n $q->enqueue($p[$i]);\n if ($q->count() > $k) {\n $s -= $q->dequeue();\n }\n if ($q->count() == $k) {\n $max = max($max, $s);\n }\n}\nprintf(\"%.10f\", $max / 2);\n", "language": "PHP", "metadata": {"date": 1581292534, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02780/input.txt", "sample_output_relpath": "derived/input_output/data/p02780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02780/PHP/s910399993.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s910399993", "user_id": "u789975721"}, "prompt_components": {"gold_output": "7.000000000000\n", "input_to_evaluate": " $v) {\n $p[$i]++;\n}\n$max = 0;\n$s = 0;\n$q = new SplQueue();\nfor ($i = 0; $i < count($p); ++$i) {\n $s += $p[$i];\n $q->enqueue($p[$i]);\n if ($q->count() > $k) {\n $s -= $q->dequeue();\n }\n if ($q->count() == $k) {\n $max = max($max, $s);\n }\n}\nprintf(\"%.10f\", $max / 2);\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "sample_input": "5 3\n1 2 2 4 5\n"}, "reference_outputs": ["7.000000000000\n"], "source_document_id": "p02780", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 417, "cpu_time_ms": 106, "memory_kb": 27120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s501202864", "group_id": "codeNet:p02780", "input_text": " 0; $i --) {\n $sum += $i;\n }\n return (float)$sum / $d;\n}\n\n$ppp = [];\nforeach ($p as $pp) {\n $ppp[] = kitaiti($pp);\n}\n\n$cache = 0;\n//$point = 0;\n$aaa = $n - $k;\nfor ($i = 0; $i <= $aaa; $i++) {\n $tmp = 0.0;\n $bbb = $i+$k;\n for ($y = $i; $y < $bbb;$y++){\n $tmp += $ppp[$y];\n }\n if ($tmp > $cache) {\n $cache = $tmp;\n// $point = $i;\n }\n}\n\n//$fuga = 0.0;\n//$ccc = $point+$k;\n//for ($y = $point; $y < $ccc;$y++){\n// $fuga += kitaiti($p[$y]);\n//}\n\necho sprintf('%7f', $cache).PHP_EOL;\n\n\n\n", "language": "PHP", "metadata": {"date": 1581286274, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02780/input.txt", "sample_output_relpath": "derived/input_output/data/p02780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02780/PHP/s501202864.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s501202864", "user_id": "u324865921"}, "prompt_components": {"gold_output": "7.000000000000\n", "input_to_evaluate": " 0; $i --) {\n $sum += $i;\n }\n return (float)$sum / $d;\n}\n\n$ppp = [];\nforeach ($p as $pp) {\n $ppp[] = kitaiti($pp);\n}\n\n$cache = 0;\n//$point = 0;\n$aaa = $n - $k;\nfor ($i = 0; $i <= $aaa; $i++) {\n $tmp = 0.0;\n $bbb = $i+$k;\n for ($y = $i; $y < $bbb;$y++){\n $tmp += $ppp[$y];\n }\n if ($tmp > $cache) {\n $cache = $tmp;\n// $point = $i;\n }\n}\n\n//$fuga = 0.0;\n//$ccc = $point+$k;\n//for ($y = $point; $y < $ccc;$y++){\n// $fuga += kitaiti($p[$y]);\n//}\n\necho sprintf('%7f', $cache).PHP_EOL;\n\n\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "sample_input": "5 3\n1 2 2 4 5\n"}, "reference_outputs": ["7.000000000000\n"], "source_document_id": "p02780", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 689, "cpu_time_ms": 2104, "memory_kb": 29168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s617446031", "group_id": "codeNet:p02780", "input_text": "$b){$a=$b;return true;}return false;}\n\n$res=0;\n\nforeach($P as $v) {\n $sum = array_sum(range(1,$v,1));\n $k[] = $sum/$v;\n}\n\n$res = 0;\nfor($i=0;$i<=$N-$K;$i++) {\n $sum = 0;\n for($j=$i;$j<$i+$K;$j++) {\n $sum += $k[$j];\n }\n $res = max($res,$sum);\n}\nprintf(\"%f\\n\",$res);\n", "language": "PHP", "metadata": {"date": 1581279852, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02780/input.txt", "sample_output_relpath": "derived/input_output/data/p02780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02780/PHP/s149617838.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s149617838", "user_id": "u278278558"}, "prompt_components": {"gold_output": "7.000000000000\n", "input_to_evaluate": "$b){$a=$b;return true;}return false;}\n\n$res=0;\n\nforeach($P as $v) {\n $sum = array_sum(range(1,$v,1));\n $k[] = $sum/$v;\n}\n\n$res = 0;\nfor($i=0;$i<=$N-$K;$i++) {\n $sum = 0;\n for($j=$i;$j<$i+$K;$j++) {\n $sum += $k[$j];\n }\n $res = max($res,$sum);\n}\nprintf(\"%f\\n\",$res);\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "sample_input": "5 3\n1 2 2 4 5\n"}, "reference_outputs": ["7.000000000000\n"], "source_document_id": "p02780", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 538, "cpu_time_ms": 2104, "memory_kb": 29168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s763803665", "group_id": "codeNet:p02781", "input_text": "= $n) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($i === $exp) {\n\t\t\t\t\tfor ($j=$i+1; $j <= $exp; $j++) { \n\t\t\t\t\t\tfor ($jnum=1; $jnum <= 9; $jnum++) {\n\t\t\t\t\t\t\t$num = $inum * pow(10, $i) + $jnum * pow(10, $j);\n\t\t\t\t\t\t\tif ($num <= $n) {\n\t\t\t\t\t\t\t\t$sum += 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sum += ModComb::singleComb($i, 1, 1000000007) * 9;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase 3:\n\t\tfor ($i=$exp; $i >= 2; $i--) { \n\t\t\t$num = 0;\n\t\t\tfor ($inum=1; $inum <= 9; $inum++) { \n\t\t\t\tif ($inum * pow(10, $i) >= $n) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($i === $exp) {\n\t\t\t\t\tfor ($j=$i-1; $j >= 1; $j--) { \n\t\t\t\t\t\tfor ($jnum=1; $jnum <= 9; $jnum++) {\n\t\t\t\t\t\t\tif ($inum * pow(10, $i) + $jnum * pow(10, $j) >= $n) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor ($k=$j-1; $k >= 0; $k--) { \n\t\t\t\t\t\t\t\tfor ($knum=1; $knum <= 9; $knum++) {\n\t\t\t\t\t\t\t\t\t$num = $inum * pow(10, $i) + $jnum * pow(10, $j) + $knum * pow(10, $k);\n\t\t\t\t\t\t\t\t\tif ($num > $n) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$sum += 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sum += ModComb::singleComb($i, 2, 1000000007) * 81;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbreak;\n}\n\necho $sum;\n\n\nclass ModComb\n{\n\t// 事前計算テーブル\n\tprivate $f_table = [1]; // $n! % $mod\n\tprivate $if_table = [1]; // $k!の($mod-2)乗 % $mod\n\t// 十分大きな素数にする\n\tprivate $mod = 0;\n\n\tpublic function __construct($max = 10000, $mod = 1000000007){\n\t\t$this->mod = $mod;\n\t\t// 事前計算\n\t\t$this->calcFactorial($max);\n\t}\n\n\t// 組み合わせ計算(nCm)\n\tpublic function comb($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] * $this->if_table[$m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// logNで組み合わせを算出する。繰り返し多数の計算が不要な場合にはこちらの方が高速\n\tpublic static function singleComb($n, $m, $mod){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t$f_n = self::singleFact($n, $mod);\n\t\t$if_n_m = self::sigleBinPow(self::singleFact($n-$m, $mod), $mod-2, $mod) % $mod;\n\t\t$if_m = self::sigleBinPow(self::singleFact($m, $mod), $mod-2, $mod) % $mod;\n\t\treturn ($if_n_m * $if_m % $mod) * $f_n % $mod;\n\t}\n\n\tprivate static function singleFact($n, $mod){\n\t\tif ($n < 2) {\n\t\t\treturn 1;\n\t\t}\n\t\t$table = [];\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\t$table[$i] = $i+1;\n\t\t}\n\t\t$idx = 1;\n\t\twhile ($idx <= $n) {\n\t\t\t$span = $idx<<1;\n\t\t\tfor ($i=0; $i < $n; $i+=$span) { \n\t\t\t\tif ($idx + $i < $n) {\n\t\t\t\t\t$table[$i] = ($table[$i] * $table[$i+$idx]) % $mod;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$idx = $idx<<1;\n\t\t}\n\t\treturn $table[0];\n\t}\n\n\tprivate static function sigleBinPow($x, $n, $mod){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n\n\t// 順列計算(nPm)\n\tpublic function perm($n, $m){\n\t\tif ($n < $m) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// 重複組合せ計算(nHm)\n\tpublic function dupc($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < 0 || $m === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n + $m - 1])) {\n\t\t\t$this->calcFactorial($n + $m - 1);\n\t\t}\n\t\treturn ($this->if_table[$n - 1] * $this->if_table[$m] % $this->mod) * $this->f_table[$n + $m - 1] % $this->mod;\n\t}\n\n\t// 既存の事前計算結果テーブルの末尾から$maxまでの階乗までtableを拡張する。\n\tprivate function calcFactorial($max){\n\t\t$already = count($this->f_table);\n\t\tfor($i = $already; $i <= $max; $i++){\n\t\t\t$this->f_table[$i] = $this->f_table[$i-1] * $i % $this->mod;\n\t\t\t$this->if_table[$i] = $this->if_table[$i-1] * $this->binPow($i, $this->mod-2) % $this->mod;\n\t\t}\n\t}\n\n\t// $xの$n乗を2進数で高速に計算する\n\t// これを単体で利用する場合、コンストラクタの$maxは低めで良い\n\tpublic function binPow($x, $n){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $this->mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $this->mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n}", "language": "PHP", "metadata": {"date": 1581283996, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02781.html", "problem_id": "p02781", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02781/input.txt", "sample_output_relpath": "derived/input_output/data/p02781/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02781/PHP/s247687612.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s247687612", "user_id": "u699888017"}, "prompt_components": {"gold_output": "19\n", "input_to_evaluate": "= $n) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($i === $exp) {\n\t\t\t\t\tfor ($j=$i+1; $j <= $exp; $j++) { \n\t\t\t\t\t\tfor ($jnum=1; $jnum <= 9; $jnum++) {\n\t\t\t\t\t\t\t$num = $inum * pow(10, $i) + $jnum * pow(10, $j);\n\t\t\t\t\t\t\tif ($num <= $n) {\n\t\t\t\t\t\t\t\t$sum += 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sum += ModComb::singleComb($i, 1, 1000000007) * 9;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase 3:\n\t\tfor ($i=$exp; $i >= 2; $i--) { \n\t\t\t$num = 0;\n\t\t\tfor ($inum=1; $inum <= 9; $inum++) { \n\t\t\t\tif ($inum * pow(10, $i) >= $n) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($i === $exp) {\n\t\t\t\t\tfor ($j=$i-1; $j >= 1; $j--) { \n\t\t\t\t\t\tfor ($jnum=1; $jnum <= 9; $jnum++) {\n\t\t\t\t\t\t\tif ($inum * pow(10, $i) + $jnum * pow(10, $j) >= $n) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor ($k=$j-1; $k >= 0; $k--) { \n\t\t\t\t\t\t\t\tfor ($knum=1; $knum <= 9; $knum++) {\n\t\t\t\t\t\t\t\t\t$num = $inum * pow(10, $i) + $jnum * pow(10, $j) + $knum * pow(10, $k);\n\t\t\t\t\t\t\t\t\tif ($num > $n) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$sum += 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sum += ModComb::singleComb($i, 2, 1000000007) * 81;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbreak;\n}\n\necho $sum;\n\n\nclass ModComb\n{\n\t// 事前計算テーブル\n\tprivate $f_table = [1]; // $n! % $mod\n\tprivate $if_table = [1]; // $k!の($mod-2)乗 % $mod\n\t// 十分大きな素数にする\n\tprivate $mod = 0;\n\n\tpublic function __construct($max = 10000, $mod = 1000000007){\n\t\t$this->mod = $mod;\n\t\t// 事前計算\n\t\t$this->calcFactorial($max);\n\t}\n\n\t// 組み合わせ計算(nCm)\n\tpublic function comb($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] * $this->if_table[$m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// logNで組み合わせを算出する。繰り返し多数の計算が不要な場合にはこちらの方が高速\n\tpublic static function singleComb($n, $m, $mod){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t$f_n = self::singleFact($n, $mod);\n\t\t$if_n_m = self::sigleBinPow(self::singleFact($n-$m, $mod), $mod-2, $mod) % $mod;\n\t\t$if_m = self::sigleBinPow(self::singleFact($m, $mod), $mod-2, $mod) % $mod;\n\t\treturn ($if_n_m * $if_m % $mod) * $f_n % $mod;\n\t}\n\n\tprivate static function singleFact($n, $mod){\n\t\tif ($n < 2) {\n\t\t\treturn 1;\n\t\t}\n\t\t$table = [];\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\t$table[$i] = $i+1;\n\t\t}\n\t\t$idx = 1;\n\t\twhile ($idx <= $n) {\n\t\t\t$span = $idx<<1;\n\t\t\tfor ($i=0; $i < $n; $i+=$span) { \n\t\t\t\tif ($idx + $i < $n) {\n\t\t\t\t\t$table[$i] = ($table[$i] * $table[$i+$idx]) % $mod;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$idx = $idx<<1;\n\t\t}\n\t\treturn $table[0];\n\t}\n\n\tprivate static function sigleBinPow($x, $n, $mod){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n\n\t// 順列計算(nPm)\n\tpublic function perm($n, $m){\n\t\tif ($n < $m) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// 重複組合せ計算(nHm)\n\tpublic function dupc($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < 0 || $m === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n + $m - 1])) {\n\t\t\t$this->calcFactorial($n + $m - 1);\n\t\t}\n\t\treturn ($this->if_table[$n - 1] * $this->if_table[$m] % $this->mod) * $this->f_table[$n + $m - 1] % $this->mod;\n\t}\n\n\t// 既存の事前計算結果テーブルの末尾から$maxまでの階乗までtableを拡張する。\n\tprivate function calcFactorial($max){\n\t\t$already = count($this->f_table);\n\t\tfor($i = $already; $i <= $max; $i++){\n\t\t\t$this->f_table[$i] = $this->f_table[$i-1] * $i % $this->mod;\n\t\t\t$this->if_table[$i] = $this->if_table[$i-1] * $this->binPow($i, $this->mod-2) % $this->mod;\n\t\t}\n\t}\n\n\t// $xの$n乗を2進数で高速に計算する\n\t// これを単体で利用する場合、コンストラクタの$maxは低めで良い\n\tpublic function binPow($x, $n){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $this->mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $this->mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFind the number of integers between 1 and N (inclusive) that contains exactly K non-zero digits when written in base ten.\n\nConstraints\n\n1 \\leq N < 10^{100}\n\n1 \\leq K \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n100\n1\n\nSample Output 1\n\n19\n\nThe following 19 integers satisfy the condition:\n\n1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100\n\nSample Input 2\n\n25\n2\n\nSample Output 2\n\n14\n\nThe following 14 integers satisfy the condition:\n\n11,12,13,14,15,16,17,18,19,21,22,23,24,25\n\nSample Input 3\n\n314159\n2\n\nSample Output 3\n\n937\n\nSample Input 4\n\n9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n3\n\nSample Output 4\n\n117879300", "sample_input": "100\n1\n"}, "reference_outputs": ["19\n"], "source_document_id": "p02781", "source_text": "Score : 500 points\n\nProblem Statement\n\nFind the number of integers between 1 and N (inclusive) that contains exactly K non-zero digits when written in base ten.\n\nConstraints\n\n1 \\leq N < 10^{100}\n\n1 \\leq K \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n100\n1\n\nSample Output 1\n\n19\n\nThe following 19 integers satisfy the condition:\n\n1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100\n\nSample Input 2\n\n25\n2\n\nSample Output 2\n\n14\n\nThe following 14 integers satisfy the condition:\n\n11,12,13,14,15,16,17,18,19,21,22,23,24,25\n\nSample Input 3\n\n314159\n2\n\nSample Output 3\n\n937\n\nSample Input 4\n\n9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n3\n\nSample Output 4\n\n117879300", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4742, "cpu_time_ms": 2104, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s706796221", "group_id": "codeNet:p02782", "input_text": " 0) {\n $lifePoint = ($lifePoint - $attackPoint);\n $attackCount++;\n}\necho $attackCount . PHP_EOL;", "language": "PHP", "metadata": {"date": 1580769951, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02783.html", "problem_id": "p02783", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02783/input.txt", "sample_output_relpath": "derived/input_output/data/p02783/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02783/PHP/s477084680.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s477084680", "user_id": "u404000181"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$input = explode(' ', fgets(STDIN));\n$lifePoint = $input[0];\n$attackPoint = $input[1];\n$attackCount = 0;\n \nwhile($lifePoint > 0) {\n $lifePoint = ($lifePoint - $attackPoint);\n $attackCount++;\n}\necho $attackCount . PHP_EOL;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "sample_input": "10 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02783", "source_text": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 223, "cpu_time_ms": 10, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s277226303", "group_id": "codeNet:p02784", "input_text": "", "language": "PHP", "metadata": {"date": 1580515668, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02786.html", "problem_id": "p02786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02786/input.txt", "sample_output_relpath": "derived/input_output/data/p02786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02786/PHP/s004084008.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s004084008", "user_id": "u255302563"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "sample_input": "2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02786", "source_text": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 144, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s762976836", "group_id": "codeNet:p02786", "input_text": " 1) {\n $a = floor($a / 2);\n $i = $i + $b;\n $b = $b * 2;\n}\necho ($i + $b).PHP_EOL;", "language": "PHP", "metadata": {"date": 1580070993, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02786.html", "problem_id": "p02786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02786/input.txt", "sample_output_relpath": "derived/input_output/data/p02786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02786/PHP/s762976836.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s762976836", "user_id": "u016536213"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " 1) {\n $a = floor($a / 2);\n $i = $i + $b;\n $b = $b * 2;\n}\necho ($i + $b).PHP_EOL;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "sample_input": "2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02786", "source_text": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 148, "cpu_time_ms": 13, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s723891239", "group_id": "codeNet:p02787", "input_text": "= 0){\n chmin($dpi[$j], $dpi[$j-$a]+$b);\n }else{\n chmin($dpi[$j], $b);\n }\n }\n}\n//o($dp);\necho $dp[$N][$H];\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array: \";\n echo implode(\" \", addIndex($val)).\"\\n\";\n }else{\n echo \"array:array\\n\";\n if(isCleanArray($val)){\n foreach($val as $row)echo implode(\" \", addIndex($row)).\"\\n\";\n }else{\n foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\nfunction addIndex($val){\n if(!isCleanArray($val)){\n $val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);\n }\n return $val;\n}\nfunction isCleanArray($array){\n $clean = true;\n $i = 0;\n foreach($array as $k => $v){\n if($k != $i++)$clean = false;\n }\n return $clean;\n}", "language": "PHP", "metadata": {"date": 1580459700, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02787.html", "problem_id": "p02787", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02787/input.txt", "sample_output_relpath": "derived/input_output/data/p02787/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02787/PHP/s373618107.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s373618107", "user_id": "u248209126"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "= 0){\n chmin($dpi[$j], $dpi[$j-$a]+$b);\n }else{\n chmin($dpi[$j], $b);\n }\n }\n}\n//o($dp);\necho $dp[$N][$H];\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array: \";\n echo implode(\" \", addIndex($val)).\"\\n\";\n }else{\n echo \"array:array\\n\";\n if(isCleanArray($val)){\n foreach($val as $row)echo implode(\" \", addIndex($row)).\"\\n\";\n }else{\n foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\nfunction addIndex($val){\n if(!isCleanArray($val)){\n $val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);\n }\n return $val;\n}\nfunction isCleanArray($array){\n $clean = true;\n $i = 0;\n foreach($array as $k => $v){\n if($k != $i++)$clean = false;\n }\n return $clean;\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nIbis is fighting with a monster.\n\nThe health of the monster is H.\n\nIbis can cast N kinds of spells. Casting the i-th spell decreases the monster's health by A_i, at the cost of B_i Magic Points.\n\nThe same spell can be cast multiple times. There is no way other than spells to decrease the monster's health.\n\nIbis wins when the health of the monster becomes 0 or below.\n\nFind the minimum total Magic Points that have to be consumed before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq N \\leq 10^3\n\n1 \\leq A_i \\leq 10^4\n\n1 \\leq B_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the minimum total Magic Points that have to be consumed before winning.\n\nSample Input 1\n\n9 3\n8 3\n4 2\n2 1\n\nSample Output 1\n\n4\n\nFirst, let us cast the first spell to decrease the monster's health by 8, at the cost of 3 Magic Points. The monster's health is now 1.\n\nThen, cast the third spell to decrease the monster's health by 2, at the cost of 1 Magic Point. The monster's health is now -1.\n\nIn this way, we can win at the total cost of 4 Magic Points.\n\nSample Input 2\n\n100 6\n1 1\n2 3\n3 9\n4 27\n5 81\n6 243\n\nSample Output 2\n\n100\n\nIt is optimal to cast the first spell 100 times.\n\nSample Input 3\n\n9999 10\n540 7550\n691 9680\n700 9790\n510 7150\n415 5818\n551 7712\n587 8227\n619 8671\n588 8228\n176 2461\n\nSample Output 3\n\n139815", "sample_input": "9 3\n8 3\n4 2\n2 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02787", "source_text": "Score : 500 points\n\nProblem Statement\n\nIbis is fighting with a monster.\n\nThe health of the monster is H.\n\nIbis can cast N kinds of spells. Casting the i-th spell decreases the monster's health by A_i, at the cost of B_i Magic Points.\n\nThe same spell can be cast multiple times. There is no way other than spells to decrease the monster's health.\n\nIbis wins when the health of the monster becomes 0 or below.\n\nFind the minimum total Magic Points that have to be consumed before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq N \\leq 10^3\n\n1 \\leq A_i \\leq 10^4\n\n1 \\leq B_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the minimum total Magic Points that have to be consumed before winning.\n\nSample Input 1\n\n9 3\n8 3\n4 2\n2 1\n\nSample Output 1\n\n4\n\nFirst, let us cast the first spell to decrease the monster's health by 8, at the cost of 3 Magic Points. The monster's health is now 1.\n\nThen, cast the third spell to decrease the monster's health by 2, at the cost of 1 Magic Point. The monster's health is now -1.\n\nIn this way, we can win at the total cost of 4 Magic Points.\n\nSample Input 2\n\n100 6\n1 1\n2 3\n3 9\n4 27\n5 81\n6 243\n\nSample Output 2\n\n100\n\nIt is optimal to cast the first spell 100 times.\n\nSample Input 3\n\n9999 10\n540 7550\n691 9680\n700 9790\n510 7150\n415 5818\n551 7712\n587 8227\n619 8671\n588 8228\n176 2461\n\nSample Output 3\n\n139815", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1686, "cpu_time_ms": 1777, "memory_kb": 756216}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s249419956", "group_id": "codeNet:p02789", "input_text": "", "language": "PHP", "metadata": {"date": 1579463559, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02789.html", "problem_id": "p02789", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02789/input.txt", "sample_output_relpath": "derived/input_output/data/p02789/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02789/PHP/s949361228.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s949361228", "user_id": "u343995406"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.\n\nThe problem has N test cases, all of which must be passed to get an AC verdict.\n\nTakahashi's submission has passed M cases out of the N test cases.\n\nDetermine whether Takahashi's submission gets an AC.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq M \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nIf Takahashi's submission gets an AC, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\nYes\n\nAll three test cases have been passed, so his submission gets an AC.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\nNo\n\nOnly two out of the three test cases have been passed, so his submission does not get an AC.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\nYes", "sample_input": "3 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02789", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.\n\nThe problem has N test cases, all of which must be passed to get an AC verdict.\n\nTakahashi's submission has passed M cases out of the N test cases.\n\nDetermine whether Takahashi's submission gets an AC.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq M \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nIf Takahashi's submission gets an AC, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\nYes\n\nAll three test cases have been passed, so his submission gets an AC.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\nNo\n\nOnly two out of the three test cases have been passed, so his submission does not get an AC.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 191, "cpu_time_ms": 22, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s858624544", "group_id": "codeNet:p02790", "input_text": "0){\n for($i=0;$i<$a;$i++){\n echo $b;\n }\n }else{\n for($i=0;$i<$b;$i++){\n echo $a;\n }\n }\n\n\n \n?>\n ", "language": "PHP", "metadata": {"date": 1586887569, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02790.html", "problem_id": "p02790", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02790/input.txt", "sample_output_relpath": "derived/input_output/data/p02790/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02790/PHP/s858624544.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s858624544", "user_id": "u553494195"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": "0){\n for($i=0;$i<$a;$i++){\n echo $b;\n }\n }else{\n for($i=0;$i<$b;$i++){\n echo $a;\n }\n }\n\n\n \n?>\n ", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "sample_input": "4 3\n"}, "reference_outputs": ["3333\n"], "source_document_id": "p02790", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 217, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s280102879", "group_id": "codeNet:p02790", "input_text": " $b) {\n echo str_repeat($b, $a);\n} else {\n echo str_repeat($a, $b);\n}\n\n\n", "language": "PHP", "metadata": {"date": 1579465903, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02790.html", "problem_id": "p02790", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02790/input.txt", "sample_output_relpath": "derived/input_output/data/p02790/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02790/PHP/s280102879.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s280102879", "user_id": "u168377597"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": " $b) {\n echo str_repeat($b, $a);\n} else {\n echo str_repeat($a, $b);\n}\n\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "sample_input": "4 3\n"}, "reference_outputs": ["3333\n"], "source_document_id": "p02790", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 133, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s003617618", "group_id": "codeNet:p02790", "input_text": " $str2) {\n $res = $str2;\n } elseif($str2 > $str1) {\n $res = $str1;\n } else {\n $res = $str1;\n }\n\n\tprint substr($res,2,strlen($res));\n\n?>", "language": "PHP", "metadata": {"date": 1579465536, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02790.html", "problem_id": "p02790", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02790/input.txt", "sample_output_relpath": "derived/input_output/data/p02790/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02790/PHP/s003617618.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003617618", "user_id": "u169395463"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": " $str2) {\n $res = $str2;\n } elseif($str2 > $str1) {\n $res = $str1;\n } else {\n $res = $str1;\n }\n\n\tprint substr($res,2,strlen($res));\n\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "sample_input": "4 3\n"}, "reference_outputs": ["3333\n"], "source_document_id": "p02790", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 405, "cpu_time_ms": 12, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s475736816", "group_id": "codeNet:p02790", "input_text": "", "language": "PHP", "metadata": {"date": 1579464148, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02790.html", "problem_id": "p02790", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02790/input.txt", "sample_output_relpath": "derived/input_output/data/p02790/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02790/PHP/s475736816.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s475736816", "user_id": "u667624765"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "sample_input": "4 3\n"}, "reference_outputs": ["3333\n"], "source_document_id": "p02790", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 258, "cpu_time_ms": 11, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s188209346", "group_id": "codeNet:p02791", "input_text": " $val) {\n if ($key-1 >= 0) {\n for ($i=0; $i<=$key-1; $i++) {\n if ($val > $exploded_numbers[$i]) {\n continue 2;\n }\n }\n $count++;\n } else {\n $count++;\n }\n }\necho $count;", "language": "PHP", "metadata": {"date": 1579469760, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/PHP/s188209346.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s188209346", "user_id": "u179703950"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $val) {\n if ($key-1 >= 0) {\n for ($i=0; $i<=$key-1; $i++) {\n if ($val > $exploded_numbers[$i]) {\n continue 2;\n }\n }\n $count++;\n } else {\n $count++;\n }\n }\necho $count;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 386, "cpu_time_ms": 2104, "memory_kb": 18936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s107488738", "group_id": "codeNet:p02791", "input_text": " $array[$i]) {\n $min = $array[$i];\n }\n if ($array[$i] <= $min) {\n $count++;\n }\n}\n\necho $count;\n", "language": "PHP", "metadata": {"date": 1579468020, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/PHP/s107488738.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s107488738", "user_id": "u080556513"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $array[$i]) {\n $min = $array[$i];\n }\n if ($array[$i] <= $min) {\n $count++;\n }\n}\n\necho $count;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 279, "cpu_time_ms": 59, "memory_kb": 18932}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s225641615", "group_id": "codeNet:p02791", "input_text": "= (int) $a[$i]){\n $count++;\n \t $min = (int) $a[$i];\n }\n }\n echo $count.\"\\n\";\n}\n?>", "language": "PHP", "metadata": {"date": 1579467346, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/PHP/s225641615.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s225641615", "user_id": "u083858683"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "= (int) $a[$i]){\n $count++;\n \t $min = (int) $a[$i];\n }\n }\n echo $count.\"\\n\";\n}\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 329, "cpu_time_ms": 462, "memory_kb": 4852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s225743828", "group_id": "codeNet:p02792", "input_text": " $v) {\n if (isset($valuesB[$k])) {\n $ans += $v * $valuesB[$k];\n }\n}\n\necho $ans;\n", "language": "PHP", "metadata": {"date": 1579469498, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02792.html", "problem_id": "p02792", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02792/input.txt", "sample_output_relpath": "derived/input_output/data/p02792/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02792/PHP/s225743828.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s225743828", "user_id": "u112317104"}, "prompt_components": {"gold_output": "17\n", "input_to_evaluate": " $v) {\n if (isset($valuesB[$k])) {\n $ans += $v * $valuesB[$k];\n }\n}\n\necho $ans;\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "sample_input": "25\n"}, "reference_outputs": ["17\n"], "source_document_id": "p02792", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 470, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s479837556", "group_id": "codeNet:p02793", "input_text": " $v) {\n if (isset($cnt[$k])) $cnt[$k] = max($cnt[$k], $v);\n else $cnt[$k] = $v;\n }\n}\n$ans = 0;\nfor ($i = 0; $i < $n; ++$i) {\n $t = 1;\n foreach ($cnt as $k => $v)\n $t = modMul($t, modPow($k, $v - ($pfs[$i][$k] ?? 0)));\n $ans = modAdd($ans, $t);\n}\necho $ans;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n\n// 最大公約数(2つ)\nfunction gcd($m, $n)\n{\n if (!$n) return $m;\n return gcd($n, $m % $n);\n}\n\n// 最大公約数(3つ以上)\nfunction gcdAll($arr)\n{\n $gcd = array_pop($arr);\n foreach ($arr as $a) {\n $gcd = gcd($gcd, $a);\n }\n return $gcd;\n}\n\n// 最小公倍数(2つ)\nfunction lcm($m, $n)\n{\n return (int) ($m / gcd($m, $n) * $n); // オーバーフローしないように先に割り算\n}\n\n// 最小公倍数(3つ以上)\nfunction lcmAll($arr)\n{\n $lcm = array_pop($arr);\n foreach ($arr as $a) {\n $lcm = lcm($lcm, $a);\n }\n return $lcm;\n}\n// 足し算\nfunction modAdd($x, $y)\n{\n return ($x + $y) % MOD;\n}\n\n// 引き算\nfunction modSub($x, $y)\n{\n return ($x + MOD - $y) % MOD;\n}\n\n// 掛け算\nfunction modMul($x, $y)\n{\n return ($x * $y) % MOD;\n}\n\n// 割り算\nfunction modDiv($x, $y)\n{\n return modMul($x, modPow($y, MOD - 2));\n}\n\n// 累乗(繰り返し二乗法)\nfunction modPow($n, $x)\n{\n if ($x === 0) return 1;\n $res = (modPow($n, $x >> 1) ** 2) % MOD;\n if ($x % 2 === 1) $res = modMul($res, $n);\n return $res;\n}\n\n// 階乗\nfunction modFac($n)\n{\n if ($n === 0) return 1;\n return modMul($n, modFac($n - 1));\n}\n\n// 順列\nfunction nPr($n, $r)\n{\n if ($r === 0) return 1;\n return modMul(nPr($n, $r - 1), $n - $r + 1);\n}\n\n// 組み合わせ\nfunction nCr($n, $r)\n{\n $r = min($r, $n - $r);\n if ($r === 0) return 1;\n return modDiv(nPr($n, $r), modFac($r));\n}\n\n// 階乗、逆元を前処理\nfunction init($n)\n{\n global $fact, $ifact;\n $fact[0] = 1;\n for ($i = 1; $i <= $n; ++$i) $fact[$i] = modMul($fact[$i - 1], $i);\n $ifact[$n] = modDiv(1, $fact[$n]);\n for ($i = $n; $i >= 1; --$i)\n $ifact[$i - 1] = modMul($ifact[$i], $i);\n}\n\n// 順列(前処理)\nfunction nPr2($n, $r)\n{\n global $fact, $ifact;\n return modMul($fact[$n], $ifact[$n - $r]);\n}\n\n// 組み合わせ(前処理)\nfunction nCr2($n, $r)\n{\n global $fact, $ifact;\n return modMul(modMul($fact[$n], $ifact[$r]), $ifact[$n - $r]);\n}\n/**\n * 素数列挙(エラトステネスのふるい)\n * $max以下の素数を格納した配列を返す\n */\nfunction primesArr($max)\n{\n $arr = array_fill(2, $max - 1, true);\n $rmax = (int) floor(sqrt($max));\n for ($i = 2; $i <= $rmax; $i++) {\n if (!isset($arr[$i])) continue;\n for ($j = 2 * $i; $j <= $max; $j += $i) {\n unset($arr[$j]);\n }\n }\n return array_keys($arr);\n}\n\n/**\n * 素数判定(エラトステネスのふるい)\n * $max以下の整数が素数かどうかboolを格納した配列を返す\n */\nfunction isPrimeArr($max)\n{\n $arr = array_fill(0, $max + 1, true);\n $arr[0] = $arr[1] = false;\n $rmax = (int) floor(sqrt($max));\n for ($i = 2; $i <= $rmax; $i++) {\n for ($j = 2 * $i; $j <= $max; $j += $i) {\n $arr[$j] = false;\n }\n }\n return $arr;\n}\n\n// 素因数分解(エラトステネスのふるい)\n// インデックスに素数、値に数を格納した配列を返す\n// (1は素数ではないので含まない)\nfunction primeFactorization($n)\n{\n global $primes;\n\n $res = [];\n if ($n === 1) return $res;\n\n if (is_null($primes)) $primes = primesArr((int) sqrt($n) + 1);\n\n foreach ($primes as $prime) {\n while ($n % $prime === 0) {\n if (isset($res[$prime])) {\n $res[$prime]++;\n } else {\n $res[$prime] = 1;\n }\n $n /= $prime;\n }\n }\n\n if ($n > 1) {\n if (isset($res[$n])) {\n $res[$n]++;\n } else {\n $res[$n] = 1;\n }\n }\n\n return $res;\n}\n\n// 素数列挙(試し割り)\nfunction primes($max)\n{\n $arr = [];\n for ($i = 2; $i <= $max; $i++) {\n if (isPrime($i)) $arr[] = $i;\n }\n return $arr;\n}\n\n// 素数判定(試し割り)\nfunction isPrime($n)\n{\n if ($n === 1) return false;\n $rmax = (int) floor(sqrt($n));\n for ($i = 2; $i <= $rmax; $i++) {\n if ($n % $i === 0) return false;\n }\n return true;\n}\n\n// 約数列挙\nfunction divisors($max)\n{\n $arr = [];\n $rmax = (int) floor(sqrt($max));\n for ($i = 1; $i <= $rmax; $i++) {\n if ($max % $i === 0) {\n $arr[] = $i;\n $arr[] = $max / $i;\n }\n }\n sort($arr);\n return array_unique($arr);\n}\n", "language": "PHP", "metadata": {"date": 1594818245, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02793.html", "problem_id": "p02793", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02793/input.txt", "sample_output_relpath": "derived/input_output/data/p02793/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02793/PHP/s479837556.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s479837556", "user_id": "u055687468"}, "prompt_components": {"gold_output": "13\n", "input_to_evaluate": " $v) {\n if (isset($cnt[$k])) $cnt[$k] = max($cnt[$k], $v);\n else $cnt[$k] = $v;\n }\n}\n$ans = 0;\nfor ($i = 0; $i < $n; ++$i) {\n $t = 1;\n foreach ($cnt as $k => $v)\n $t = modMul($t, modPow($k, $v - ($pfs[$i][$k] ?? 0)));\n $ans = modAdd($ans, $t);\n}\necho $ans;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n\n// 最大公約数(2つ)\nfunction gcd($m, $n)\n{\n if (!$n) return $m;\n return gcd($n, $m % $n);\n}\n\n// 最大公約数(3つ以上)\nfunction gcdAll($arr)\n{\n $gcd = array_pop($arr);\n foreach ($arr as $a) {\n $gcd = gcd($gcd, $a);\n }\n return $gcd;\n}\n\n// 最小公倍数(2つ)\nfunction lcm($m, $n)\n{\n return (int) ($m / gcd($m, $n) * $n); // オーバーフローしないように先に割り算\n}\n\n// 最小公倍数(3つ以上)\nfunction lcmAll($arr)\n{\n $lcm = array_pop($arr);\n foreach ($arr as $a) {\n $lcm = lcm($lcm, $a);\n }\n return $lcm;\n}\n// 足し算\nfunction modAdd($x, $y)\n{\n return ($x + $y) % MOD;\n}\n\n// 引き算\nfunction modSub($x, $y)\n{\n return ($x + MOD - $y) % MOD;\n}\n\n// 掛け算\nfunction modMul($x, $y)\n{\n return ($x * $y) % MOD;\n}\n\n// 割り算\nfunction modDiv($x, $y)\n{\n return modMul($x, modPow($y, MOD - 2));\n}\n\n// 累乗(繰り返し二乗法)\nfunction modPow($n, $x)\n{\n if ($x === 0) return 1;\n $res = (modPow($n, $x >> 1) ** 2) % MOD;\n if ($x % 2 === 1) $res = modMul($res, $n);\n return $res;\n}\n\n// 階乗\nfunction modFac($n)\n{\n if ($n === 0) return 1;\n return modMul($n, modFac($n - 1));\n}\n\n// 順列\nfunction nPr($n, $r)\n{\n if ($r === 0) return 1;\n return modMul(nPr($n, $r - 1), $n - $r + 1);\n}\n\n// 組み合わせ\nfunction nCr($n, $r)\n{\n $r = min($r, $n - $r);\n if ($r === 0) return 1;\n return modDiv(nPr($n, $r), modFac($r));\n}\n\n// 階乗、逆元を前処理\nfunction init($n)\n{\n global $fact, $ifact;\n $fact[0] = 1;\n for ($i = 1; $i <= $n; ++$i) $fact[$i] = modMul($fact[$i - 1], $i);\n $ifact[$n] = modDiv(1, $fact[$n]);\n for ($i = $n; $i >= 1; --$i)\n $ifact[$i - 1] = modMul($ifact[$i], $i);\n}\n\n// 順列(前処理)\nfunction nPr2($n, $r)\n{\n global $fact, $ifact;\n return modMul($fact[$n], $ifact[$n - $r]);\n}\n\n// 組み合わせ(前処理)\nfunction nCr2($n, $r)\n{\n global $fact, $ifact;\n return modMul(modMul($fact[$n], $ifact[$r]), $ifact[$n - $r]);\n}\n/**\n * 素数列挙(エラトステネスのふるい)\n * $max以下の素数を格納した配列を返す\n */\nfunction primesArr($max)\n{\n $arr = array_fill(2, $max - 1, true);\n $rmax = (int) floor(sqrt($max));\n for ($i = 2; $i <= $rmax; $i++) {\n if (!isset($arr[$i])) continue;\n for ($j = 2 * $i; $j <= $max; $j += $i) {\n unset($arr[$j]);\n }\n }\n return array_keys($arr);\n}\n\n/**\n * 素数判定(エラトステネスのふるい)\n * $max以下の整数が素数かどうかboolを格納した配列を返す\n */\nfunction isPrimeArr($max)\n{\n $arr = array_fill(0, $max + 1, true);\n $arr[0] = $arr[1] = false;\n $rmax = (int) floor(sqrt($max));\n for ($i = 2; $i <= $rmax; $i++) {\n for ($j = 2 * $i; $j <= $max; $j += $i) {\n $arr[$j] = false;\n }\n }\n return $arr;\n}\n\n// 素因数分解(エラトステネスのふるい)\n// インデックスに素数、値に数を格納した配列を返す\n// (1は素数ではないので含まない)\nfunction primeFactorization($n)\n{\n global $primes;\n\n $res = [];\n if ($n === 1) return $res;\n\n if (is_null($primes)) $primes = primesArr((int) sqrt($n) + 1);\n\n foreach ($primes as $prime) {\n while ($n % $prime === 0) {\n if (isset($res[$prime])) {\n $res[$prime]++;\n } else {\n $res[$prime] = 1;\n }\n $n /= $prime;\n }\n }\n\n if ($n > 1) {\n if (isset($res[$n])) {\n $res[$n]++;\n } else {\n $res[$n] = 1;\n }\n }\n\n return $res;\n}\n\n// 素数列挙(試し割り)\nfunction primes($max)\n{\n $arr = [];\n for ($i = 2; $i <= $max; $i++) {\n if (isPrime($i)) $arr[] = $i;\n }\n return $arr;\n}\n\n// 素数判定(試し割り)\nfunction isPrime($n)\n{\n if ($n === 1) return false;\n $rmax = (int) floor(sqrt($n));\n for ($i = 2; $i <= $rmax; $i++) {\n if ($n % $i === 0) return false;\n }\n return true;\n}\n\n// 約数列挙\nfunction divisors($max)\n{\n $arr = [];\n $rmax = (int) floor(sqrt($max));\n for ($i = 1; $i <= $rmax; $i++) {\n if ($max % $i === 0) {\n $arr[] = $i;\n $arr[] = $max / $i;\n }\n }\n sort($arr);\n return array_unique($arr);\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n2 3 4\n"}, "reference_outputs": ["13\n"], "source_document_id": "p02793", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4947, "cpu_time_ms": 2206, "memory_kb": 21344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s503392662", "group_id": "codeNet:p02793", "input_text": " $a) list($a, $b) = [$b, $a];\n \n while($b > 0) {\n $tb = $b;\n $b = $a % $b;\n $a = $tb;\n }\n return $a;\n } \n \nfunction lcm($a, $b) {\n return $a * $b / gcd($a, $b);\n}\n \n $n = fgets(STDIN);\n $ne = preg_split(\"/\\s/\", fgets(STDIN));\n$ne = array_map('intval', $ne);\n \n $gcd = 1;\n for ($i = 0; $i < $n; $i++) {\n $gcd = lcm($gcd, $ne[$i]);\n }\n $sum = 0;\n for ($i = 0; $i < $n; $i++) {\n $sum += ($gcd / $ne[$i]);\n $sum = $sum % $mod;\n }\necho $sum;", "language": "PHP", "metadata": {"date": 1579468503, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02793.html", "problem_id": "p02793", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02793/input.txt", "sample_output_relpath": "derived/input_output/data/p02793/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02793/PHP/s503392662.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s503392662", "user_id": "u872833608"}, "prompt_components": {"gold_output": "13\n", "input_to_evaluate": " $a) list($a, $b) = [$b, $a];\n \n while($b > 0) {\n $tb = $b;\n $b = $a % $b;\n $a = $tb;\n }\n return $a;\n } \n \nfunction lcm($a, $b) {\n return $a * $b / gcd($a, $b);\n}\n \n $n = fgets(STDIN);\n $ne = preg_split(\"/\\s/\", fgets(STDIN));\n$ne = array_map('intval', $ne);\n \n $gcd = 1;\n for ($i = 0; $i < $n; $i++) {\n $gcd = lcm($gcd, $ne[$i]);\n }\n $sum = 0;\n for ($i = 0; $i < $n; $i++) {\n $sum += ($gcd / $ne[$i]);\n $sum = $sum % $mod;\n }\necho $sum;", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n2 3 4\n"}, "reference_outputs": ["13\n"], "source_document_id": "p02793", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 573, "cpu_time_ms": 27, "memory_kb": 7860}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s707054535", "group_id": "codeNet:p02795", "input_text": " $v){\n if ($k - $v >= $x || $f == 1){\n $c++;\n $x = $k + $v;\n $f = 0;\n } \n }\n $a = $c;\n\n $c = 0;\n $x = 0;\n $f = 1;\n krsort($vec);\n foreach($vec as $k => $v){\n if ($k + $v <= $x || $f == 1){ \n $c++;\n $x = $k - $v;\n $f = 0;\n } \n }\n $b = $c;\n\n echo max($a,$b);\n\n?>", "language": "PHP", "metadata": {"date": 1579379886, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02796.html", "problem_id": "p02796", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02796/input.txt", "sample_output_relpath": "derived/input_output/data/p02796/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02796/PHP/s913816583.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s913816583", "user_id": "u397596606"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $v){\n if ($k - $v >= $x || $f == 1){\n $c++;\n $x = $k + $v;\n $f = 0;\n } \n }\n $a = $c;\n\n $c = 0;\n $x = 0;\n $f = 1;\n krsort($vec);\n foreach($vec as $k => $v){\n if ($k + $v <= $x || $f == 1){ \n $c++;\n $x = $k - $v;\n $f = 0;\n } \n }\n $b = $c;\n\n echo max($a,$b);\n\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "sample_input": "4\n2 4\n4 3\n9 3\n100 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02796", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 544, "cpu_time_ms": 104, "memory_kb": 13176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s164842529", "group_id": "codeNet:p02796", "input_text": "= $max){\n $count++;\n $max = $b[$i];\n }\n}\necho $count;\n\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array:\";\n echo implode(\" \", $val).\"\\n\";\n }else{\n echo \"array:array\\n\";\n foreach($val as $row){\n echo implode(\" \", $row).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}", "language": "PHP", "metadata": {"date": 1579378077, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02796.html", "problem_id": "p02796", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02796/input.txt", "sample_output_relpath": "derived/input_output/data/p02796/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02796/PHP/s164842529.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s164842529", "user_id": "u248209126"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "= $max){\n $count++;\n $max = $b[$i];\n }\n}\necho $count;\n\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array:\";\n echo implode(\" \", $val).\"\\n\";\n }else{\n echo \"array:array\\n\";\n foreach($val as $row){\n echo implode(\" \", $row).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "sample_input": "4\n2 4\n4 3\n9 3\n100 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02796", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 994, "cpu_time_ms": 139, "memory_kb": 22260}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s152178609", "group_id": "codeNet:p02798", "input_text": " $p1){\n $ns = ($p0-$con) & 1 ? $B[$p0] : $A[$p0];\n if($ns >= $s){\n $nb = $bit | (1<<$p0);\n $dp[$nb][$ns] = min($dp[$nb][$ns], $dp[$bit][$s] + abs($p1 - $con));\n }\n }\n }\n}\n$min = min($dp[(1<<$N)-1]);\nif($min == PHP_INT_MAX){\n echo -1;\n}else{\n echo $min;\n}\n\nfunction countBits($x){\n $con = 0;\n while ($x) {\n $x &= $x-1;\n ++$con;\n }\n return $con;\n}", "language": "PHP", "metadata": {"date": 1579448436, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02798.html", "problem_id": "p02798", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02798/input.txt", "sample_output_relpath": "derived/input_output/data/p02798/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02798/PHP/s152178609.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s152178609", "user_id": "u248209126"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $p1){\n $ns = ($p0-$con) & 1 ? $B[$p0] : $A[$p0];\n if($ns >= $s){\n $nb = $bit | (1<<$p0);\n $dp[$nb][$ns] = min($dp[$nb][$ns], $dp[$bit][$s] + abs($p1 - $con));\n }\n }\n }\n}\n$min = min($dp[(1<<$N)-1]);\nif($min == PHP_INT_MAX){\n echo -1;\n}else{\n echo $min;\n}\n\nfunction countBits($x){\n $con = 0;\n while ($x) {\n $x &= $x-1;\n ++$con;\n }\n return $con;\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have N cards numbered 1, 2, ..., N.\nCard i (1 \\leq i \\leq N) has an integer A_i written in red ink on one side and an integer B_i written in blue ink on the other side.\nInitially, these cards are arranged from left to right in the order from Card 1 to Card N, with the red numbers facing up.\n\nDetermine whether it is possible to have a non-decreasing sequence facing up from left to right (that is, for each i (1 \\leq i \\leq N - 1), the integer facing up on the (i+1)-th card from the left is not less than the integer facing up on the i-th card from the left) by repeating the operation below. If the answer is yes, find the minimum number of operations required to achieve it.\n\nChoose an integer i (1 \\leq i \\leq N - 1).\nSwap the i-th and (i+1)-th cards from the left, then flip these two cards.\n\nConstraints\n\n1 \\leq N \\leq 18\n\n1 \\leq A_i, B_i \\leq 50 (1 \\leq i \\leq N)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nIf it is impossible to have a non-decreasing sequence, print -1.\nIf it is possible, print the minimum number of operations required to achieve it.\n\nSample Input 1\n\n3\n3 4 3\n3 2 3\n\nSample Output 1\n\n1\n\nBy doing the operation once with i = 1, we have a sequence [2, 3, 3] facing up, which is non-decreasing.\n\nSample Input 2\n\n2\n2 1\n1 2\n\nSample Output 2\n\n-1\n\nAfter any number of operations, we have the sequence [2, 1] facing up, which is not non-decreasing.\n\nSample Input 3\n\n4\n1 2 3 4\n5 6 7 8\n\nSample Output 3\n\n0\n\nNo operation may be required.\n\nSample Input 4\n\n5\n28 15 22 43 31\n20 22 43 33 32\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n5\n4 46 6 38 43\n33 15 18 27 37\n\nSample Output 5\n\n3", "sample_input": "3\n3 4 3\n3 2 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02798", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have N cards numbered 1, 2, ..., N.\nCard i (1 \\leq i \\leq N) has an integer A_i written in red ink on one side and an integer B_i written in blue ink on the other side.\nInitially, these cards are arranged from left to right in the order from Card 1 to Card N, with the red numbers facing up.\n\nDetermine whether it is possible to have a non-decreasing sequence facing up from left to right (that is, for each i (1 \\leq i \\leq N - 1), the integer facing up on the (i+1)-th card from the left is not less than the integer facing up on the i-th card from the left) by repeating the operation below. If the answer is yes, find the minimum number of operations required to achieve it.\n\nChoose an integer i (1 \\leq i \\leq N - 1).\nSwap the i-th and (i+1)-th cards from the left, then flip these two cards.\n\nConstraints\n\n1 \\leq N \\leq 18\n\n1 \\leq A_i, B_i \\leq 50 (1 \\leq i \\leq N)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nIf it is impossible to have a non-decreasing sequence, print -1.\nIf it is possible, print the minimum number of operations required to achieve it.\n\nSample Input 1\n\n3\n3 4 3\n3 2 3\n\nSample Output 1\n\n1\n\nBy doing the operation once with i = 1, we have a sequence [2, 3, 3] facing up, which is non-decreasing.\n\nSample Input 2\n\n2\n2 1\n1 2\n\nSample Output 2\n\n-1\n\nAfter any number of operations, we have the sequence [2, 1] facing up, which is not non-decreasing.\n\nSample Input 3\n\n4\n1 2 3 4\n5 6 7 8\n\nSample Output 3\n\n0\n\nNo operation may be required.\n\nSample Input 4\n\n5\n28 15 22 43 31\n20 22 43 33 32\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n5\n4 46 6 38 43\n33 15 18 27 37\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1000, "cpu_time_ms": 1878, "memory_kb": 682488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s049864715", "group_id": "codeNet:p02798", "input_text": "= $s){\n $dp[$bit | (1<<$p[0])][$ns] = min($dp[$bit|(1<<$p[0])][$ns], $dp[$bit][$s] + abs($p[1] - $con));\n }\n }\n }\n }\n $min = min($dp[(1<<$N)-1]);\n if($min == PHP_INT_MAX){\n return -1;\n }else{\n return $min;\n }\n}", "language": "PHP", "metadata": {"date": 1579443522, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02798.html", "problem_id": "p02798", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02798/input.txt", "sample_output_relpath": "derived/input_output/data/p02798/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02798/PHP/s049864715.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s049864715", "user_id": "u248209126"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "= $s){\n $dp[$bit | (1<<$p[0])][$ns] = min($dp[$bit|(1<<$p[0])][$ns], $dp[$bit][$s] + abs($p[1] - $con));\n }\n }\n }\n }\n $min = min($dp[(1<<$N)-1]);\n if($min == PHP_INT_MAX){\n return -1;\n }else{\n return $min;\n }\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have N cards numbered 1, 2, ..., N.\nCard i (1 \\leq i \\leq N) has an integer A_i written in red ink on one side and an integer B_i written in blue ink on the other side.\nInitially, these cards are arranged from left to right in the order from Card 1 to Card N, with the red numbers facing up.\n\nDetermine whether it is possible to have a non-decreasing sequence facing up from left to right (that is, for each i (1 \\leq i \\leq N - 1), the integer facing up on the (i+1)-th card from the left is not less than the integer facing up on the i-th card from the left) by repeating the operation below. If the answer is yes, find the minimum number of operations required to achieve it.\n\nChoose an integer i (1 \\leq i \\leq N - 1).\nSwap the i-th and (i+1)-th cards from the left, then flip these two cards.\n\nConstraints\n\n1 \\leq N \\leq 18\n\n1 \\leq A_i, B_i \\leq 50 (1 \\leq i \\leq N)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nIf it is impossible to have a non-decreasing sequence, print -1.\nIf it is possible, print the minimum number of operations required to achieve it.\n\nSample Input 1\n\n3\n3 4 3\n3 2 3\n\nSample Output 1\n\n1\n\nBy doing the operation once with i = 1, we have a sequence [2, 3, 3] facing up, which is non-decreasing.\n\nSample Input 2\n\n2\n2 1\n1 2\n\nSample Output 2\n\n-1\n\nAfter any number of operations, we have the sequence [2, 1] facing up, which is not non-decreasing.\n\nSample Input 3\n\n4\n1 2 3 4\n5 6 7 8\n\nSample Output 3\n\n0\n\nNo operation may be required.\n\nSample Input 4\n\n5\n28 15 22 43 31\n20 22 43 33 32\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n5\n4 46 6 38 43\n33 15 18 27 37\n\nSample Output 5\n\n3", "sample_input": "3\n3 4 3\n3 2 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02798", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have N cards numbered 1, 2, ..., N.\nCard i (1 \\leq i \\leq N) has an integer A_i written in red ink on one side and an integer B_i written in blue ink on the other side.\nInitially, these cards are arranged from left to right in the order from Card 1 to Card N, with the red numbers facing up.\n\nDetermine whether it is possible to have a non-decreasing sequence facing up from left to right (that is, for each i (1 \\leq i \\leq N - 1), the integer facing up on the (i+1)-th card from the left is not less than the integer facing up on the i-th card from the left) by repeating the operation below. If the answer is yes, find the minimum number of operations required to achieve it.\n\nChoose an integer i (1 \\leq i \\leq N - 1).\nSwap the i-th and (i+1)-th cards from the left, then flip these two cards.\n\nConstraints\n\n1 \\leq N \\leq 18\n\n1 \\leq A_i, B_i \\leq 50 (1 \\leq i \\leq N)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nIf it is impossible to have a non-decreasing sequence, print -1.\nIf it is possible, print the minimum number of operations required to achieve it.\n\nSample Input 1\n\n3\n3 4 3\n3 2 3\n\nSample Output 1\n\n1\n\nBy doing the operation once with i = 1, we have a sequence [2, 3, 3] facing up, which is non-decreasing.\n\nSample Input 2\n\n2\n2 1\n1 2\n\nSample Output 2\n\n-1\n\nAfter any number of operations, we have the sequence [2, 1] facing up, which is not non-decreasing.\n\nSample Input 3\n\n4\n1 2 3 4\n5 6 7 8\n\nSample Output 3\n\n0\n\nNo operation may be required.\n\nSample Input 4\n\n5\n28 15 22 43 31\n20 22 43 33 32\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n5\n4 46 6 38 43\n33 15 18 27 37\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1201, "cpu_time_ms": 2106, "memory_kb": 682488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s987008709", "group_id": "codeNet:p02798", "input_text": "= $s){\n $dp[$bit | (1<<$p[0])][$ns] = min($dp[$bit|(1<<$p[0])][$ns], $dp[$bit][$s] + abs($p[1] - $con));\n }\n }\n }\n }\n $min = min($dp[(1<<$N)-1]);\n if($min == PHP_INT_MAX){\n return -1;\n }else{\n return $min;\n }\n}", "language": "PHP", "metadata": {"date": 1579443290, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02798.html", "problem_id": "p02798", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02798/input.txt", "sample_output_relpath": "derived/input_output/data/p02798/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02798/PHP/s987008709.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s987008709", "user_id": "u248209126"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "= $s){\n $dp[$bit | (1<<$p[0])][$ns] = min($dp[$bit|(1<<$p[0])][$ns], $dp[$bit][$s] + abs($p[1] - $con));\n }\n }\n }\n }\n $min = min($dp[(1<<$N)-1]);\n if($min == PHP_INT_MAX){\n return -1;\n }else{\n return $min;\n }\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have N cards numbered 1, 2, ..., N.\nCard i (1 \\leq i \\leq N) has an integer A_i written in red ink on one side and an integer B_i written in blue ink on the other side.\nInitially, these cards are arranged from left to right in the order from Card 1 to Card N, with the red numbers facing up.\n\nDetermine whether it is possible to have a non-decreasing sequence facing up from left to right (that is, for each i (1 \\leq i \\leq N - 1), the integer facing up on the (i+1)-th card from the left is not less than the integer facing up on the i-th card from the left) by repeating the operation below. If the answer is yes, find the minimum number of operations required to achieve it.\n\nChoose an integer i (1 \\leq i \\leq N - 1).\nSwap the i-th and (i+1)-th cards from the left, then flip these two cards.\n\nConstraints\n\n1 \\leq N \\leq 18\n\n1 \\leq A_i, B_i \\leq 50 (1 \\leq i \\leq N)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nIf it is impossible to have a non-decreasing sequence, print -1.\nIf it is possible, print the minimum number of operations required to achieve it.\n\nSample Input 1\n\n3\n3 4 3\n3 2 3\n\nSample Output 1\n\n1\n\nBy doing the operation once with i = 1, we have a sequence [2, 3, 3] facing up, which is non-decreasing.\n\nSample Input 2\n\n2\n2 1\n1 2\n\nSample Output 2\n\n-1\n\nAfter any number of operations, we have the sequence [2, 1] facing up, which is not non-decreasing.\n\nSample Input 3\n\n4\n1 2 3 4\n5 6 7 8\n\nSample Output 3\n\n0\n\nNo operation may be required.\n\nSample Input 4\n\n5\n28 15 22 43 31\n20 22 43 33 32\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n5\n4 46 6 38 43\n33 15 18 27 37\n\nSample Output 5\n\n3", "sample_input": "3\n3 4 3\n3 2 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02798", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have N cards numbered 1, 2, ..., N.\nCard i (1 \\leq i \\leq N) has an integer A_i written in red ink on one side and an integer B_i written in blue ink on the other side.\nInitially, these cards are arranged from left to right in the order from Card 1 to Card N, with the red numbers facing up.\n\nDetermine whether it is possible to have a non-decreasing sequence facing up from left to right (that is, for each i (1 \\leq i \\leq N - 1), the integer facing up on the (i+1)-th card from the left is not less than the integer facing up on the i-th card from the left) by repeating the operation below. If the answer is yes, find the minimum number of operations required to achieve it.\n\nChoose an integer i (1 \\leq i \\leq N - 1).\nSwap the i-th and (i+1)-th cards from the left, then flip these two cards.\n\nConstraints\n\n1 \\leq N \\leq 18\n\n1 \\leq A_i, B_i \\leq 50 (1 \\leq i \\leq N)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nIf it is impossible to have a non-decreasing sequence, print -1.\nIf it is possible, print the minimum number of operations required to achieve it.\n\nSample Input 1\n\n3\n3 4 3\n3 2 3\n\nSample Output 1\n\n1\n\nBy doing the operation once with i = 1, we have a sequence [2, 3, 3] facing up, which is non-decreasing.\n\nSample Input 2\n\n2\n2 1\n1 2\n\nSample Output 2\n\n-1\n\nAfter any number of operations, we have the sequence [2, 1] facing up, which is not non-decreasing.\n\nSample Input 3\n\n4\n1 2 3 4\n5 6 7 8\n\nSample Output 3\n\n0\n\nNo operation may be required.\n\nSample Input 4\n\n5\n28 15 22 43 31\n20 22 43 33 32\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n5\n4 46 6 38 43\n33 15 18 27 37\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1209, "cpu_time_ms": 2105, "memory_kb": 682488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s099662749", "group_id": "codeNet:p02801", "input_text": "", "language": "PHP", "metadata": {"date": 1578859387, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02801.html", "problem_id": "p02801", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02801/input.txt", "sample_output_relpath": "derived/input_output/data/p02801/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02801/PHP/s099662749.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s099662749", "user_id": "u109193095"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order.\n\nConstraints\n\nC is a lowercase English letter that is not z.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nC\n\nOutput\n\nPrint the letter that follows C in alphabetical order.\n\nSample Input 1\n\na\n\nSample Output 1\n\nb\n\na is followed by b.\n\nSample Input 2\n\ny\n\nSample Output 2\n\nz\n\ny is followed by z.", "sample_input": "a\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02801", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order.\n\nConstraints\n\nC is a lowercase English letter that is not z.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nC\n\nOutput\n\nPrint the letter that follows C in alphabetical order.\n\nSample Input 1\n\na\n\nSample Output 1\n\nb\n\na is followed by b.\n\nSample Input 2\n\ny\n\nSample Output 2\n\nz\n\ny is followed by z.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 65, "cpu_time_ms": 11, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s254172116", "group_id": "codeNet:p02802", "input_text": " $i; $i++) {\n $inputs[] = explode(' ', trim(fgets(STDIN)));\n}\n\n#var_dump([$n, $m, $inputs]);\n\n$r = ['AC' => 0, 'WA' => 0];\n\n$tmp = [];\nforeach ($inputs as $input) {\n $qid = $input[0];\n $ans = $input[1];\n\n if (!isset($tmp[$qid])) {\n $tmp[$qid] = ['AC' => 0, 'WA' => 0];\n }\n\n if ($tmp[$qid]['AC'] >= 1) {\n continue;\n }\n\n $tmp[$qid][$ans]++;\n}\n\nforeach ($tmp as $x) {\n if ($x['AC'] > 0) {\n $r['AC'] += $x['AC'];\n $r['WA'] += $x['WA'];\n }\n}\n\n\necho $r['AC'] . \" \" . $r['WA'];\n", "language": "PHP", "metadata": {"date": 1582691979, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02802.html", "problem_id": "p02802", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02802/input.txt", "sample_output_relpath": "derived/input_output/data/p02802/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02802/PHP/s254172116.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s254172116", "user_id": "u024780318"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": " $i; $i++) {\n $inputs[] = explode(' ', trim(fgets(STDIN)));\n}\n\n#var_dump([$n, $m, $inputs]);\n\n$r = ['AC' => 0, 'WA' => 0];\n\n$tmp = [];\nforeach ($inputs as $input) {\n $qid = $input[0];\n $ans = $input[1];\n\n if (!isset($tmp[$qid])) {\n $tmp[$qid] = ['AC' => 0, 'WA' => 0];\n }\n\n if ($tmp[$qid]['AC'] >= 1) {\n continue;\n }\n\n $tmp[$qid][$ans]++;\n}\n\nforeach ($tmp as $x) {\n if ($x['AC'] > 0) {\n $r['AC'] += $x['AC'];\n $r['WA'] += $x['WA'];\n }\n}\n\n\necho $r['AC'] . \" \" . $r['WA'];\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 599, "cpu_time_ms": 122, "memory_kb": 93044}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s641962542", "group_id": "codeNet:p02802", "input_text": " $n) {\n continue;\n }\n\n if (!isset($result[$ex['num']])) {\n $result[$ex['num']] = true;\n }\n\n if ($result[$ex['num']]) {\n if ($ex['result'] === 'WA') {\n $wa++;\n } elseif ($ex['result'] === 'AC') {\n $result[$ex['num']] = false;\n $ac++;\n }\n }\n}\n\necho $ac . ' ' . $wa;\n", "language": "PHP", "metadata": {"date": 1578884862, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02802.html", "problem_id": "p02802", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02802/input.txt", "sample_output_relpath": "derived/input_output/data/p02802/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02802/PHP/s195135394.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s195135394", "user_id": "u080556513"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": " $n) {\n continue;\n }\n\n if (!isset($result[$ex['num']])) {\n $result[$ex['num']] = true;\n }\n\n if ($result[$ex['num']]) {\n if ($ex['result'] === 'WA') {\n $wa++;\n } elseif ($ex['result'] === 'AC') {\n $result[$ex['num']] = false;\n $ac++;\n }\n }\n}\n\necho $ac . ' ' . $wa;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 516, "cpu_time_ms": 88, "memory_kb": 13048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s684146126", "group_id": "codeNet:p02802", "input_text": "\n", "language": "PHP", "metadata": {"date": 1578882682, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02802.html", "problem_id": "p02802", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02802/input.txt", "sample_output_relpath": "derived/input_output/data/p02802/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02802/PHP/s684146126.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s684146126", "user_id": "u109193095"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 300, "cpu_time_ms": 1622, "memory_kb": 29428}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s055383100", "group_id": "codeNet:p02805", "input_text": " $r_diff) {\n $radius = ($upper_r + $lower_r) / 2;\n $intersections = getIntersections($points, $radius);\n $filtered_intersections = filterIntersection($intersections, $points, $radius);\n if (empty($filtered_intersections)) {\n $lower_r = $radius;\n } else {\n $upper_r = $radius;\n }\n}\n\necho $radius;\n\nfunction getIntersections(array $points, float $radius): array\n{\n $point_num = count($points);\n $intersections = [];\n for ($i = 0; $i < $point_num; ++$i) {\n for ($j = $i + 1; $j < $point_num; ++$j) {\n $x_diff = $points[$i][0] - $points[$j][0];\n $y_diff = $points[$i][1] - $points[$j][1];\n $distance = sqrt($x_diff ** 2 + $y_diff ** 2);\n if ($distance > ($radius + COMPUTATIONAL_ERROR) * 2) {\n continue;\n }\n\n $median = [($points[$i][0] + $points[$j][0]) / 2, ($points[$i][1] + $points[$j][1]) / 2];\n $h = sqrt($radius ** 2 - ($distance / 2) ** 2);\n if ($x_diff * $y_diff > 0) {\n $intersections[] = [$median[0] - $h * $y_diff / $distance, $median[1] + $h * $x_diff / $distance];\n $intersections[] = [$median[0] + $h * $y_diff / $distance, $median[1] - $h * $x_diff / $distance];\n } else {\n $intersections[] = [$median[0] - $h * $y_diff / $distance, $median[1] - $h * $x_diff / $distance];\n $intersections[] = [$median[0] + $h * $y_diff / $distance, $median[1] + $h * $x_diff / $distance];\n }\n }\n }\n\n return $intersections;\n}\n\nfunction filterIntersection(array $intersections, array $points, float $radius): array\n{\n return array_filter($intersections, function ($intersection) use ($points, $radius) {\n foreach ($points as $point) {\n $distance = sqrt(($intersection[0] - $point[0]) ** 2 + ($intersection[1] - $point[1]) ** 2);\n if ($distance > $radius + COMPUTATIONAL_ERROR) {\n return false;\n }\n }\n\n return true;\n });\n}\n", "language": "PHP", "metadata": {"date": 1590971604, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02805.html", "problem_id": "p02805", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02805/input.txt", "sample_output_relpath": "derived/input_output/data/p02805/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02805/PHP/s055383100.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s055383100", "user_id": "u917829175"}, "prompt_components": {"gold_output": "0.500000000000000000\n", "input_to_evaluate": " $r_diff) {\n $radius = ($upper_r + $lower_r) / 2;\n $intersections = getIntersections($points, $radius);\n $filtered_intersections = filterIntersection($intersections, $points, $radius);\n if (empty($filtered_intersections)) {\n $lower_r = $radius;\n } else {\n $upper_r = $radius;\n }\n}\n\necho $radius;\n\nfunction getIntersections(array $points, float $radius): array\n{\n $point_num = count($points);\n $intersections = [];\n for ($i = 0; $i < $point_num; ++$i) {\n for ($j = $i + 1; $j < $point_num; ++$j) {\n $x_diff = $points[$i][0] - $points[$j][0];\n $y_diff = $points[$i][1] - $points[$j][1];\n $distance = sqrt($x_diff ** 2 + $y_diff ** 2);\n if ($distance > ($radius + COMPUTATIONAL_ERROR) * 2) {\n continue;\n }\n\n $median = [($points[$i][0] + $points[$j][0]) / 2, ($points[$i][1] + $points[$j][1]) / 2];\n $h = sqrt($radius ** 2 - ($distance / 2) ** 2);\n if ($x_diff * $y_diff > 0) {\n $intersections[] = [$median[0] - $h * $y_diff / $distance, $median[1] + $h * $x_diff / $distance];\n $intersections[] = [$median[0] + $h * $y_diff / $distance, $median[1] - $h * $x_diff / $distance];\n } else {\n $intersections[] = [$median[0] - $h * $y_diff / $distance, $median[1] - $h * $x_diff / $distance];\n $intersections[] = [$median[0] + $h * $y_diff / $distance, $median[1] + $h * $x_diff / $distance];\n }\n }\n }\n\n return $intersections;\n}\n\nfunction filterIntersection(array $intersections, array $points, float $radius): array\n{\n return array_filter($intersections, function ($intersection) use ($points, $radius) {\n foreach ($points as $point) {\n $distance = sqrt(($intersection[0] - $point[0]) ** 2 + ($intersection[1] - $point[1]) ** 2);\n if ($distance > $radius + COMPUTATIONAL_ERROR) {\n return false;\n }\n }\n\n return true;\n });\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are N points (x_i, y_i) in a two-dimensional plane.\n\nFind the minimum radius of a circle such that all the points are inside or on it.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n0 \\leq x_i \\leq 1000\n\n0 \\leq y_i \\leq 1000\n\nThe given N points are all different.\n\nThe values in input are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum radius of a circle such that all the N points are inside or on it.\n\nYour output will be considered correct if the absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n2\n0 0\n1 0\n\nSample Output 1\n\n0.500000000000000000\n\nBoth points are contained in the circle centered at (0.5,0) with a radius of 0.5.\n\nSample Input 2\n\n3\n0 0\n0 1\n1 0\n\nSample Output 2\n\n0.707106781186497524\n\nSample Input 3\n\n10\n10 9\n5 9\n2 0\n0 0\n2 7\n3 3\n2 5\n10 0\n3 7\n1 9\n\nSample Output 3\n\n6.726812023536805158\n\nIf the absolute or relative error from our answer is at most 10^{-6}, the output will be considered correct.", "sample_input": "2\n0 0\n1 0\n"}, "reference_outputs": ["0.500000000000000000\n"], "source_document_id": "p02805", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are N points (x_i, y_i) in a two-dimensional plane.\n\nFind the minimum radius of a circle such that all the points are inside or on it.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n0 \\leq x_i \\leq 1000\n\n0 \\leq y_i \\leq 1000\n\nThe given N points are all different.\n\nThe values in input are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum radius of a circle such that all the N points are inside or on it.\n\nYour output will be considered correct if the absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n2\n0 0\n1 0\n\nSample Output 1\n\n0.500000000000000000\n\nBoth points are contained in the circle centered at (0.5,0) with a radius of 0.5.\n\nSample Input 2\n\n3\n0 0\n0 1\n1 0\n\nSample Output 2\n\n0.707106781186497524\n\nSample Input 3\n\n10\n10 9\n5 9\n2 0\n0 0\n2 7\n3 3\n2 5\n10 0\n3 7\n1 9\n\nSample Output 3\n\n6.726812023536805158\n\nIf the absolute or relative error from our answer is at most 10^{-6}, the output will be considered correct.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2425, "cpu_time_ms": 149, "memory_kb": 6776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s796529624", "group_id": "codeNet:p02811", "input_text": "= $x ? 'Yes' : 'No';\n", "language": "PHP", "metadata": {"date": 1584740750, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02811.html", "problem_id": "p02811", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02811/input.txt", "sample_output_relpath": "derived/input_output/data/p02811/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02811/PHP/s796529624.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s796529624", "user_id": "u376366206"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "= $x ? 'Yes' : 'No';\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has K 500-yen coins. (Yen is the currency of Japan.)\nIf these coins add up to X yen or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n1 \\leq X \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nIf the coins add up to X yen or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 900\n\nSample Output 1\n\nYes\n\nTwo 500-yen coins add up to 1000 yen, which is not less than X = 900 yen.\n\nSample Input 2\n\n1 501\n\nSample Output 2\n\nNo\n\nOne 500-yen coin is worth 500 yen, which is less than X = 501 yen.\n\nSample Input 3\n\n4 2000\n\nSample Output 3\n\nYes\n\nFour 500-yen coins add up to 2000 yen, which is not less than X = 2000 yen.", "sample_input": "2 900\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02811", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has K 500-yen coins. (Yen is the currency of Japan.)\nIf these coins add up to X yen or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n1 \\leq X \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nIf the coins add up to X yen or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 900\n\nSample Output 1\n\nYes\n\nTwo 500-yen coins add up to 1000 yen, which is not less than X = 900 yen.\n\nSample Input 2\n\n1 501\n\nSample Output 2\n\nNo\n\nOne 500-yen coin is worth 500 yen, which is less than X = 501 yen.\n\nSample Input 3\n\n4 2000\n\nSample Output 3\n\nYes\n\nFour 500-yen coins add up to 2000 yen, which is not less than X = 2000 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 76, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s123265346", "group_id": "codeNet:p02811", "input_text": "= $x){\n echo 'Yes'.\"\\m\";\n}else{\n echo 'No'.\"\\m\";\n}", "language": "PHP", "metadata": {"date": 1578933599, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02811.html", "problem_id": "p02811", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02811/input.txt", "sample_output_relpath": "derived/input_output/data/p02811/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02811/PHP/s123265346.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s123265346", "user_id": "u723414064"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "= $x){\n echo 'Yes'.\"\\m\";\n}else{\n echo 'No'.\"\\m\";\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has K 500-yen coins. (Yen is the currency of Japan.)\nIf these coins add up to X yen or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n1 \\leq X \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nIf the coins add up to X yen or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 900\n\nSample Output 1\n\nYes\n\nTwo 500-yen coins add up to 1000 yen, which is not less than X = 900 yen.\n\nSample Input 2\n\n1 501\n\nSample Output 2\n\nNo\n\nOne 500-yen coin is worth 500 yen, which is less than X = 501 yen.\n\nSample Input 3\n\n4 2000\n\nSample Output 3\n\nYes\n\nFour 500-yen coins add up to 2000 yen, which is not less than X = 2000 yen.", "sample_input": "2 900\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02811", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has K 500-yen coins. (Yen is the currency of Japan.)\nIf these coins add up to X yen or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n1 \\leq X \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nIf the coins add up to X yen or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 900\n\nSample Output 1\n\nYes\n\nTwo 500-yen coins add up to 1000 yen, which is not less than X = 900 yen.\n\nSample Input 2\n\n1 501\n\nSample Output 2\n\nNo\n\nOne 500-yen coin is worth 500 yen, which is less than X = 501 yen.\n\nSample Input 3\n\n4 2000\n\nSample Output 3\n\nYes\n\nFour 500-yen coins add up to 2000 yen, which is not less than X = 2000 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 142, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s131402641", "group_id": "codeNet:p02811", "input_text": "= $x) ? \"Yes\" : \"No\";\necho \"¥n\";", "language": "PHP", "metadata": {"date": 1578716049, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02811.html", "problem_id": "p02811", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02811/input.txt", "sample_output_relpath": "derived/input_output/data/p02811/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02811/PHP/s131402641.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s131402641", "user_id": "u711675444"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "= $x) ? \"Yes\" : \"No\";\necho \"¥n\";", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has K 500-yen coins. (Yen is the currency of Japan.)\nIf these coins add up to X yen or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n1 \\leq X \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nIf the coins add up to X yen or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 900\n\nSample Output 1\n\nYes\n\nTwo 500-yen coins add up to 1000 yen, which is not less than X = 900 yen.\n\nSample Input 2\n\n1 501\n\nSample Output 2\n\nNo\n\nOne 500-yen coin is worth 500 yen, which is less than X = 501 yen.\n\nSample Input 3\n\n4 2000\n\nSample Output 3\n\nYes\n\nFour 500-yen coins add up to 2000 yen, which is not less than X = 2000 yen.", "sample_input": "2 900\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02811", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has K 500-yen coins. (Yen is the currency of Japan.)\nIf these coins add up to X yen or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n1 \\leq X \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nIf the coins add up to X yen or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 900\n\nSample Output 1\n\nYes\n\nTwo 500-yen coins add up to 1000 yen, which is not less than X = 900 yen.\n\nSample Input 2\n\n1 501\n\nSample Output 2\n\nNo\n\nOne 500-yen coin is worth 500 yen, which is less than X = 501 yen.\n\nSample Input 3\n\n4 2000\n\nSample Output 3\n\nYes\n\nFour 500-yen coins add up to 2000 yen, which is not less than X = 2000 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 93, "cpu_time_ms": 11, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s436896686", "group_id": "codeNet:p02812", "input_text": "", "language": "PHP", "metadata": {"date": 1585614579, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02812.html", "problem_id": "p02812", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02812/input.txt", "sample_output_relpath": "derived/input_output/data/p02812/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02812/PHP/s122392923.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s122392923", "user_id": "u789760907"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "sample_input": "10\nZABCDBABCQ\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02812", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 200, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s686229625", "group_id": "codeNet:p02812", "input_text": "", "language": "PHP", "metadata": {"date": 1578709694, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02812.html", "problem_id": "p02812", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02812/input.txt", "sample_output_relpath": "derived/input_output/data/p02812/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02812/PHP/s153155540.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s153155540", "user_id": "u295797489"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "sample_input": "10\nZABCDBABCQ\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02812", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 111, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s054214894", "group_id": "codeNet:p02812", "input_text": " $m) list($m, $n) = [$n, $m];\n return ($m % $n === 0) ? $n : gcd($n, $m % $n);\n}\n\n// 最小公倍数(2つ)\nfunction lcm($m, $n)\n{\n return $m * $n / gcd($m, $n);\n}", "language": "PHP", "metadata": {"date": 1584487780, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02814.html", "problem_id": "p02814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02814/input.txt", "sample_output_relpath": "derived/input_output/data/p02814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02814/PHP/s780260340.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s780260340", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $m) list($m, $n) = [$n, $m];\n return ($m % $n === 0) ? $n : gcd($n, $m % $n);\n}\n\n// 最小公倍数(2つ)\nfunction lcm($m, $n)\n{\n return $m * $n / gcd($m, $n);\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "sample_input": "2 50\n6 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02814", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 549, "cpu_time_ms": 2111, "memory_kb": 16884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s916020857", "group_id": "codeNet:p02814", "input_text": " $dummy)$a[$i] /= 2;\n$lcm = lcmAll($a);\nif($lcm > $m){\n echo 0;\n}else{\n echo intdiv($m, $lcm)-intdiv($m, $lcm*2);\n}\n\n//最大公約数\nfunction gcd($m, $n){\n if(!$n)return $m;\n return gcd($n, $m % $n);\n}\n//配列の最小公倍数\nfunction lcmAll($array){\n $lcm = $array[0];\n for($i = 1; $i < count($array); $i++){\n $lcm = lcm($lcm, $array[$i]);\n }\n $lcm = min($lcm, 10**10);\n return $lcm;\n}\n//最小公倍数\nfunction lcm($a, $b) {\n return $a / gcd($a, $b) * $b;\n}\n", "language": "PHP", "metadata": {"date": 1578780746, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02814.html", "problem_id": "p02814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02814/input.txt", "sample_output_relpath": "derived/input_output/data/p02814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02814/PHP/s916020857.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s916020857", "user_id": "u248209126"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $dummy)$a[$i] /= 2;\n$lcm = lcmAll($a);\nif($lcm > $m){\n echo 0;\n}else{\n echo intdiv($m, $lcm)-intdiv($m, $lcm*2);\n}\n\n//最大公約数\nfunction gcd($m, $n){\n if(!$n)return $m;\n return gcd($n, $m % $n);\n}\n//配列の最小公倍数\nfunction lcmAll($array){\n $lcm = $array[0];\n for($i = 1; $i < count($array); $i++){\n $lcm = lcm($lcm, $array[$i]);\n }\n $lcm = min($lcm, 10**10);\n return $lcm;\n}\n//最小公倍数\nfunction lcm($a, $b) {\n return $a / gcd($a, $b) * $b;\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "sample_input": "2 50\n6 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02814", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 619, "cpu_time_ms": 61, "memory_kb": 16884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s141499781", "group_id": "codeNet:p02818", "input_text": " 'p',\n 's' => 'r',\n 'p' => 's',\n ];\n $p_table = [\n 'r' => $r,\n 's' => $s,\n 'p' => $p,\n ];\n$total = 0;\n$before = '';\n$history = '';\nfor ($i = 0; $i <$n; $i++) {\n $now = substr($t, $i, 1);\n if ($k <= $i) {\n $before = substr($history, ($i-$k), 1);\n }\n $win = $w_table[$now];\n if ($win !== $before) {\n $total += $p_table[$win];\n $history .= $win;\n } else {\n $history .= $now;\n }\n}\necho $total . PHP_EOL;", "language": "PHP", "metadata": {"date": 1587769992, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02820.html", "problem_id": "p02820", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02820/input.txt", "sample_output_relpath": "derived/input_output/data/p02820/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02820/PHP/s109988958.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s109988958", "user_id": "u708871440"}, "prompt_components": {"gold_output": "27\n", "input_to_evaluate": " 'p',\n 's' => 'r',\n 'p' => 's',\n ];\n $p_table = [\n 'r' => $r,\n 's' => $s,\n 'p' => $p,\n ];\n$total = 0;\n$before = '';\n$history = '';\nfor ($i = 0; $i <$n; $i++) {\n $now = substr($t, $i, 1);\n if ($k <= $i) {\n $before = substr($history, ($i-$k), 1);\n }\n $win = $w_table[$now];\n if ($win !== $before) {\n $total += $p_table[$win];\n $history .= $win;\n } else {\n $history .= $now;\n }\n}\necho $total . PHP_EOL;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAt an arcade, Takahashi is playing a game called RPS Battle, which is played as follows:\n\nThe player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a round.)\n\nEach time the player wins a round, depending on which hand he/she uses, he/she earns the following score (no points for a draw or a loss):\n\nR points for winning with Rock;\n\nS points for winning with Scissors;\n\nP points for winning with Paper.\n\nHowever, in the i-th round, the player cannot use the hand he/she used in the (i-K)-th round. (In the first K rounds, the player can use any hand.)\n\nBefore the start of the game, the machine decides the hand it will play in each round. With supernatural power, Takahashi managed to read all of those hands.\n\nThe information Takahashi obtained is given as a string T. If the i-th character of T (1 \\leq i \\leq N) is r, the machine will play Rock in the i-th round. Similarly, p and s stand for Paper and Scissors, respectively.\n\nWhat is the maximum total score earned in the game by adequately choosing the hand to play in each round?\n\nNotes\n\nIn this problem, Rock Paper Scissors can be thought of as a two-player game, in which each player simultaneously forms Rock, Paper, or Scissors with a hand.\n\nIf a player chooses Rock and the other chooses Scissors, the player choosing Rock wins;\n\nif a player chooses Scissors and the other chooses Paper, the player choosing Scissors wins;\n\nif a player chooses Paper and the other chooses Rock, the player choosing Paper wins;\n\nif both players play the same hand, it is a draw.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N-1\n\n1 \\leq R,S,P \\leq 10^4\n\nN,K,R,S, and P are all integers.\n\n|T| = N\n\nT consists of r, p, and s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nR S P\nT\n\nOutput\n\nPrint the maximum total score earned in the game.\n\nSample Input 1\n\n5 2\n8 7 6\nrsrpr\n\nSample Output 1\n\n27\n\nThe machine will play {Rock, Scissors, Rock, Paper, Rock}.\n\nWe can, for example, play {Paper, Rock, Rock, Scissors, Paper} against it to earn 27 points.\nWe cannot earn more points, so the answer is 27.\n\nSample Input 2\n\n7 1\n100 10 1\nssssppr\n\nSample Output 2\n\n211\n\nSample Input 3\n\n30 5\n325 234 123\nrspsspspsrpspsppprpsprpssprpsr\n\nSample Output 3\n\n4996", "sample_input": "5 2\n8 7 6\nrsrpr\n"}, "reference_outputs": ["27\n"], "source_document_id": "p02820", "source_text": "Score : 400 points\n\nProblem Statement\n\nAt an arcade, Takahashi is playing a game called RPS Battle, which is played as follows:\n\nThe player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a round.)\n\nEach time the player wins a round, depending on which hand he/she uses, he/she earns the following score (no points for a draw or a loss):\n\nR points for winning with Rock;\n\nS points for winning with Scissors;\n\nP points for winning with Paper.\n\nHowever, in the i-th round, the player cannot use the hand he/she used in the (i-K)-th round. (In the first K rounds, the player can use any hand.)\n\nBefore the start of the game, the machine decides the hand it will play in each round. With supernatural power, Takahashi managed to read all of those hands.\n\nThe information Takahashi obtained is given as a string T. If the i-th character of T (1 \\leq i \\leq N) is r, the machine will play Rock in the i-th round. Similarly, p and s stand for Paper and Scissors, respectively.\n\nWhat is the maximum total score earned in the game by adequately choosing the hand to play in each round?\n\nNotes\n\nIn this problem, Rock Paper Scissors can be thought of as a two-player game, in which each player simultaneously forms Rock, Paper, or Scissors with a hand.\n\nIf a player chooses Rock and the other chooses Scissors, the player choosing Rock wins;\n\nif a player chooses Scissors and the other chooses Paper, the player choosing Scissors wins;\n\nif a player chooses Paper and the other chooses Rock, the player choosing Paper wins;\n\nif both players play the same hand, it is a draw.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N-1\n\n1 \\leq R,S,P \\leq 10^4\n\nN,K,R,S, and P are all integers.\n\n|T| = N\n\nT consists of r, p, and s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nR S P\nT\n\nOutput\n\nPrint the maximum total score earned in the game.\n\nSample Input 1\n\n5 2\n8 7 6\nrsrpr\n\nSample Output 1\n\n27\n\nThe machine will play {Rock, Scissors, Rock, Paper, Rock}.\n\nWe can, for example, play {Paper, Rock, Rock, Scissors, Paper} against it to earn 27 points.\nWe cannot earn more points, so the answer is 27.\n\nSample Input 2\n\n7 1\n100 10 1\nssssppr\n\nSample Output 2\n\n211\n\nSample Input 3\n\n30 5\n325 234 123\nrspsspspsrpspsppprpsprpssprpsr\n\nSample Output 3\n\n4996", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 605, "cpu_time_ms": 58, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s741126531", "group_id": "codeNet:p02820", "input_text": " $p,\n\t\"s\" => $r,\n\t\"p\" => $s,\n];\n\n$sum = 0;\n\nfor ($i=0; $i < $k; $i++) { \n\t$dup = false;\n\tfor ($j=$i; $j < $n; $j+=$k) { \n\t\tif ($j == $i) {\n\t\t\t$sum += $counter[$t[$j]];\n\t\t}else{\n\t\t\tif ($prev != $t[$j] || $dup == true) {\n\t\t\t\t$sum += $counter[$t[$j]];\n\t\t\t\t$dup = false;\n\t\t\t}else{\n\t\t\t\t$dup = true;\n\t\t\t}\n\t\t}\n\t\t// echo $j . \": \" . $t[$j] . PHP_EOL;\n\t\t// echo $sum . PHP_EOL;\n\t\t$prev = $t[$j];\n\t}\n}\necho $sum;", "language": "PHP", "metadata": {"date": 1577669389, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02820.html", "problem_id": "p02820", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02820/input.txt", "sample_output_relpath": "derived/input_output/data/p02820/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02820/PHP/s741126531.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s741126531", "user_id": "u699888017"}, "prompt_components": {"gold_output": "27\n", "input_to_evaluate": " $p,\n\t\"s\" => $r,\n\t\"p\" => $s,\n];\n\n$sum = 0;\n\nfor ($i=0; $i < $k; $i++) { \n\t$dup = false;\n\tfor ($j=$i; $j < $n; $j+=$k) { \n\t\tif ($j == $i) {\n\t\t\t$sum += $counter[$t[$j]];\n\t\t}else{\n\t\t\tif ($prev != $t[$j] || $dup == true) {\n\t\t\t\t$sum += $counter[$t[$j]];\n\t\t\t\t$dup = false;\n\t\t\t}else{\n\t\t\t\t$dup = true;\n\t\t\t}\n\t\t}\n\t\t// echo $j . \": \" . $t[$j] . PHP_EOL;\n\t\t// echo $sum . PHP_EOL;\n\t\t$prev = $t[$j];\n\t}\n}\necho $sum;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAt an arcade, Takahashi is playing a game called RPS Battle, which is played as follows:\n\nThe player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a round.)\n\nEach time the player wins a round, depending on which hand he/she uses, he/she earns the following score (no points for a draw or a loss):\n\nR points for winning with Rock;\n\nS points for winning with Scissors;\n\nP points for winning with Paper.\n\nHowever, in the i-th round, the player cannot use the hand he/she used in the (i-K)-th round. (In the first K rounds, the player can use any hand.)\n\nBefore the start of the game, the machine decides the hand it will play in each round. With supernatural power, Takahashi managed to read all of those hands.\n\nThe information Takahashi obtained is given as a string T. If the i-th character of T (1 \\leq i \\leq N) is r, the machine will play Rock in the i-th round. Similarly, p and s stand for Paper and Scissors, respectively.\n\nWhat is the maximum total score earned in the game by adequately choosing the hand to play in each round?\n\nNotes\n\nIn this problem, Rock Paper Scissors can be thought of as a two-player game, in which each player simultaneously forms Rock, Paper, or Scissors with a hand.\n\nIf a player chooses Rock and the other chooses Scissors, the player choosing Rock wins;\n\nif a player chooses Scissors and the other chooses Paper, the player choosing Scissors wins;\n\nif a player chooses Paper and the other chooses Rock, the player choosing Paper wins;\n\nif both players play the same hand, it is a draw.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N-1\n\n1 \\leq R,S,P \\leq 10^4\n\nN,K,R,S, and P are all integers.\n\n|T| = N\n\nT consists of r, p, and s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nR S P\nT\n\nOutput\n\nPrint the maximum total score earned in the game.\n\nSample Input 1\n\n5 2\n8 7 6\nrsrpr\n\nSample Output 1\n\n27\n\nThe machine will play {Rock, Scissors, Rock, Paper, Rock}.\n\nWe can, for example, play {Paper, Rock, Rock, Scissors, Paper} against it to earn 27 points.\nWe cannot earn more points, so the answer is 27.\n\nSample Input 2\n\n7 1\n100 10 1\nssssppr\n\nSample Output 2\n\n211\n\nSample Input 3\n\n30 5\n325 234 123\nrspsspspsrpspsppprpsprpssprpsr\n\nSample Output 3\n\n4996", "sample_input": "5 2\n8 7 6\nrsrpr\n"}, "reference_outputs": ["27\n"], "source_document_id": "p02820", "source_text": "Score : 400 points\n\nProblem Statement\n\nAt an arcade, Takahashi is playing a game called RPS Battle, which is played as follows:\n\nThe player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a round.)\n\nEach time the player wins a round, depending on which hand he/she uses, he/she earns the following score (no points for a draw or a loss):\n\nR points for winning with Rock;\n\nS points for winning with Scissors;\n\nP points for winning with Paper.\n\nHowever, in the i-th round, the player cannot use the hand he/she used in the (i-K)-th round. (In the first K rounds, the player can use any hand.)\n\nBefore the start of the game, the machine decides the hand it will play in each round. With supernatural power, Takahashi managed to read all of those hands.\n\nThe information Takahashi obtained is given as a string T. If the i-th character of T (1 \\leq i \\leq N) is r, the machine will play Rock in the i-th round. Similarly, p and s stand for Paper and Scissors, respectively.\n\nWhat is the maximum total score earned in the game by adequately choosing the hand to play in each round?\n\nNotes\n\nIn this problem, Rock Paper Scissors can be thought of as a two-player game, in which each player simultaneously forms Rock, Paper, or Scissors with a hand.\n\nIf a player chooses Rock and the other chooses Scissors, the player choosing Rock wins;\n\nif a player chooses Scissors and the other chooses Paper, the player choosing Scissors wins;\n\nif a player chooses Paper and the other chooses Rock, the player choosing Paper wins;\n\nif both players play the same hand, it is a draw.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N-1\n\n1 \\leq R,S,P \\leq 10^4\n\nN,K,R,S, and P are all integers.\n\n|T| = N\n\nT consists of r, p, and s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nR S P\nT\n\nOutput\n\nPrint the maximum total score earned in the game.\n\nSample Input 1\n\n5 2\n8 7 6\nrsrpr\n\nSample Output 1\n\n27\n\nThe machine will play {Rock, Scissors, Rock, Paper, Rock}.\n\nWe can, for example, play {Paper, Rock, Rock, Scissors, Paper} against it to earn 27 points.\nWe cannot earn more points, so the answer is 27.\n\nSample Input 2\n\n7 1\n100 10 1\nssssppr\n\nSample Output 2\n\n211\n\nSample Input 3\n\n30 5\n325 234 123\nrspsspspsrpspsppprpsprpssprpsr\n\nSample Output 3\n\n4996", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 647, "cpu_time_ms": 25, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s088710154", "group_id": "codeNet:p02821", "input_text": " ($B - 1)) {\n $countor = ($B - 1);\n } else {\n $countor = ($N - $A);\n }\n} elseif ($A > $B) {\n if (($A - $B) % 2 == 0) {\n $countor = ($A - $B) / 2;\n } elseif (($N - $B) > ($A - 1)) {\n $countor = ($A - 1);\n } else {\n $countor = ($N - $B);\n }\n}\nprint_r ($countor.\"\\n\");\n?>", "language": "PHP", "metadata": {"date": 1590261483, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02823.html", "problem_id": "p02823", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02823/input.txt", "sample_output_relpath": "derived/input_output/data/p02823/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02823/PHP/s888345530.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s888345530", "user_id": "u682374853"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " ($B - 1)) {\n $countor = ($B - 1);\n } else {\n $countor = ($N - $A);\n }\n} elseif ($A > $B) {\n if (($A - $B) % 2 == 0) {\n $countor = ($A - $B) / 2;\n } elseif (($N - $B) > ($A - 1)) {\n $countor = ($A - 1);\n } else {\n $countor = ($N - $B);\n }\n}\nprint_r ($countor.\"\\n\");\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "sample_input": "5 2 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02823", "source_text": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 444, "cpu_time_ms": 11, "memory_kb": 4984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s491086850", "group_id": "codeNet:p02823", "input_text": " 1? $s = ($b - $f)/2 : $s = 0;\n } else {\n $f = $n-$b + 1;\n $n - ($a+$f) > 1? $s = ($n - ($a+$f))/2 : $s = 0;\n }\n $ans = $f+$s;\n}\n\necho $ans;\n \n?>", "language": "PHP", "metadata": {"date": 1577586414, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02823.html", "problem_id": "p02823", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02823/input.txt", "sample_output_relpath": "derived/input_output/data/p02823/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02823/PHP/s491086850.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s491086850", "user_id": "u397596606"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " 1? $s = ($b - $f)/2 : $s = 0;\n } else {\n $f = $n-$b + 1;\n $n - ($a+$f) > 1? $s = ($n - ($a+$f))/2 : $s = 0;\n }\n $ans = $f+$s;\n}\n\necho $ans;\n \n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "sample_input": "5 2 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02823", "source_text": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 317, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s330705838", "group_id": "codeNet:p02830", "input_text": "", "language": "PHP", "metadata": {"date": 1579756463, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02830.html", "problem_id": "p02830", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02830/input.txt", "sample_output_relpath": "derived/input_output/data/p02830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02830/PHP/s330705838.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s330705838", "user_id": "u415671616"}, "prompt_components": {"gold_output": "icpc\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "sample_input": "2\nip cc\n"}, "reference_outputs": ["icpc\n"], "source_document_id": "p02830", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 128, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s765820245", "group_id": "codeNet:p02830", "input_text": " -1 ? $cnt - $answer - 1 : -1) . \"\\n\";", "language": "PHP", "metadata": {"date": 1577757293, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02832.html", "problem_id": "p02832", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02832/input.txt", "sample_output_relpath": "derived/input_output/data/p02832/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02832/PHP/s501435257.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s501435257", "user_id": "u430474060"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " -1 ? $cnt - $answer - 1 : -1) . \"\\n\";", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "sample_input": "3\n2 1 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02832", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 2104, "memory_kb": 27120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s064692294", "group_id": "codeNet:p02833", "input_text": "", "language": "PHP", "metadata": {"date": 1578236828, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02835/input.txt", "sample_output_relpath": "derived/input_output/data/p02835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02835/PHP/s130191463.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s130191463", "user_id": "u032484360"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "sample_input": "5 7 9\n"}, "reference_outputs": ["win\n"], "source_document_id": "p02835", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 124, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s811058763", "group_id": "codeNet:p02835", "input_text": "= 22){\necho 'bust';\n}elseif($ans <= 21){\necho 'win';\n}\n?>", "language": "PHP", "metadata": {"date": 1576909069, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02835/input.txt", "sample_output_relpath": "derived/input_output/data/p02835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02835/PHP/s811058763.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s811058763", "user_id": "u384702073"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "= 22){\necho 'bust';\n}elseif($ans <= 21){\necho 'win';\n}\n?>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "sample_input": "5 7 9\n"}, "reference_outputs": ["win\n"], "source_document_id": "p02835", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 164, "cpu_time_ms": 12, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s312427625", "group_id": "codeNet:p02836", "input_text": " $val) {\n $arr3[] = $val;\n }\n $cnt = 0;\n for ($i=0;$i $val) {\n $arr3[] = $val;\n }\n $cnt = 0;\n for ($i=0;$i=0; $i--){\n \n $p = str_pad(decbin($i), $n, 0, STR_PAD_LEFT);\n \n $pt = array_count_values(str_split($p));\n isset($pt[1])? $pc = $pt[1] : $pc = 0;\n \n $hc = 0;\n for($j=1; $j<=$n; $j++){ \n $jj = $j-1;\n if ($p[$jj] == 1){ \n $tc = 0; \n foreach($t[$j] as $k=>$v){\n $vp = $v[0]-1;\n $vv = $v[1]; \n if ($p[$vp] == $vv) $tc++; \n } \n if ($tc == count($t[$j])) $hc++; \n } \n }\n \n if ($hc == $pc) break;\n \n}\n\necho $hc;\n\n?>", "language": "PHP", "metadata": {"date": 1577569346, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02837.html", "problem_id": "p02837", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02837/input.txt", "sample_output_relpath": "derived/input_output/data/p02837/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02837/PHP/s171709996.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s171709996", "user_id": "u397596606"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "=0; $i--){\n \n $p = str_pad(decbin($i), $n, 0, STR_PAD_LEFT);\n \n $pt = array_count_values(str_split($p));\n isset($pt[1])? $pc = $pt[1] : $pc = 0;\n \n $hc = 0;\n for($j=1; $j<=$n; $j++){ \n $jj = $j-1;\n if ($p[$jj] == 1){ \n $tc = 0; \n foreach($t[$j] as $k=>$v){\n $vp = $v[0]-1;\n $vv = $v[1]; \n if ($p[$vp] == $vv) $tc++; \n } \n if ($tc == count($t[$j])) $hc++; \n } \n }\n \n if ($hc == $pc) break;\n \n}\n\necho $hc;\n\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always correct or an unkind person whose testimonies may be correct or not.\n\nPerson i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.\n\nHow many honest persons can be among those N people at most?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 15\n\n0 \\leq A_i \\leq N - 1\n\n1 \\leq x_{ij} \\leq N\n\nx_{ij} \\neq i\n\nx_{ij_1} \\neq x_{ij_2} (j_1 \\neq j_2)\n\ny_{ij} = 0, 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\nx_{11} y_{11}\nx_{12} y_{12}\n:\nx_{1A_1} y_{1A_1}\nA_2\nx_{21} y_{21}\nx_{22} y_{22}\n:\nx_{2A_2} y_{2A_2}\n:\nA_N\nx_{N1} y_{N1}\nx_{N2} y_{N2}\n:\nx_{NA_N} y_{NA_N}\n\nOutput\n\nPrint the maximum possible number of honest persons among the N people.\n\nSample Input 1\n\n3\n1\n2 1\n1\n1 1\n1\n2 0\n\nSample Output 1\n\n2\n\nIf Person 1 and Person 2 are honest and Person 3 is unkind, we have two honest persons without inconsistencies, which is the maximum possible number of honest persons.\n\nSample Input 2\n\n3\n2\n2 1\n3 0\n2\n3 1\n1 0\n2\n1 1\n2 0\n\nSample Output 2\n\n0\n\nAssuming that one or more of them are honest immediately leads to a contradiction.\n\nSample Input 3\n\n2\n1\n2 0\n1\n1 0\n\nSample Output 3\n\n1", "sample_input": "3\n1\n2 1\n1\n1 1\n1\n2 0\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02837", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always correct or an unkind person whose testimonies may be correct or not.\n\nPerson i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.\n\nHow many honest persons can be among those N people at most?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 15\n\n0 \\leq A_i \\leq N - 1\n\n1 \\leq x_{ij} \\leq N\n\nx_{ij} \\neq i\n\nx_{ij_1} \\neq x_{ij_2} (j_1 \\neq j_2)\n\ny_{ij} = 0, 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\nx_{11} y_{11}\nx_{12} y_{12}\n:\nx_{1A_1} y_{1A_1}\nA_2\nx_{21} y_{21}\nx_{22} y_{22}\n:\nx_{2A_2} y_{2A_2}\n:\nA_N\nx_{N1} y_{N1}\nx_{N2} y_{N2}\n:\nx_{NA_N} y_{NA_N}\n\nOutput\n\nPrint the maximum possible number of honest persons among the N people.\n\nSample Input 1\n\n3\n1\n2 1\n1\n1 1\n1\n2 0\n\nSample Output 1\n\n2\n\nIf Person 1 and Person 2 are honest and Person 3 is unkind, we have two honest persons without inconsistencies, which is the maximum possible number of honest persons.\n\nSample Input 2\n\n3\n2\n2 1\n3 0\n2\n3 1\n1 0\n2\n1 1\n2 0\n\nSample Output 2\n\n0\n\nAssuming that one or more of them are honest immediately leads to a contradiction.\n\nSample Input 3\n\n2\n1\n2 0\n1\n1 0\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 775, "cpu_time_ms": 693, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s838462616", "group_id": "codeNet:p02837", "input_text": " $v) {\n\t\t\t// echo $i . \": \" . $k . \" => \" . $v . PHP_EOL;\n\t\t\t$honset_sums[$i] += $v;\n\t\t}\n\t\tif (!isset($list[$i])) {\n\t\t\t$honset_sums[$i] += 1;\n\t\t}\n\t}\n\t// var_dump($persons[$i]);\n\t// var_dump($list);\n}\n\necho max($honset_sums);", "language": "PHP", "metadata": {"date": 1575859819, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02837.html", "problem_id": "p02837", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02837/input.txt", "sample_output_relpath": "derived/input_output/data/p02837/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02837/PHP/s838462616.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s838462616", "user_id": "u699888017"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $v) {\n\t\t\t// echo $i . \": \" . $k . \" => \" . $v . PHP_EOL;\n\t\t\t$honset_sums[$i] += $v;\n\t\t}\n\t\tif (!isset($list[$i])) {\n\t\t\t$honset_sums[$i] += 1;\n\t\t}\n\t}\n\t// var_dump($persons[$i]);\n\t// var_dump($list);\n}\n\necho max($honset_sums);", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always correct or an unkind person whose testimonies may be correct or not.\n\nPerson i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.\n\nHow many honest persons can be among those N people at most?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 15\n\n0 \\leq A_i \\leq N - 1\n\n1 \\leq x_{ij} \\leq N\n\nx_{ij} \\neq i\n\nx_{ij_1} \\neq x_{ij_2} (j_1 \\neq j_2)\n\ny_{ij} = 0, 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\nx_{11} y_{11}\nx_{12} y_{12}\n:\nx_{1A_1} y_{1A_1}\nA_2\nx_{21} y_{21}\nx_{22} y_{22}\n:\nx_{2A_2} y_{2A_2}\n:\nA_N\nx_{N1} y_{N1}\nx_{N2} y_{N2}\n:\nx_{NA_N} y_{NA_N}\n\nOutput\n\nPrint the maximum possible number of honest persons among the N people.\n\nSample Input 1\n\n3\n1\n2 1\n1\n1 1\n1\n2 0\n\nSample Output 1\n\n2\n\nIf Person 1 and Person 2 are honest and Person 3 is unkind, we have two honest persons without inconsistencies, which is the maximum possible number of honest persons.\n\nSample Input 2\n\n3\n2\n2 1\n3 0\n2\n3 1\n1 0\n2\n1 1\n2 0\n\nSample Output 2\n\n0\n\nAssuming that one or more of them are honest immediately leads to a contradiction.\n\nSample Input 3\n\n2\n1\n2 0\n1\n1 0\n\nSample Output 3\n\n1", "sample_input": "3\n1\n2 1\n1\n1 1\n1\n2 0\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02837", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always correct or an unkind person whose testimonies may be correct or not.\n\nPerson i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.\n\nHow many honest persons can be among those N people at most?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 15\n\n0 \\leq A_i \\leq N - 1\n\n1 \\leq x_{ij} \\leq N\n\nx_{ij} \\neq i\n\nx_{ij_1} \\neq x_{ij_2} (j_1 \\neq j_2)\n\ny_{ij} = 0, 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\nx_{11} y_{11}\nx_{12} y_{12}\n:\nx_{1A_1} y_{1A_1}\nA_2\nx_{21} y_{21}\nx_{22} y_{22}\n:\nx_{2A_2} y_{2A_2}\n:\nA_N\nx_{N1} y_{N1}\nx_{N2} y_{N2}\n:\nx_{NA_N} y_{NA_N}\n\nOutput\n\nPrint the maximum possible number of honest persons among the N people.\n\nSample Input 1\n\n3\n1\n2 1\n1\n1 1\n1\n2 0\n\nSample Output 1\n\n2\n\nIf Person 1 and Person 2 are honest and Person 3 is unkind, we have two honest persons without inconsistencies, which is the maximum possible number of honest persons.\n\nSample Input 2\n\n3\n2\n2 1\n3 0\n2\n3 1\n1 0\n2\n1 1\n2 0\n\nSample Output 2\n\n0\n\nAssuming that one or more of them are honest immediately leads to a contradiction.\n\nSample Input 3\n\n2\n1\n2 0\n1\n1 0\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1500, "cpu_time_ms": 13, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s458123080", "group_id": "codeNet:p02838", "input_text": " $item) {\n\n for ($i = 0; $i < 60; $i++) {\n\n $cnt[$i] += $item >> $i & 1;\n }\n}\n$res = 0;\nfor ($i = 0; $i < 60; $i++) {\n\n $tmp = ($cnt[$i] * ($N - $cnt[$i])) % $mod7;\n $tmp2 = (1 << $i) % $mod7;\n $tmp = ($tmp * $tmp2) % $mod7;\n $res = ($res + $tmp) % $mod7;\n}\n\necho $res . PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1575867552, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02838.html", "problem_id": "p02838", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02838/input.txt", "sample_output_relpath": "derived/input_output/data/p02838/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02838/PHP/s458123080.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s458123080", "user_id": "u582360565"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": " $item) {\n\n for ($i = 0; $i < 60; $i++) {\n\n $cnt[$i] += $item >> $i & 1;\n }\n}\n$res = 0;\nfor ($i = 0; $i < 60; $i++) {\n\n $tmp = ($cnt[$i] * ($N - $cnt[$i])) % $mod7;\n $tmp2 = (1 << $i) % $mod7;\n $tmp = ($tmp * $tmp2) % $mod7;\n $res = ($res + $tmp) % $mod7;\n}\n\necho $res . PHP_EOL;\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N integers. The i-th integer is A_i.\n\nFind \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n0 \\leq A_i < 2^{60}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the value \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n6\n\nWe have (1\\mbox{ XOR } 2)+(1\\mbox{ XOR } 3)+(2\\mbox{ XOR } 3)=3+2+1=6.\n\nSample Input 2\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 2\n\n237\n\nSample Input 3\n\n10\n3 14 159 2653 58979 323846 2643383 27950288 419716939 9375105820\n\nSample Output 3\n\n103715602\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02838", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N integers. The i-th integer is A_i.\n\nFind \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n0 \\leq A_i < 2^{60}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the value \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n6\n\nWe have (1\\mbox{ XOR } 2)+(1\\mbox{ XOR } 3)+(2\\mbox{ XOR } 3)=3+2+1=6.\n\nSample Input 2\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 2\n\n237\n\nSample Input 3\n\n10\n3 14 159 2653 58979 323846 2643383 27950288 419716939 9375105820\n\nSample Output 3\n\n103715602\n\nPrint the sum modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 494, "cpu_time_ms": 1648, "memory_kb": 40936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s600334430", "group_id": "codeNet:p02841", "input_text": "", "language": "PHP", "metadata": {"date": 1575342822, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02841.html", "problem_id": "p02841", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02841/input.txt", "sample_output_relpath": "derived/input_output/data/p02841/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02841/PHP/s600334430.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s600334430", "user_id": "u016536213"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019.\n\nIntegers M_1, D_1, M_2, and D_2 will be given as input.\n\nIt is known that the date 2019-M_2-D_2 follows 2019-M_1-D_1.\n\nDetermine whether the date 2019-M_1-D_1 is the last day of a month.\n\nConstraints\n\nBoth 2019-M_1-D_1 and 2019-M_2-D_2 are valid dates in the Gregorian calendar.\n\nThe date 2019-M_2-D_2 follows 2019-M_1-D_1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM_1 D_1\nM_2 D_2\n\nOutput\n\nIf the date 2019-M_1-D_1 is the last day of a month, print 1; otherwise, print 0.\n\nSample Input 1\n\n11 16\n11 17\n\nSample Output 1\n\n0\n\nNovember 16 is not the last day of a month.\n\nSample Input 2\n\n11 30\n12 1\n\nSample Output 2\n\n1\n\nNovember 30 is the last day of November.", "sample_input": "11 16\n11 17\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02841", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019.\n\nIntegers M_1, D_1, M_2, and D_2 will be given as input.\n\nIt is known that the date 2019-M_2-D_2 follows 2019-M_1-D_1.\n\nDetermine whether the date 2019-M_1-D_1 is the last day of a month.\n\nConstraints\n\nBoth 2019-M_1-D_1 and 2019-M_2-D_2 are valid dates in the Gregorian calendar.\n\nThe date 2019-M_2-D_2 follows 2019-M_1-D_1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM_1 D_1\nM_2 D_2\n\nOutput\n\nIf the date 2019-M_1-D_1 is the last day of a month, print 1; otherwise, print 0.\n\nSample Input 1\n\n11 16\n11 17\n\nSample Output 1\n\n0\n\nNovember 16 is not the last day of a month.\n\nSample Input 2\n\n11 30\n12 1\n\nSample Output 2\n\n1\n\nNovember 30 is the last day of November.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 128, "cpu_time_ms": 36, "memory_kb": 4588}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s911240779", "group_id": "codeNet:p02845", "input_text": " 7,\n 'MON' => 6,\n 'TUE' => 5,\n 'WED' => 4,\n 'THU' => 3,\n 'FRI' => 2,\n 'SAT' => 1,\n];\necho $array[$s];", "language": "PHP", "metadata": {"date": 1575924384, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02847.html", "problem_id": "p02847", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02847/input.txt", "sample_output_relpath": "derived/input_output/data/p02847/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02847/PHP/s404719869.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s404719869", "user_id": "u226342502"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " 7,\n 'MON' => 6,\n 'TUE' => 5,\n 'WED' => 4,\n 'THU' => 3,\n 'FRI' => 2,\n 'SAT' => 1,\n];\necho $array[$s];", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a string S representing the day of the week today.\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.\n\nAfter how many days is the next Sunday (tomorrow or later)?\n\nConstraints\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of days before the next Sunday.\n\nSample Input 1\n\nSAT\n\nSample Output 1\n\n1\n\nIt is Saturday today, and tomorrow will be Sunday.\n\nSample Input 2\n\nSUN\n\nSample Output 2\n\n7\n\nIt is Sunday today, and seven days later, it will be Sunday again.", "sample_input": "SAT\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02847", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a string S representing the day of the week today.\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.\n\nAfter how many days is the next Sunday (tomorrow or later)?\n\nConstraints\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of days before the next Sunday.\n\nSample Input 1\n\nSAT\n\nSample Output 1\n\n1\n\nIt is Saturday today, and tomorrow will be Sunday.\n\nSample Input 2\n\nSUN\n\nSample Output 2\n\n7\n\nIt is Sunday today, and seven days later, it will be Sunday again.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 159, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s276963095", "group_id": "codeNet:p02848", "input_text": " $v) {\n $mojiNum = array_search($v, $mojiArray) + $num;\n\n if ($mojiNum >= 26 ) $mojiNum -= 26;\n\n $newArray[] = $mojiArray[$mojiNum];\n}\n\nforeach ($newArray as $key => $value) {\n echo $value;\n}\n", "language": "PHP", "metadata": {"date": 1574648431, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02848/input.txt", "sample_output_relpath": "derived/input_output/data/p02848/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02848/PHP/s262490511.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s262490511", "user_id": "u080556513"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": " $v) {\n $mojiNum = array_search($v, $mojiArray) + $num;\n\n if ($mojiNum >= 26 ) $mojiNum -= 26;\n\n $newArray[] = $mojiArray[$mojiNum];\n}\n\nforeach ($newArray as $key => $value) {\n echo $value;\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "sample_input": "2\nABCXYZ\n"}, "reference_outputs": ["CDEZAB\n"], "source_document_id": "p02848", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 386, "cpu_time_ms": 32, "memory_kb": 6388}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s838656013", "group_id": "codeNet:p02854", "input_text": "= 1; --$i)\n if (count($t[$i - 1]) === 0) $t[$i - 1] = $t[$i];\nfor ($i = 0; $i < $h; ++$i) echo implode(' ', $t[$i]) . PHP_EOL;\nfunction strs()\n{\n return explode(' ', trim(fgets(STDIN)));\n}\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1593950853, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02855.html", "problem_id": "p02855", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02855/input.txt", "sample_output_relpath": "derived/input_output/data/p02855/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02855/PHP/s761402428.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s761402428", "user_id": "u055687468"}, "prompt_components": {"gold_output": "1 2 2\n1 3 4\n5 5 4\n", "input_to_evaluate": "= 1; --$i)\n if (count($t[$i - 1]) === 0) $t[$i - 1] = $t[$i];\nfor ($i = 0; $i < $h; ++$i) echo implode(' ', $t[$i]) . PHP_EOL;\nfunction strs()\n{\n return explode(' ', trim(fgets(STDIN)));\n}\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nChokudai made a rectangular cake for contestants in DDCC 2020 Finals.\n\nThe cake has H - 1 horizontal notches and W - 1 vertical notches, which divide the cake into H \\times W equal sections. K of these sections has a strawberry on top of each of them.\n\nThe positions of the strawberries are given to you as H \\times W characters s_{i, j} (1 \\leq i \\leq H, 1 \\leq j \\leq W). If s_{i, j} is #, the section at the i-th row from the top and the j-th column from the left contains a strawberry; if s_{i, j} is ., the section does not contain one. There are exactly K occurrences of #s.\n\nTakahashi wants to cut this cake into K pieces and serve them to the contestants. Each of these pieces must satisfy the following conditions:\n\nHas a rectangular shape.\n\nContains exactly one strawberry.\n\nOne possible way to cut the cake is shown below:\n\nFind one way to cut the cake and satisfy the condition. We can show that this is always possible, regardless of the number and positions of the strawberries.\n\nConstraints\n\n1 \\leq H \\leq 300\n\n1 \\leq W \\leq 300\n\n1 \\leq K \\leq H \\times W\n\ns_{i, j} is # or ..\n\nThere are exactly K occurrences of # in s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\ns_{1, 1} s_{1, 2} \\cdots s_{1, W}\ns_{2, 1} s_{2, 2} \\cdots s_{2, W}\n:\ns_{H, 1} s_{H, 2} \\cdots s_{H, W}\n\nOutput\n\nAssign the numbers 1, 2, 3, \\dots, K to the K pieces obtained after the cut, in any order. Then, let a_{i, j} be the number representing the piece containing the section at the i-th row from the top and the j-th column from the left of the cake. Output should be in the following format:\n\na_{1, 1} \\ a_{1, 2} \\ \\cdots \\ a_{1, W}\na_{2, 1} \\ a_{2, 2} \\ \\cdots \\ a_{2, W}\n:\na_{H, 1} \\ a_{H, 2} \\ \\cdots \\ a_{H, W}\n\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3 3 5\n#.#\n.#.\n#.#\n\nSample Output 1\n\n1 2 2\n1 3 4\n5 5 4\n\nOne way to cut this cake is shown below:\n\nSample Input 2\n\n3 7 7\n#...#.#\n..#...#\n.#..#..\n\nSample Output 2\n\n1 1 2 2 3 4 4\n6 6 2 2 3 5 5\n6 6 7 7 7 7 7\n\nOne way to cut this cake is shown below:\n\nSample Input 3\n\n13 21 106\n.....................\n.####.####.####.####.\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n.####.####.####.####.\n.....................\n.####.####.####.####.\n....#.#..#....#.#..#.\n.####.#..#.####.#..#.\n.#....#..#.#....#..#.\n.####.####.####.####.\n.....................\n\nSample Output 3\n\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 56 89 89 89 60 104 82 31 31 46 13 24 35 35 61 61 39 50 50\n12 12 67 67 100 100 60 9 9 42 42 57 13 24 6 72 72 72 72 72 72\n12 12 78 5 5 5 20 20 20 53 68 68 90 24 6 83 83 83 83 83 83\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n32 32 43 54 65 65 80 11 106 95 22 22 33 44 55 55 70 1 96 85 85\n32 32 43 54 76 76 91 11 106 84 84 4 99 66 66 66 81 1 96 74 74\n14 14 3 98 87 87 102 11 73 73 73 4 99 88 77 77 92 92 63 63 63\n25 25 3 98 87 87 7 29 62 62 62 15 99 88 77 77 103 19 30 52 52\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41", "sample_input": "3 3 5\n#.#\n.#.\n#.#\n"}, "reference_outputs": ["1 2 2\n1 3 4\n5 5 4\n"], "source_document_id": "p02855", "source_text": "Score: 400 points\n\nProblem Statement\n\nChokudai made a rectangular cake for contestants in DDCC 2020 Finals.\n\nThe cake has H - 1 horizontal notches and W - 1 vertical notches, which divide the cake into H \\times W equal sections. K of these sections has a strawberry on top of each of them.\n\nThe positions of the strawberries are given to you as H \\times W characters s_{i, j} (1 \\leq i \\leq H, 1 \\leq j \\leq W). If s_{i, j} is #, the section at the i-th row from the top and the j-th column from the left contains a strawberry; if s_{i, j} is ., the section does not contain one. There are exactly K occurrences of #s.\n\nTakahashi wants to cut this cake into K pieces and serve them to the contestants. Each of these pieces must satisfy the following conditions:\n\nHas a rectangular shape.\n\nContains exactly one strawberry.\n\nOne possible way to cut the cake is shown below:\n\nFind one way to cut the cake and satisfy the condition. We can show that this is always possible, regardless of the number and positions of the strawberries.\n\nConstraints\n\n1 \\leq H \\leq 300\n\n1 \\leq W \\leq 300\n\n1 \\leq K \\leq H \\times W\n\ns_{i, j} is # or ..\n\nThere are exactly K occurrences of # in s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\ns_{1, 1} s_{1, 2} \\cdots s_{1, W}\ns_{2, 1} s_{2, 2} \\cdots s_{2, W}\n:\ns_{H, 1} s_{H, 2} \\cdots s_{H, W}\n\nOutput\n\nAssign the numbers 1, 2, 3, \\dots, K to the K pieces obtained after the cut, in any order. Then, let a_{i, j} be the number representing the piece containing the section at the i-th row from the top and the j-th column from the left of the cake. Output should be in the following format:\n\na_{1, 1} \\ a_{1, 2} \\ \\cdots \\ a_{1, W}\na_{2, 1} \\ a_{2, 2} \\ \\cdots \\ a_{2, W}\n:\na_{H, 1} \\ a_{H, 2} \\ \\cdots \\ a_{H, W}\n\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3 3 5\n#.#\n.#.\n#.#\n\nSample Output 1\n\n1 2 2\n1 3 4\n5 5 4\n\nOne way to cut this cake is shown below:\n\nSample Input 2\n\n3 7 7\n#...#.#\n..#...#\n.#..#..\n\nSample Output 2\n\n1 1 2 2 3 4 4\n6 6 2 2 3 5 5\n6 6 7 7 7 7 7\n\nOne way to cut this cake is shown below:\n\nSample Input 3\n\n13 21 106\n.....................\n.####.####.####.####.\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n.####.####.####.####.\n.....................\n.####.####.####.####.\n....#.#..#....#.#..#.\n.####.#..#.####.#..#.\n.#....#..#.#....#..#.\n.####.####.####.####.\n.....................\n\nSample Output 3\n\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 56 89 89 89 60 104 82 31 31 46 13 24 35 35 61 61 39 50 50\n12 12 67 67 100 100 60 9 9 42 42 57 13 24 6 72 72 72 72 72 72\n12 12 78 5 5 5 20 20 20 53 68 68 90 24 6 83 83 83 83 83 83\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n32 32 43 54 65 65 80 11 106 95 22 22 33 44 55 55 70 1 96 85 85\n32 32 43 54 76 76 91 11 106 84 84 4 99 66 66 66 81 1 96 74 74\n14 14 3 98 87 87 102 11 73 73 73 4 99 88 77 77 92 92 63 63 63\n25 25 3 98 87 87 7 29 62 62 62 15 99 88 77 77 103 19 30 52 52\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 846, "cpu_time_ms": 73, "memory_kb": 21264}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s986164288", "group_id": "codeNet:p02859", "input_text": "class Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo intval($str) . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$n = $sc->nextInt();\n\n$circle = 3;\n$circle2 = $n * $n * 3;\n$res = $circle2/$circle;\n\nout::println($res);", "language": "PHP", "metadata": {"date": 1584311017, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02859.html", "problem_id": "p02859", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02859/input.txt", "sample_output_relpath": "derived/input_output/data/p02859/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02859/PHP/s986164288.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s986164288", "user_id": "u991480294"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "class Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo intval($str) . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$n = $sc->nextInt();\n\n$circle = 3;\n$circle2 = $n * $n * 3;\n$res = $circle2/$circle;\n\nout::println($res);", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer r.\n\nHow many times is the area of a circle of radius r larger than the area of a circle of radius 1?\n\nIt can be proved that the answer is always an integer under the constraints given.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n4\n\nThe area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.\n\nNote that output must be an integer - for example, 4.0 will not be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n10000", "sample_input": "2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02859", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer r.\n\nHow many times is the area of a circle of radius r larger than the area of a circle of radius 1?\n\nIt can be proved that the answer is always an integer under the constraints given.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n4\n\nThe area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.\n\nNote that output must be an integer - for example, 4.0 will not be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 907, "cpu_time_ms": 10, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s432457151", "group_id": "codeNet:p02859", "input_text": "$r = fgets(STDIN);\necho ($r * $r) . \"\\n\";\n", "language": "PHP", "metadata": {"date": 1584287640, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02859.html", "problem_id": "p02859", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02859/input.txt", "sample_output_relpath": "derived/input_output/data/p02859/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02859/PHP/s432457151.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s432457151", "user_id": "u775668672"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$r = fgets(STDIN);\necho ($r * $r) . \"\\n\";\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer r.\n\nHow many times is the area of a circle of radius r larger than the area of a circle of radius 1?\n\nIt can be proved that the answer is always an integer under the constraints given.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n4\n\nThe area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.\n\nNote that output must be an integer - for example, 4.0 will not be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n10000", "sample_input": "2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02859", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer r.\n\nHow many times is the area of a circle of radius r larger than the area of a circle of radius 1?\n\nIt can be proved that the answer is always an integer under the constraints given.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n4\n\nThe area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.\n\nNote that output must be an integer - for example, 4.0 will not be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 42, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s142412690", "group_id": "codeNet:p02859", "input_text": "", "language": "PHP", "metadata": {"date": 1573956179, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02859.html", "problem_id": "p02859", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02859/input.txt", "sample_output_relpath": "derived/input_output/data/p02859/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02859/PHP/s142412690.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s142412690", "user_id": "u020962106"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer r.\n\nHow many times is the area of a circle of radius r larger than the area of a circle of radius 1?\n\nIt can be proved that the answer is always an integer under the constraints given.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n4\n\nThe area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.\n\nNote that output must be an integer - for example, 4.0 will not be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n10000", "sample_input": "2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02859", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer r.\n\nHow many times is the area of a circle of radius r larger than the area of a circle of radius 1?\n\nIt can be proved that the answer is always an integer under the constraints given.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n4\n\nThe area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.\n\nNote that output must be an integer - for example, 4.0 will not be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 45, "cpu_time_ms": 10, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s158967414", "group_id": "codeNet:p02860", "input_text": "", "language": "PHP", "metadata": {"date": 1575520445, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02860.html", "problem_id": "p02860", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02860/input.txt", "sample_output_relpath": "derived/input_output/data/p02860/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02860/PHP/s158967414.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s158967414", "user_id": "u649513889"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "sample_input": "6\nabcabc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02860", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 256, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s989599192", "group_id": "codeNet:p02861", "input_text": "r);\n }\n \n function __invoke() {\n return pow($this->r, 2);\n }\n}\n\n$obj = new Circle();\necho $obj();\n", "language": "PHP", "metadata": {"date": 1574003065, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02861.html", "problem_id": "p02861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02861/input.txt", "sample_output_relpath": "derived/input_output/data/p02861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02861/PHP/s989599192.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s989599192", "user_id": "u195912432"}, "prompt_components": {"gold_output": "2.2761423749\n", "input_to_evaluate": "r);\n }\n \n function __invoke() {\n return pow($this->r, 2);\n }\n}\n\n$obj = new Circle();\necho $obj();\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "sample_input": "3\n0 0\n1 0\n0 1\n"}, "reference_outputs": ["2.2761423749\n"], "source_document_id": "p02861", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s079690249", "group_id": "codeNet:p02862", "input_text": "= 0 && $y - $y_1 >= 0 && $x - $x_1 === ($y - $y_1) * 2) {\n\t\t$reach_turn = $i + ($y - $y_1);\n\t\t$sum += ModComb::singleComb($reach_turn, $i, $mod);\n\t\t$sum %= $mod;\n\t\t// 回数の組み合わせとしては1通りしかないはずなのでbreak\n\t\tbreak;\n\t}\n}\n// $end = microtime(true);\n// echo $end - $start . PHP_EOL;\necho $sum;\n\n\n\n\n/**\n * フェルマーの小定理を利用した組み合わせ計算クラス\n * https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae\n * $modで組み合わせ爆発を抑制している\n */\nclass ModComb\n{\n\t// 事前計算テーブル\n\tprivate $f_table = [1]; // $n! % $mod\n\tprivate $if_table = [1]; // $k!の($mod-2)乗 % $mod\n\t// 十分大きな素数にする\n\tprivate $mod = 0;\n\n\tpublic function __construct($max = 10000, $mod = 1000000007){\n\t\t$this->mod = $mod;\n\t\t// 事前計算\n\t\t$this->calcFactorial($max);\n\t}\n\n\t// 組み合わせ計算(nCm)\n\tpublic function comb($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] * $this->if_table[$m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// logNで組み合わせを算出する\n\tpublic static function singleComb($n, $m, $mod){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t$f_n = self::singleFact($n, $mod);\n\t\t$if_n_m = self::sigleBinPow(self::singleFact($n-$m, $mod), $mod-2, $mod) % $mod;\n\t\t$if_m = self::sigleBinPow(self::singleFact($m, $mod), $mod-2, $mod) % $mod;\n\t\treturn ($if_n_m * $if_m % $mod) * $f_n % $mod;\n\t}\n\n\tprivate static function singleFact($n, $mod){\n\t\t$table = [];\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\t$table[$i] = $i+1;\n\t\t}\n\t\t$idx = 1;\n\t\twhile ($idx <= $n) {\n\t\t\t$span = $idx<<1;\n\t\t\tfor ($i=0; $i < $n; $i+=$span) { \n\t\t\t\tif ($idx + $i < $n) {\n\t\t\t\t\t$table[$i] = ($table[$i] * $table[$i+$idx]) % $mod;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$idx = $idx<<1;\n\t\t}\n\t\treturn $table[0];\n\t}\n\n\tprivate static function sigleBinPow($x, $n, $mod){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n\n\t// 順列計算(nPm)\n\tpublic function perm($n, $m){\n\t\tif ($n < $m) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// 重複組合せ計算(nHm)\n\tpublic function dupc($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < 0 || $m === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n + $m - 1])) {\n\t\t\t$this->calcFactorial($n + $m - 1);\n\t\t}\n\t\treturn ($this->if_table[$n - 1] * $this->if_table[$m] % $this->mod) * $this->f_table[$n + $m - 1] % $this->mod;\n\t}\n\n\t// 既存の事前計算結果テーブルの末尾から$maxまでの階乗までtableを拡張する。\n\tprivate function calcFactorial($max){\n\t\t$already = count($this->f_table);\n\t\tfor($i = $already; $i <= $max; $i++){\n\t\t\t$this->f_table[$i] = $this->f_table[$i-1] * $i % $this->mod;\n\t\t\t$this->if_table[$i] = $this->if_table[$i-1] * $this->binPow($i, $this->mod-2) % $this->mod;\n\t\t}\n\t}\n\n\t// $xの$n乗を2進数で高速に計算する\n\t// これを単体で利用する場合、コンストラクタの$maxは低めで良い\n\tpublic static function binPow($x, $n){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $this->mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $this->mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n}", "language": "PHP", "metadata": {"date": 1573962992, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02862.html", "problem_id": "p02862", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02862/input.txt", "sample_output_relpath": "derived/input_output/data/p02862/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02862/PHP/s079690249.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s079690249", "user_id": "u699888017"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= 0 && $y - $y_1 >= 0 && $x - $x_1 === ($y - $y_1) * 2) {\n\t\t$reach_turn = $i + ($y - $y_1);\n\t\t$sum += ModComb::singleComb($reach_turn, $i, $mod);\n\t\t$sum %= $mod;\n\t\t// 回数の組み合わせとしては1通りしかないはずなのでbreak\n\t\tbreak;\n\t}\n}\n// $end = microtime(true);\n// echo $end - $start . PHP_EOL;\necho $sum;\n\n\n\n\n/**\n * フェルマーの小定理を利用した組み合わせ計算クラス\n * https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae\n * $modで組み合わせ爆発を抑制している\n */\nclass ModComb\n{\n\t// 事前計算テーブル\n\tprivate $f_table = [1]; // $n! % $mod\n\tprivate $if_table = [1]; // $k!の($mod-2)乗 % $mod\n\t// 十分大きな素数にする\n\tprivate $mod = 0;\n\n\tpublic function __construct($max = 10000, $mod = 1000000007){\n\t\t$this->mod = $mod;\n\t\t// 事前計算\n\t\t$this->calcFactorial($max);\n\t}\n\n\t// 組み合わせ計算(nCm)\n\tpublic function comb($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] * $this->if_table[$m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// logNで組み合わせを算出する\n\tpublic static function singleComb($n, $m, $mod){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < $m || $n < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t$f_n = self::singleFact($n, $mod);\n\t\t$if_n_m = self::sigleBinPow(self::singleFact($n-$m, $mod), $mod-2, $mod) % $mod;\n\t\t$if_m = self::sigleBinPow(self::singleFact($m, $mod), $mod-2, $mod) % $mod;\n\t\treturn ($if_n_m * $if_m % $mod) * $f_n % $mod;\n\t}\n\n\tprivate static function singleFact($n, $mod){\n\t\t$table = [];\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\t$table[$i] = $i+1;\n\t\t}\n\t\t$idx = 1;\n\t\twhile ($idx <= $n) {\n\t\t\t$span = $idx<<1;\n\t\t\tfor ($i=0; $i < $n; $i+=$span) { \n\t\t\t\tif ($idx + $i < $n) {\n\t\t\t\t\t$table[$i] = ($table[$i] * $table[$i+$idx]) % $mod;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$idx = $idx<<1;\n\t\t}\n\t\treturn $table[0];\n\t}\n\n\tprivate static function sigleBinPow($x, $n, $mod){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n\n\t// 順列計算(nPm)\n\tpublic function perm($n, $m){\n\t\tif ($n < $m) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n])) {\n\t\t\t$this->calcFactorial($n);\n\t\t}\n\t\treturn ($this->if_table[$n - $m] % $this->mod) * $this->f_table[$n] % $this->mod;\n\t}\n\n\t// 重複組合せ計算(nHm)\n\tpublic function dupc($n, $m){\n\t\tif ($n === 0 && $m === 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($n < 0 || $m === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (!isset($this->f_table[$n + $m - 1])) {\n\t\t\t$this->calcFactorial($n + $m - 1);\n\t\t}\n\t\treturn ($this->if_table[$n - 1] * $this->if_table[$m] % $this->mod) * $this->f_table[$n + $m - 1] % $this->mod;\n\t}\n\n\t// 既存の事前計算結果テーブルの末尾から$maxまでの階乗までtableを拡張する。\n\tprivate function calcFactorial($max){\n\t\t$already = count($this->f_table);\n\t\tfor($i = $already; $i <= $max; $i++){\n\t\t\t$this->f_table[$i] = $this->f_table[$i-1] * $i % $this->mod;\n\t\t\t$this->if_table[$i] = $this->if_table[$i-1] * $this->binPow($i, $this->mod-2) % $this->mod;\n\t\t}\n\t}\n\n\t// $xの$n乗を2進数で高速に計算する\n\t// これを単体で利用する場合、コンストラクタの$maxは低めで良い\n\tpublic static function binPow($x, $n){\n\t\t$ans = 1;\n\t\t$bin = decbin($n);\n\t\t$cur_pos = strlen($bin) -1;\n\t\twhile ($cur_pos >= 0) {\n\t\t\tif ($bin[$cur_pos] == '1') {\n\t\t\t\t$ans = ($ans * $x) % $this->mod;\n\t\t\t}\n\t\t\t$x = ($x * $x) % $this->mod;\n\t\t\t--$cur_pos;\n\t\t}\n\t\treturn $ans;\n\t}\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a knight - the chess piece - at the origin (0, 0) of a two-dimensional grid.\n\nWhen the knight is at the square (i, j), it can be moved to either (i+1,j+2) or (i+2, j+1).\n\nIn how many ways can the knight reach the square (X, Y)?\n\nFind the number of ways modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq X \\leq 10^6\n\n1 \\leq Y \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the number of ways for the knight to reach (X, Y) from (0, 0), modulo 10^9 + 7.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\n2\n\nThere are two ways: (0,0) \\to (1,2) \\to (3,3) and (0,0) \\to (2,1) \\to (3,3).\n\nSample Input 2\n\n2 2\n\nSample Output 2\n\n0\n\nThe knight cannot reach (2,2).\n\nSample Input 3\n\n999999 999999\n\nSample Output 3\n\n151840682\n\nPrint the number of ways modulo 10^9 + 7.", "sample_input": "3 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02862", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a knight - the chess piece - at the origin (0, 0) of a two-dimensional grid.\n\nWhen the knight is at the square (i, j), it can be moved to either (i+1,j+2) or (i+2, j+1).\n\nIn how many ways can the knight reach the square (X, Y)?\n\nFind the number of ways modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq X \\leq 10^6\n\n1 \\leq Y \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the number of ways for the knight to reach (X, Y) from (0, 0), modulo 10^9 + 7.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\n2\n\nThere are two ways: (0,0) \\to (1,2) \\to (3,3) and (0,0) \\to (2,1) \\to (3,3).\n\nSample Input 2\n\n2 2\n\nSample Output 2\n\n0\n\nThe knight cannot reach (2,2).\n\nSample Input 3\n\n999999 999999\n\nSample Output 3\n\n151840682\n\nPrint the number of ways modulo 10^9 + 7.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4054, "cpu_time_ms": 199, "memory_kb": 39408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s022624493", "group_id": "codeNet:p02863", "input_text": " $row ) {\n \t$tmp_time_array[$key] = $row[\"TIME\"];\n\t\t$tmp_per_array[$key] = $row[\"SATISFACTION\"];\n\t}\n\tarray_multisort( $tmp_per_array, SORT_DESC, $tmp_time_array, SORT_ASC, $data);\n\n\t$total = 0;\n\t$total2 = 0;\n\t$time = 0;\n\t// 単位時間あたりの満足度が高い順に食べる\n\tforeach ($data as $key => $val) {\n if ($limit < $time) {\n $total2 = $total;\n $time2 = $time;\n $data2 = $data;\n foreach( $data2 as $key => $row ) {\n $tmp_time_array2[$key] = $row[\"TIME\"];\n $tmp_per_array2[$key] = $row[\"SATISFACTION_PER_TIME\"];\n\t\t}\n array_multisort( $tmp_time_array2, SORT_ASC, $tmp_per_array2, SORT_DESC, $data2);\n \tforeach ($data2 as $key2 => $val2) {\n if ($limit < $time2) break;\n \t$total2 += $val2[\"SATISFACTION\"];\n\t\t\t$time2 += $val2[\"TIME\"];\n unset($data2[$key2]);\n }\n break;\n }\n $total += $val[\"SATISFACTION\"];\n $time += $val[\"TIME\"];\n unset($data[$key]);\n }\n\tif ($total2 != 0 && $total < $total2) {\n echo $total2;\n } else {\n echo $total;\n }\n\n\n\n", "language": "PHP", "metadata": {"date": 1573961797, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02863.html", "problem_id": "p02863", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02863/input.txt", "sample_output_relpath": "derived/input_output/data/p02863/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02863/PHP/s022624493.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s022624493", "user_id": "u174429816"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": " $row ) {\n \t$tmp_time_array[$key] = $row[\"TIME\"];\n\t\t$tmp_per_array[$key] = $row[\"SATISFACTION\"];\n\t}\n\tarray_multisort( $tmp_per_array, SORT_DESC, $tmp_time_array, SORT_ASC, $data);\n\n\t$total = 0;\n\t$total2 = 0;\n\t$time = 0;\n\t// 単位時間あたりの満足度が高い順に食べる\n\tforeach ($data as $key => $val) {\n if ($limit < $time) {\n $total2 = $total;\n $time2 = $time;\n $data2 = $data;\n foreach( $data2 as $key => $row ) {\n $tmp_time_array2[$key] = $row[\"TIME\"];\n $tmp_per_array2[$key] = $row[\"SATISFACTION_PER_TIME\"];\n\t\t}\n array_multisort( $tmp_time_array2, SORT_ASC, $tmp_per_array2, SORT_DESC, $data2);\n \tforeach ($data2 as $key2 => $val2) {\n if ($limit < $time2) break;\n \t$total2 += $val2[\"SATISFACTION\"];\n\t\t\t$time2 += $val2[\"TIME\"];\n unset($data2[$key2]);\n }\n break;\n }\n $total += $val[\"SATISFACTION\"];\n $time += $val[\"TIME\"];\n unset($data[$key]);\n }\n\tif ($total2 != 0 && $total < $total2) {\n echo $total2;\n } else {\n echo $total;\n }\n\n\n\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi is at an all-you-can-eat restaurant.\n\nThe restaurant offers N kinds of dishes. It takes A_i minutes to eat the i-th dish, whose deliciousness is B_i.\n\nThe restaurant has the following rules:\n\nYou can only order one dish at a time. The dish ordered will be immediately served and ready to eat.\n\nYou cannot order the same kind of dish more than once.\n\nUntil you finish eating the dish already served, you cannot order a new dish.\n\nAfter T-0.5 minutes from the first order, you can no longer place a new order, but you can continue eating the dish already served.\n\nLet Takahashi's happiness be the sum of the deliciousness of the dishes he eats in this restaurant.\n\nWhat is the maximum possible happiness achieved by making optimal choices?\n\nConstraints\n\n2 \\leq N \\leq 3000\n\n1 \\leq T \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\n1 \\leq B_i \\leq 3000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the maximum possible happiness Takahashi can achieve.\n\nSample Input 1\n\n2 60\n10 10\n100 100\n\nSample Output 1\n\n110\n\nBy ordering the first and second dishes in this order, Takahashi's happiness will be 110.\n\nNote that, if we manage to order a dish in time, we can spend any amount of time to eat it.\n\nSample Input 2\n\n3 60\n10 10\n10 20\n10 30\n\nSample Output 2\n\n60\n\nTakahashi can eat all the dishes within 60 minutes.\n\nSample Input 3\n\n3 60\n30 10\n30 20\n30 30\n\nSample Output 3\n\n50\n\nBy ordering the second and third dishes in this order, Takahashi's happiness will be 50.\n\nWe cannot order three dishes, in whatever order we place them.\n\nSample Input 4\n\n10 100\n15 23\n20 18\n13 17\n24 12\n18 29\n19 27\n23 21\n18 20\n27 15\n22 25\n\nSample Output 4\n\n145", "sample_input": "2 60\n10 10\n100 100\n"}, "reference_outputs": ["110\n"], "source_document_id": "p02863", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi is at an all-you-can-eat restaurant.\n\nThe restaurant offers N kinds of dishes. It takes A_i minutes to eat the i-th dish, whose deliciousness is B_i.\n\nThe restaurant has the following rules:\n\nYou can only order one dish at a time. The dish ordered will be immediately served and ready to eat.\n\nYou cannot order the same kind of dish more than once.\n\nUntil you finish eating the dish already served, you cannot order a new dish.\n\nAfter T-0.5 minutes from the first order, you can no longer place a new order, but you can continue eating the dish already served.\n\nLet Takahashi's happiness be the sum of the deliciousness of the dishes he eats in this restaurant.\n\nWhat is the maximum possible happiness achieved by making optimal choices?\n\nConstraints\n\n2 \\leq N \\leq 3000\n\n1 \\leq T \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\n1 \\leq B_i \\leq 3000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the maximum possible happiness Takahashi can achieve.\n\nSample Input 1\n\n2 60\n10 10\n100 100\n\nSample Output 1\n\n110\n\nBy ordering the first and second dishes in this order, Takahashi's happiness will be 110.\n\nNote that, if we manage to order a dish in time, we can spend any amount of time to eat it.\n\nSample Input 2\n\n3 60\n10 10\n10 20\n10 30\n\nSample Output 2\n\n60\n\nTakahashi can eat all the dishes within 60 minutes.\n\nSample Input 3\n\n3 60\n30 10\n30 20\n30 30\n\nSample Output 3\n\n50\n\nBy ordering the second and third dishes in this order, Takahashi's happiness will be 50.\n\nWe cannot order three dishes, in whatever order we place them.\n\nSample Input 4\n\n10 100\n15 23\n20 18\n13 17\n24 12\n18 29\n19 27\n23 21\n18 20\n27 15\n22 25\n\nSample Output 4\n\n145", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1510, "cpu_time_ms": 24, "memory_kb": 7796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s867714563", "group_id": "codeNet:p02866", "input_text": " $v) {\n\tif ($k === 0 && $v !== 1) {\n\t\techo 0;\n\t\texit();\n\t}\n\tif ($k === 0) {\n\t\t$prev = 1;\n\t\t$cnt = 1;\n\t}else{\n\t\tif ($v !== 0 && $prev === 0) {\n\t\t\texit();\n\t\t}\n\t\t$cnt = ($cnt * (pow($prev, $v) % $mod)) % $mod;\n\t\t$prev = $v;\n\t}\n}\necho $cnt;", "language": "PHP", "metadata": {"date": 1573352488, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02866.html", "problem_id": "p02866", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02866/input.txt", "sample_output_relpath": "derived/input_output/data/p02866/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02866/PHP/s867714563.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s867714563", "user_id": "u699888017"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $v) {\n\tif ($k === 0 && $v !== 1) {\n\t\techo 0;\n\t\texit();\n\t}\n\tif ($k === 0) {\n\t\t$prev = 1;\n\t\t$cnt = 1;\n\t}else{\n\t\tif ($v !== 0 && $prev === 0) {\n\t\t\texit();\n\t\t}\n\t\t$cnt = ($cnt * (pow($prev, $v) % $mod)) % $mod;\n\t\t$prev = $v;\n\t}\n}\necho $cnt;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is an integer sequence D_1,...,D_N of N elements. Find the number, modulo 998244353, of trees with N vertices numbered 1 to N that satisfy the following condition:\n\nFor every integer i from 1 to N, the distance between Vertex 1 and Vertex i is D_i.\n\nNotes\n\nA tree of N vertices is a connected undirected graph with N vertices and N-1 edges, and the distance between two vertices are the number of edges in the shortest path between them.\n\nTwo trees are considered different if and only if there are two vertices x and y such that there is an edge between x and y in one of those trees and not in the other.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq D_i \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_1 D_2 ... D_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n0 1 1 2\n\nSample Output 1\n\n2\n\nFor example, a tree with edges (1,2), (1,3), and (2,4) satisfies the condition.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n7\n0 3 2 1 2 2 1\n\nSample Output 3\n\n24", "sample_input": "4\n0 1 1 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02866", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is an integer sequence D_1,...,D_N of N elements. Find the number, modulo 998244353, of trees with N vertices numbered 1 to N that satisfy the following condition:\n\nFor every integer i from 1 to N, the distance between Vertex 1 and Vertex i is D_i.\n\nNotes\n\nA tree of N vertices is a connected undirected graph with N vertices and N-1 edges, and the distance between two vertices are the number of edges in the shortest path between them.\n\nTwo trees are considered different if and only if there are two vertices x and y such that there is an edge between x and y in one of those trees and not in the other.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq D_i \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_1 D_2 ... D_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n0 1 1 2\n\nSample Output 1\n\n2\n\nFor example, a tree with edges (1,2), (1,3), and (2,4) satisfies the condition.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n7\n0 3 2 1 2 2 1\n\nSample Output 3\n\n24", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 543, "cpu_time_ms": 42, "memory_kb": 18932}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s056097219", "group_id": "codeNet:p02880", "input_text": "", "language": "PHP", "metadata": {"date": 1572990930, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02880.html", "problem_id": "p02880", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02880/input.txt", "sample_output_relpath": "derived/input_output/data/p02880/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02880/PHP/s993933551.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s993933551", "user_id": "u561668565"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "sample_input": "10\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02880", "source_text": "Score : 200 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 210, "cpu_time_ms": 11, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s487491648", "group_id": "codeNet:p02881", "input_text": "", "language": "PHP", "metadata": {"date": 1594159948, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02881.html", "problem_id": "p02881", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02881/input.txt", "sample_output_relpath": "derived/input_output/data/p02881/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02881/PHP/s487491648.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s487491648", "user_id": "u099640467"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "sample_input": "10\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02881", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 228, "cpu_time_ms": 55, "memory_kb": 16060}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s622488896", "group_id": "codeNet:p02882", "input_text": "= $a * $a * $b / 2) {\n echo atan2(2 * ($a * $b - $x / $a) / $a, $a) * 180 / pi();\n} else {\n echo atan2($b, 2 * $x / $a / $b) * 180 / pi();\n}\n", "language": "PHP", "metadata": {"date": 1588777371, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02882.html", "problem_id": "p02882", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02882/input.txt", "sample_output_relpath": "derived/input_output/data/p02882/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02882/PHP/s622488896.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s622488896", "user_id": "u376366206"}, "prompt_components": {"gold_output": "45.0000000000\n", "input_to_evaluate": "= $a * $a * $b / 2) {\n echo atan2(2 * ($a * $b - $x / $a) / $a, $a) * 180 / pi();\n} else {\n echo atan2($b, 2 * $x / $a / $b) * 180 / pi();\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\\mathrm{cm} and whose height is b~\\mathrm{cm}. (The thickness of the bottle can be ignored.)\n\nWe will pour x~\\mathrm{cm}^3 of water into the bottle, and gradually tilt the bottle around one of the sides of the base.\n\nWhen will the water be spilled? More formally, find the maximum angle in which we can tilt the bottle without spilling any water.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq a \\leq 100\n\n1 \\leq b \\leq 100\n\n1 \\leq x \\leq a^2b\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the maximum angle in which we can tilt the bottle without spilling any water, in degrees.\nYour output will be judged as correct when the absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n2 2 4\n\nSample Output 1\n\n45.0000000000\n\nThis bottle has a cubic shape, and it is half-full. The water gets spilled when we tilt the bottle more than 45 degrees.\n\nSample Input 2\n\n12 21 10\n\nSample Output 2\n\n89.7834636934\n\nThis bottle is almost empty. When the water gets spilled, the bottle is nearly horizontal.\n\nSample Input 3\n\n3 1 8\n\nSample Output 3\n\n4.2363947991\n\nThis bottle is almost full. When the water gets spilled, the bottle is still nearly vertical.", "sample_input": "2 2 4\n"}, "reference_outputs": ["45.0000000000\n"], "source_document_id": "p02882", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\\mathrm{cm} and whose height is b~\\mathrm{cm}. (The thickness of the bottle can be ignored.)\n\nWe will pour x~\\mathrm{cm}^3 of water into the bottle, and gradually tilt the bottle around one of the sides of the base.\n\nWhen will the water be spilled? More formally, find the maximum angle in which we can tilt the bottle without spilling any water.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq a \\leq 100\n\n1 \\leq b \\leq 100\n\n1 \\leq x \\leq a^2b\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the maximum angle in which we can tilt the bottle without spilling any water, in degrees.\nYour output will be judged as correct when the absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n2 2 4\n\nSample Output 1\n\n45.0000000000\n\nThis bottle has a cubic shape, and it is half-full. The water gets spilled when we tilt the bottle more than 45 degrees.\n\nSample Input 2\n\n12 21 10\n\nSample Output 2\n\n89.7834636934\n\nThis bottle is almost empty. When the water gets spilled, the bottle is nearly horizontal.\n\nSample Input 3\n\n3 1 8\n\nSample Output 3\n\n4.2363947991\n\nThis bottle is almost full. When the water gets spilled, the bottle is still nearly vertical.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 202, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s625873246", "group_id": "codeNet:p02885", "input_text": "= 0) {\n echo $ans;\n} else {\n echo 0;\n}\n\n", "language": "PHP", "metadata": {"date": 1589581759, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02885.html", "problem_id": "p02885", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02885/input.txt", "sample_output_relpath": "derived/input_output/data/p02885/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02885/PHP/s625873246.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s625873246", "user_id": "u348811384"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "= 0) {\n echo $ans;\n} else {\n echo 0;\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\n\nWe will close the window so as to minimize the total horizontal length of the uncovered part of the window.\nFind the total horizontal length of the uncovered parts of the window then.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the total horizontal length of the uncovered parts of the window.\n\nSample Input 1\n\n12 4\n\nSample Output 1\n\n4\n\nWe have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.\n\nSample Input 2\n\n20 15\n\nSample Output 2\n\n0\n\nIf the window is completely covered, print 0.\n\nSample Input 3\n\n20 30\n\nSample Output 3\n\n0\n\nEach curtain may be longer than the window.", "sample_input": "12 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02885", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\n\nWe will close the window so as to minimize the total horizontal length of the uncovered part of the window.\nFind the total horizontal length of the uncovered parts of the window then.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the total horizontal length of the uncovered parts of the window.\n\nSample Input 1\n\n12 4\n\nSample Output 1\n\n4\n\nWe have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.\n\nSample Input 2\n\n20 15\n\nSample Output 2\n\n0\n\nIf the window is completely covered, print 0.\n\nSample Input 3\n\n20 30\n\nSample Output 3\n\n0\n\nEach curtain may be longer than the window.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 121, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s378363104", "group_id": "codeNet:p02885", "input_text": "\n", "language": "PHP", "metadata": {"date": 1579752081, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02887.html", "problem_id": "p02887", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02887/input.txt", "sample_output_relpath": "derived/input_output/data/p02887/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02887/PHP/s547131975.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s547131975", "user_id": "u000217193"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.\n\nAdjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.\n\nUltimately, how many slimes will be there?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the final number of slimes.\n\nSample Input 1\n\n10\naabbbbaaca\n\nSample Output 1\n\n5\n\nUltimately, these slimes will fuse into abaca.\n\nSample Input 2\n\n5\naaaaa\n\nSample Output 2\n\n1\n\nAll the slimes will fuse into one.\n\nSample Input 3\n\n20\nxxzaffeeeeddfkkkkllq\n\nSample Output 3\n\n10", "sample_input": "10\naabbbbaaca\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02887", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.\n\nAdjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.\n\nUltimately, how many slimes will be there?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the final number of slimes.\n\nSample Input 1\n\n10\naabbbbaaca\n\nSample Output 1\n\n5\n\nUltimately, these slimes will fuse into abaca.\n\nSample Input 2\n\n5\naaaaa\n\nSample Output 2\n\n1\n\nAll the slimes will fuse into one.\n\nSample Input 3\n\n20\nxxzaffeeeeddfkkkkllq\n\nSample Output 3\n\n10", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 248, "cpu_time_ms": 37, "memory_kb": 21492}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s328944337", "group_id": "codeNet:p02888", "input_text": " $centerValue){\n $min = $center + 1;\n }else{\n $max = $center;\n }\n if($min == $max){\n $center = floor(($min + $max) / 2);\n $centerValue = $nums[$center];\n if($centerValue == $target){\n return $center;\n }elseif($centerValue < $target){\n return $center;\n }else{\n return $center-1;\n }\n }\n }\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\n", "language": "PHP", "metadata": {"date": 1573581350, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02888.html", "problem_id": "p02888", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02888/input.txt", "sample_output_relpath": "derived/input_output/data/p02888/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02888/PHP/s328944337.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s328944337", "user_id": "u248209126"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $centerValue){\n $min = $center + 1;\n }else{\n $max = $center;\n }\n if($min == $max){\n $center = floor(($min + $max) / 2);\n $centerValue = $nums[$center];\n if($centerValue == $target){\n return $center;\n }elseif($centerValue < $target){\n return $center;\n }else{\n return $center-1;\n }\n }\n }\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "sample_input": "4\n3 4 2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02888", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1387, "cpu_time_ms": 2104, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s783312719", "group_id": "codeNet:p02888", "input_text": " $max){\n $max = $d;\n }\n}\necho $max,\"\\n\";\n\n", "language": "PHP", "metadata": {"date": 1587840956, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02892.html", "problem_id": "p02892", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02892/input.txt", "sample_output_relpath": "derived/input_output/data/p02892/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02892/PHP/s064909639.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s064909639", "user_id": "u248209126"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $max){\n $max = $d;\n }\n}\necho $max,\"\\n\";\n\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S.\nIf S_{i,j} is 1, there is an edge connecting Vertex i and j; otherwise, there is no such edge.\n\nDetermine whether it is possible to divide the vertices into non-empty sets V_1, \\dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.\n\nEvery edge connects two vertices belonging to two \"adjacent\" sets. More formally, for every edge (i,j), there exists 1\\leq t\\leq k-1 such that i\\in V_t,j\\in V_{t+1} or i\\in V_{t+1},j\\in V_t holds.\n\nConstraints\n\n2 \\leq N \\leq 200\n\nS_{i,j} is 0 or 1.\n\nS_{i,i} is 0.\n\nS_{i,j}=S_{j,i}\n\nThe given graph is connected.\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_{1,1}...S_{1,N}\n:\nS_{N,1}...S_{N,N}\n\nOutput\n\nIf it is impossible to divide the vertices into sets so that the condition is satisfied, print -1.\nOtherwise, print the maximum possible number of sets, k, in a division that satisfies the condition.\n\nSample Input 1\n\n2\n01\n10\n\nSample Output 1\n\n2\n\nWe can put Vertex 1 in V_1 and Vertex 2 in V_2.\n\nSample Input 2\n\n3\n011\n101\n110\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n6\n010110\n101001\n010100\n101000\n100000\n010000\n\nSample Output 3\n\n4", "sample_input": "2\n01\n10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02892", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S.\nIf S_{i,j} is 1, there is an edge connecting Vertex i and j; otherwise, there is no such edge.\n\nDetermine whether it is possible to divide the vertices into non-empty sets V_1, \\dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.\n\nEvery edge connects two vertices belonging to two \"adjacent\" sets. More formally, for every edge (i,j), there exists 1\\leq t\\leq k-1 such that i\\in V_t,j\\in V_{t+1} or i\\in V_{t+1},j\\in V_t holds.\n\nConstraints\n\n2 \\leq N \\leq 200\n\nS_{i,j} is 0 or 1.\n\nS_{i,i} is 0.\n\nS_{i,j}=S_{j,i}\n\nThe given graph is connected.\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_{1,1}...S_{1,N}\n:\nS_{N,1}...S_{N,N}\n\nOutput\n\nIf it is impossible to divide the vertices into sets so that the condition is satisfied, print -1.\nOtherwise, print the maximum possible number of sets, k, in a division that satisfies the condition.\n\nSample Input 1\n\n2\n01\n10\n\nSample Output 1\n\n2\n\nWe can put Vertex 1 in V_1 and Vertex 2 in V_2.\n\nSample Input 2\n\n3\n011\n101\n110\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n6\n010110\n101001\n010100\n101000\n100000\n010000\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 913, "cpu_time_ms": 860, "memory_kb": 5368}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s857835764", "group_id": "codeNet:p02897", "input_text": "", "language": "PHP", "metadata": {"date": 1569720687, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/PHP/s374502371.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s374502371", "user_id": "u568040188"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 129, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s086906716", "group_id": "codeNet:p02897", "input_text": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n ++$this->pointer;\n\n return $result;\n }\n\n public function hasNext()\n {\n return $this->pointer < $this->count;\n }\n\n public function nextInt()\n {\n return (int) $this->next();\n }\n\n public function nextDouble()\n {\n return (float) $this->next();\n }\n}\n\n$sc = new Scanner();\n$n = $sc->nextInt();\n$k = $sc->nextInt();\n$sum = 0;\n\nfor($i=0;$i<$n;$i++){\n $height = $sc->nextInt();\n if($height >= $k){\n ++$sum;\n }\n}\n\necho $sum.PHP_EOL;", "language": "PHP", "metadata": {"date": 1601094118, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02898.html", "problem_id": "p02898", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02898/input.txt", "sample_output_relpath": "derived/input_output/data/p02898/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02898/PHP/s520617941.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s520617941", "user_id": "u598045060"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n ++$this->pointer;\n\n return $result;\n }\n\n public function hasNext()\n {\n return $this->pointer < $this->count;\n }\n\n public function nextInt()\n {\n return (int) $this->next();\n }\n\n public function nextDouble()\n {\n return (float) $this->next();\n }\n}\n\n$sc = new Scanner();\n$n = $sc->nextInt();\n$k = $sc->nextInt();\n$sum = 0;\n\nfor($i=0;$i<$n;$i++){\n $height = $sc->nextInt();\n if($height >= $k){\n ++$sum;\n }\n}\n\necho $sum.PHP_EOL;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "sample_input": "4 150\n150 140 100 200\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02898", "source_text": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 898, "cpu_time_ms": 38, "memory_kb": 22552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s157839013", "group_id": "codeNet:p02898", "input_text": "$num[1]){\n \t$count+=1;\n }\n}\necho $count;", "language": "PHP", "metadata": {"date": 1569720259, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02898.html", "problem_id": "p02898", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02898/input.txt", "sample_output_relpath": "derived/input_output/data/p02898/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02898/PHP/s883556128.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s883556128", "user_id": "u306229559"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$num[1]){\n \t$count+=1;\n }\n}\necho $count;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "sample_input": "4 150\n150 140 100 200\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02898", "source_text": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 214, "cpu_time_ms": 45, "memory_kb": 21372}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s606904164", "group_id": "codeNet:p02898", "input_text": "= $K) {\n $num++;\n }\n}\necho $num;", "language": "PHP", "metadata": {"date": 1569719332, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02898.html", "problem_id": "p02898", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02898/input.txt", "sample_output_relpath": "derived/input_output/data/p02898/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02898/PHP/s606904164.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s606904164", "user_id": "u582360565"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= $K) {\n $num++;\n }\n}\necho $num;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "sample_input": "4 150\n150 140 100 200\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02898", "source_text": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 198, "cpu_time_ms": 21, "memory_kb": 12792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s737721628", "group_id": "codeNet:p02899", "input_text": "$n){\n\t\techo \" \";\n\t}\n}\n\n?>", "language": "PHP", "metadata": {"date": 1569723753, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02899.html", "problem_id": "p02899", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02899/input.txt", "sample_output_relpath": "derived/input_output/data/p02899/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02899/PHP/s737721628.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s737721628", "user_id": "u428771698"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "$n){\n\t\techo \" \";\n\t}\n}\n\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "sample_input": "3\n2 3 1\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02899", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 602, "memory_kb": 35928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s242784654", "group_id": "codeNet:p02899", "input_text": "$v) {\n printf(\"%d \",$k+1);\n}\nprintf(\"\\n\");\n", "language": "PHP", "metadata": {"date": 1569720341, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02899.html", "problem_id": "p02899", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02899/input.txt", "sample_output_relpath": "derived/input_output/data/p02899/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02899/PHP/s242784654.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s242784654", "user_id": "u278278558"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "$v) {\n printf(\"%d \",$k+1);\n}\nprintf(\"\\n\");\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "sample_input": "3\n2 3 1\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02899", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 274, "memory_kb": 16884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s617139799", "group_id": "codeNet:p02900", "input_text": " 1 && $tmp % $i === 0) {\n\t\t// echo $tmp . ' ' . $i . PHP_EOL;\n\t\t$tmp = (int)floor($tmp/$i);\n\t\t$flg = true;\n\t}\n\tif ($flg) {\n\t\t$cnt += 1;\n\t}\n}\n// 素数だった\nif ($tmp === $gcd) {\n\t$cnt += 1;\n}\necho $cnt;\n\n\nfunction gcd($m,$n){\n\t$large = max($m,$n);\n\t$small = min($m,$n);\n\t$q = $large % $small;\n\tif ($q === 0) {\n\t\treturn $small;\n\t}else{\n\t\treturn gcd($small, $q);\n\t}\n}\n// 素数判定\n// function sieve($n){\n// \t$list = range(2, $n);\n// \t$result = [1];\n// \tfor ($i=1; $i < $n; $i++) { \n// \t\t// echo implode(' ', $list) , PHP_EOL;\n// \t\t$tmp_list = [];\n// \t\t$target = array_shift($list);\n// \t\tif (empty($target)) {\n// \t\t\tbreak;\n// \t\t}\n// \t\t$result[] = $target;\n// \t\tforeach ($list as $v) {\n// \t\t\tif ($v % $target !== 0) {\n// \t\t\t\t$tmp_list[] = $v;\n// \t\t\t}\n// \t\t}\n// \t\t$list = $tmp_list;\n// \t}\n// \treturn $result;\n// }\n", "language": "PHP", "metadata": {"date": 1569726583, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02900/input.txt", "sample_output_relpath": "derived/input_output/data/p02900/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02900/PHP/s908322516.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s908322516", "user_id": "u699888017"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " 1 && $tmp % $i === 0) {\n\t\t// echo $tmp . ' ' . $i . PHP_EOL;\n\t\t$tmp = (int)floor($tmp/$i);\n\t\t$flg = true;\n\t}\n\tif ($flg) {\n\t\t$cnt += 1;\n\t}\n}\n// 素数だった\nif ($tmp === $gcd) {\n\t$cnt += 1;\n}\necho $cnt;\n\n\nfunction gcd($m,$n){\n\t$large = max($m,$n);\n\t$small = min($m,$n);\n\t$q = $large % $small;\n\tif ($q === 0) {\n\t\treturn $small;\n\t}else{\n\t\treturn gcd($small, $q);\n\t}\n}\n// 素数判定\n// function sieve($n){\n// \t$list = range(2, $n);\n// \t$result = [1];\n// \tfor ($i=1; $i < $n; $i++) { \n// \t\t// echo implode(' ', $list) , PHP_EOL;\n// \t\t$tmp_list = [];\n// \t\t$target = array_shift($list);\n// \t\tif (empty($target)) {\n// \t\t\tbreak;\n// \t\t}\n// \t\t$result[] = $target;\n// \t\tforeach ($list as $v) {\n// \t\t\tif ($v % $target !== 0) {\n// \t\t\t\t$tmp_list[] = $v;\n// \t\t\t}\n// \t\t}\n// \t\t$list = $tmp_list;\n// \t}\n// \treturn $result;\n// }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "sample_input": "12 18\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02900", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1152, "cpu_time_ms": 57, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s890510425", "group_id": "codeNet:p02901", "input_text": "> $cc) & 1){\n $jj = $jj ^ (1 << $cc);\n }\n }\n $dp[$j] = min($dp[$j], $dp[$jj] + $a);\n }\n}\nif($dp[2**$N-1] == 10**18){\n echo -1;exit;\n}\necho $dp[2**$N-1];\n", "language": "PHP", "metadata": {"date": 1581222253, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02901.html", "problem_id": "p02901", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02901/input.txt", "sample_output_relpath": "derived/input_output/data/p02901/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02901/PHP/s890510425.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s890510425", "user_id": "u248209126"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "> $cc) & 1){\n $jj = $jj ^ (1 << $cc);\n }\n }\n $dp[$j] = min($dp[$j], $dp[$jj] + $a);\n }\n}\nif($dp[2**$N-1] == 10**18){\n echo -1;exit;\n}\necho $dp[2**$N-1];\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N locked treasure boxes, numbered 1 to N.\n\nA shop sells M keys. The i-th key is sold for a_i yen (the currency of Japan), and it can unlock b_i of the boxes: Box c_{i1}, c_{i2}, ..., c_{i{b_i}}. Each key purchased can be used any number of times.\n\nFind the minimum cost required to unlock all the treasure boxes. If it is impossible to unlock all of them, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 12\n\n1 \\leq M \\leq 10^3\n\n1 \\leq a_i \\leq 10^5\n\n1 \\leq b_i \\leq N\n\n1 \\leq c_{i1} < c_{i2} < ... < c_{i{b_i}} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\nc_{11} c_{12} ... c_{1{b_1}}\n:\na_M b_M\nc_{M1} c_{M2} ... c_{M{b_M}}\n\nOutput\n\nPrint the minimum cost required to unlock all the treasure boxes.\nIf it is impossible to unlock all of them, print -1.\n\nSample Input 1\n\n2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n\nSample Output 1\n\n25\n\nWe can unlock all the boxes by purchasing the first and second keys, at the cost of 25 yen, which is the minimum cost required.\n\nSample Input 2\n\n12 1\n100000 1\n2\n\nSample Output 2\n\n-1\n\nWe cannot unlock all the boxes.\n\nSample Input 3\n\n4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3\n\nSample Output 3\n\n69942", "sample_input": "2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n"}, "reference_outputs": ["25\n"], "source_document_id": "p02901", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N locked treasure boxes, numbered 1 to N.\n\nA shop sells M keys. The i-th key is sold for a_i yen (the currency of Japan), and it can unlock b_i of the boxes: Box c_{i1}, c_{i2}, ..., c_{i{b_i}}. Each key purchased can be used any number of times.\n\nFind the minimum cost required to unlock all the treasure boxes. If it is impossible to unlock all of them, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 12\n\n1 \\leq M \\leq 10^3\n\n1 \\leq a_i \\leq 10^5\n\n1 \\leq b_i \\leq N\n\n1 \\leq c_{i1} < c_{i2} < ... < c_{i{b_i}} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\nc_{11} c_{12} ... c_{1{b_1}}\n:\na_M b_M\nc_{M1} c_{M2} ... c_{M{b_M}}\n\nOutput\n\nPrint the minimum cost required to unlock all the treasure boxes.\nIf it is impossible to unlock all of them, print -1.\n\nSample Input 1\n\n2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n\nSample Output 1\n\n25\n\nWe can unlock all the boxes by purchasing the first and second keys, at the cost of 25 yen, which is the minimum cost required.\n\nSample Input 2\n\n12 1\n100000 1\n2\n\nSample Output 2\n\n-1\n\nWe cannot unlock all the boxes.\n\nSample Input 3\n\n4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3\n\nSample Output 3\n\n69942", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 608, "cpu_time_ms": 2104, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s585573812", "group_id": "codeNet:p02909", "input_text": "", "language": "PHP", "metadata": {"date": 1572105895, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/PHP/s959459486.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s959459486", "user_id": "u723414064"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 211, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s592219753", "group_id": "codeNet:p02909", "input_text": "", "language": "PHP", "metadata": {"date": 1569174533, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/PHP/s592219753.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s592219753", "user_id": "u489683208"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 169, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s999117806", "group_id": "codeNet:p02909", "input_text": "= count($arr)){\n $result = 0;\n}else{\n $result ++;\n}\necho $arr[$result];\n", "language": "PHP", "metadata": {"date": 1569075802, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/PHP/s999117806.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s999117806", "user_id": "u640826299"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "= count($arr)){\n $result = 0;\n}else{\n $result ++;\n}\necho $arr[$result];\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 238, "cpu_time_ms": 10, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s997228406", "group_id": "codeNet:p02909", "input_text": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n//標準出力\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n\n\n$sc = new Scanner();\n$S = $sc->next();\n\n$weather = ['Sunny', 'Cloudy', 'Rainy'];\n\n\n$ans = $weather[(array_search($S,$weather) + 1) % 3];\n\necho $ans.PHP_EOL;\n\n", "language": "PHP", "metadata": {"date": 1568600415, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/PHP/s773895647.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s773895647", "user_id": "u838849627"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n//標準出力\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n\n\n$sc = new Scanner();\n$S = $sc->next();\n\n$weather = ['Sunny', 'Cloudy', 'Rainy'];\n\n\n$ans = $weather[(array_search($S,$weather) + 1) % 3];\n\necho $ans.PHP_EOL;\n\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 925, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s528880390", "group_id": "codeNet:p02909", "input_text": "", "language": "PHP", "metadata": {"date": 1568595763, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/PHP/s390203496.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390203496", "user_id": "u216734998"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 142, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s299367039", "group_id": "codeNet:p02910", "input_text": "$val){\n\t\n //echo $key.\"/\".$val;\n \n $num = $key+1;\n \n if($num%2==0) {\n\t//偶数\n if($val==\"R\"){\n \t$flag = false;\n }\n }else{\n \t//奇数\n if($val==\"L\"){\n \t$flag = false;\n }\n \n }\n \n}\n\nif($flag){\n \techo \"Yes\";\n }else{\n \techo \"No\";\n }\n\n?>", "language": "PHP", "metadata": {"date": 1569623140, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02910.html", "problem_id": "p02910", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02910/input.txt", "sample_output_relpath": "derived/input_output/data/p02910/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02910/PHP/s974030119.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s974030119", "user_id": "u238979300"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$val){\n\t\n //echo $key.\"/\".$val;\n \n $num = $key+1;\n \n if($num%2==0) {\n\t//偶数\n if($val==\"R\"){\n \t$flag = false;\n }\n }else{\n \t//奇数\n if($val==\"L\"){\n \t$flag = false;\n }\n \n }\n \n}\n\nif($flag){\n \techo \"Yes\";\n }else{\n \techo \"No\";\n }\n\n?>", "problem_context": "Score: 200 points\n\nProblem Statement\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "sample_input": "RUDLUDR\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02910", "source_text": "Score: 200 points\n\nProblem Statement\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 373, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s248341647", "group_id": "codeNet:p02910", "input_text": "$a[$i+1]){\n $anser += $a[$i+1];\n }else{\n $anser += $a[$i];\n }\n}\n$anser += $a[$data1-2];\n\necho $anser;\n?>", "language": "PHP", "metadata": {"date": 1569274270, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02917.html", "problem_id": "p02917", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02917/input.txt", "sample_output_relpath": "derived/input_output/data/p02917/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02917/PHP/s878116397.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s878116397", "user_id": "u127740906"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "$a[$i+1]){\n $anser += $a[$i+1];\n }else{\n $anser += $a[$i];\n }\n}\n$anser += $a[$data1-2];\n\necho $anser;\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "sample_input": "3\n2 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02917", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 285, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s234608304", "group_id": "codeNet:p02917", "input_text": " $cond[$k-1]){\n $ans += $cond[$k-1];\n }else{\n $ans += $cond[$k];\n }\n }else{\n $ans += $cond[$k-1];\n }\n}\n\necho $ans;", "language": "PHP", "metadata": {"date": 1567909727, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02917.html", "problem_id": "p02917", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02917/input.txt", "sample_output_relpath": "derived/input_output/data/p02917/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02917/PHP/s234608304.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s234608304", "user_id": "u006329880"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": " $cond[$k-1]){\n $ans += $cond[$k-1];\n }else{\n $ans += $cond[$k];\n }\n }else{\n $ans += $cond[$k-1];\n }\n}\n\necho $ans;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "sample_input": "3\n2 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02917", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 402, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s195854385", "group_id": "codeNet:p02917", "input_text": " 0; $i--) {\n $a[$i] = min((int)$b[$i], (int)$b[$i - 1]);\n}\n$a[0] = (int)$b[0];\n\necho array_sum($a) . PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1567906258, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02917.html", "problem_id": "p02917", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02917/input.txt", "sample_output_relpath": "derived/input_output/data/p02917/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02917/PHP/s195854385.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s195854385", "user_id": "u769751829"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": " 0; $i--) {\n $a[$i] = min((int)$b[$i], (int)$b[$i - 1]);\n}\n$a[0] = (int)$b[0];\n\necho array_sum($a) . PHP_EOL;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "sample_input": "3\n2 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02917", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s254930572", "group_id": "codeNet:p02919", "input_text": "= 0){\n if($array[$k] > $array[$i]){\n if($t == 0){\n $b_1 = $i - $k;\n $t = 1;\n }else{\n $b_2 = $i - $b_1 - $k;\n $t = 2;\n break;\n }\n }\n $k--;\n }\n if($t == 0){\n $b_1 = $i + 1;\n }elseif($t == 1){\n $b_2 = $i - $b_1 + 1;\n }\n $k = $i+1;\n $t = 0;\n while($k < $n){\n if($array[$k] > $array[$i]){\n if($t == 0){\n $a_1 = $k - $i;\n $t = 1;\n }else{\n $a_2 = $k - $a_1 - $i;\n $t = 2;\n break;\n }\n }\n $k++;\n }\n if($t == 0){\n $a_1 = $n - $i;\n }elseif($t == 1){\n $a_2 = $n - $a_1 - $i;\n }\n $ans += (($b_2) * $a_1 + ($a_2) * $b_1) * $array[$i];\n\n}\necho $ans;", "language": "PHP", "metadata": {"date": 1567887709, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02919.html", "problem_id": "p02919", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02919/input.txt", "sample_output_relpath": "derived/input_output/data/p02919/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02919/PHP/s254930572.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s254930572", "user_id": "u274811210"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "= 0){\n if($array[$k] > $array[$i]){\n if($t == 0){\n $b_1 = $i - $k;\n $t = 1;\n }else{\n $b_2 = $i - $b_1 - $k;\n $t = 2;\n break;\n }\n }\n $k--;\n }\n if($t == 0){\n $b_1 = $i + 1;\n }elseif($t == 1){\n $b_2 = $i - $b_1 + 1;\n }\n $k = $i+1;\n $t = 0;\n while($k < $n){\n if($array[$k] > $array[$i]){\n if($t == 0){\n $a_1 = $k - $i;\n $t = 1;\n }else{\n $a_2 = $k - $a_1 - $i;\n $t = 2;\n break;\n }\n }\n $k++;\n }\n if($t == 0){\n $a_1 = $n - $i;\n }elseif($t == 1){\n $a_2 = $n - $a_1 - $i;\n }\n $ans += (($b_2) * $a_1 + ($a_2) * $b_1) * $array[$i];\n\n}\necho $ans;", "problem_context": "Score: 500 points\n\nProblem Statement\n\nGiven is a permutation P of \\{1, 2, \\ldots, N\\}.\n\nFor a pair (L, R) (1 \\le L \\lt R \\le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \\ldots, P_R.\n\nFind \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le P_i \\le N\n\nP_i \\neq P_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 \\ldots P_N\n\nOutput\n\nPrint \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n5\n\nX_{1, 2} = 2, X_{1, 3} = 2, and X_{2, 3} = 1, so the sum is 2 + 2 + 1 = 5.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n30\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n136", "sample_input": "3\n2 3 1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02919", "source_text": "Score: 500 points\n\nProblem Statement\n\nGiven is a permutation P of \\{1, 2, \\ldots, N\\}.\n\nFor a pair (L, R) (1 \\le L \\lt R \\le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \\ldots, P_R.\n\nFind \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le P_i \\le N\n\nP_i \\neq P_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 \\ldots P_N\n\nOutput\n\nPrint \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n5\n\nX_{1, 2} = 2, X_{1, 3} = 2, and X_{2, 3} = 1, so the sum is 2 + 2 + 1 = 5.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n30\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n136", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1113, "cpu_time_ms": 2104, "memory_kb": 12792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s428953280", "group_id": "codeNet:p02922", "input_text": "= $B){\n echo ($i+1).\"\\n\";\n break;\n }\n $sum_port += $A-1;\n\n}\n", "language": "PHP", "metadata": {"date": 1587405547, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/PHP/s428953280.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s428953280", "user_id": "u553494195"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "= $B){\n echo ($i+1).\"\\n\";\n break;\n }\n $sum_port += $A-1;\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 242, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s557544978", "group_id": "codeNet:p02922", "input_text": "", "language": "PHP", "metadata": {"date": 1579107801, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/PHP/s557544978.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s557544978", "user_id": "u045289115"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 71, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s950604445", "group_id": "codeNet:p02922", "input_text": "", "language": "PHP", "metadata": {"date": 1567367828, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/PHP/s950604445.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s950604445", "user_id": "u895020232"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 205, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s123465422", "group_id": "codeNet:p02922", "input_text": "= $a_b[1]){\n break;\n }\n $count += $a_b[0] - 1;\n $tap++;\n }\n \n echo $tap;\n}", "language": "PHP", "metadata": {"date": 1567365645, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/PHP/s123465422.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s123465422", "user_id": "u188465420"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "= $a_b[1]){\n break;\n }\n $count += $a_b[0] - 1;\n $tap++;\n }\n \n echo $tap;\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 305, "cpu_time_ms": 10, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s022598382", "group_id": "codeNet:p02923", "input_text": "= $H[$i + 1]) {\n \n $count ++;\n \n } else {\n \n $max = max($max, $count);\n $count = 0;\n \n } \n \n }\n \n $max = max($max, $count);\n \necho $max\n \n?>", "language": "PHP", "metadata": {"date": 1568105945, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/PHP/s022598382.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s022598382", "user_id": "u058447706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= $H[$i + 1]) {\n \n $count ++;\n \n } else {\n \n $max = max($max, $count);\n $count = 0;\n \n } \n \n }\n \n $max = max($max, $count);\n \necho $max\n \n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 356, "cpu_time_ms": 33, "memory_kb": 14840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s676202801", "group_id": "codeNet:p02923", "input_text": " $height[$i-1]){\n$ans[$k] = $c ;\n $c = 0 ;\n $k++ ;\n continue ;\n}\n $c++ ;\n}\n$ans[$k] = $c ;\necho max($ans) ;", "language": "PHP", "metadata": {"date": 1567366559, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/PHP/s676202801.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s676202801", "user_id": "u663695961"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $height[$i-1]){\n$ans[$k] = $c ;\n $c = 0 ;\n $k++ ;\n continue ;\n}\n $c++ ;\n}\n$ans[$k] = $c ;\necho max($ans) ;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 77, "memory_kb": 35308}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s544212599", "group_id": "codeNet:p02924", "input_text": "= 2 && $d10 >= 2 && (int)($d1 * $d10) === $i) $ans++;\n }\n}\necho $ans . PHP_EOL;", "language": "PHP", "metadata": {"date": 1566695659, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02927.html", "problem_id": "p02927", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02927/input.txt", "sample_output_relpath": "derived/input_output/data/p02927/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02927/PHP/s213951827.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s213951827", "user_id": "u055687468"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "= 2 && $d10 >= 2 && (int)($d1 * $d10) === $i) $ans++;\n }\n}\necho $ans . PHP_EOL;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nToday is August 24, one of the five Product Days in a year.\n\nA date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day):\n\nd_1 \\geq 2\n\nd_{10} \\geq 2\n\nd_1 \\times d_{10} = m\n\nTakahashi wants more Product Days, and he made a new calendar called Takahashi Calendar where a year consists of M month from Month 1 to Month M, and each month consists of D days from Day 1 to Day D.\n\nIn Takahashi Calendar, how many Product Days does a year have?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq M \\leq 100\n\n1 \\leq D \\leq 99\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM D\n\nOutput\n\nPrint the number of Product Days in a year in Takahashi Calender.\n\nSample Input 1\n\n15 40\n\nSample Output 1\n\n10\n\nThere are 10 Product Days in a year, as follows (m-d denotes Month m, Day d):\n\n4-22\n\n6-23\n\n6-32\n\n8-24\n\n9-33\n\n10-25\n\n12-26\n\n12-34\n\n14-27\n\n15-35\n\nSample Input 2\n\n12 31\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "sample_input": "15 40\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02927", "source_text": "Score : 200 points\n\nProblem Statement\n\nToday is August 24, one of the five Product Days in a year.\n\nA date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day):\n\nd_1 \\geq 2\n\nd_{10} \\geq 2\n\nd_1 \\times d_{10} = m\n\nTakahashi wants more Product Days, and he made a new calendar called Takahashi Calendar where a year consists of M month from Month 1 to Month M, and each month consists of D days from Day 1 to Day D.\n\nIn Takahashi Calendar, how many Product Days does a year have?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq M \\leq 100\n\n1 \\leq D \\leq 99\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM D\n\nOutput\n\nPrint the number of Product Days in a year in Takahashi Calender.\n\nSample Input 1\n\n15 40\n\nSample Output 1\n\n10\n\nThere are 10 Product Days in a year, as follows (m-d denotes Month m, Day d):\n\n4-22\n\n6-23\n\n6-32\n\n8-24\n\n9-33\n\n10-25\n\n12-26\n\n12-34\n\n14-27\n\n15-35\n\nSample Input 2\n\n12 31\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 13, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s420831039", "group_id": "codeNet:p02934", "input_text": "", "language": "PHP", "metadata": {"date": 1590511267, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02935/input.txt", "sample_output_relpath": "derived/input_output/data/p02935/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02935/PHP/s915275759.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s915275759", "user_id": "u348811384"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "sample_input": "2\n3 4\n"}, "reference_outputs": ["3.5\n"], "source_document_id": "p02935", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 168, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s592896950", "group_id": "codeNet:p02935", "input_text": " 1) {\n sort($m);\n $x = array_shift($m);\n $y = array_shift($m);\n $m[] = ($x + $y) / 2;\n}\n\necho current($m) . \".\\n\";", "language": "PHP", "metadata": {"date": 1566186405, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02935/input.txt", "sample_output_relpath": "derived/input_output/data/p02935/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02935/PHP/s592896950.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s592896950", "user_id": "u407637814"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": " 1) {\n sort($m);\n $x = array_shift($m);\n $y = array_shift($m);\n $m[] = ($x + $y) / 2;\n}\n\necho current($m) . \".\\n\";", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "sample_input": "2\n3 4\n"}, "reference_outputs": ["3.5\n"], "source_document_id": "p02935", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s290471137", "group_id": "codeNet:p02935", "input_text": "\n", "language": "PHP", "metadata": {"date": 1565486226, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02945.html", "problem_id": "p02945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02945/input.txt", "sample_output_relpath": "derived/input_output/data/p02945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02945/PHP/s652420460.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s652420460", "user_id": "u814317577"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "sample_input": "-13 3\n"}, "reference_outputs": ["-10\n"], "source_document_id": "p02945", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 274, "cpu_time_ms": 11, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s003602536", "group_id": "codeNet:p02947", "input_text": "\n", "language": "PHP", "metadata": {"date": 1577486090, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/PHP/s003602536.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003602536", "user_id": "u852613820"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 705, "cpu_time_ms": 173, "memory_kb": 13048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s033531392", "group_id": "codeNet:p02947", "input_text": " 1){\n for($s=1; $s<$value; $s++){\n $ans += $value-$s; \n }\n }\n}\n\nprint_r($ans);\n\n?> ", "language": "PHP", "metadata": {"date": 1566349070, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/PHP/s033531392.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s033531392", "user_id": "u216734998"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " 1){\n for($s=1; $s<$value; $s++){\n $ans += $value-$s; \n }\n }\n}\n\nprint_r($ans);\n\n?> ", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 369, "cpu_time_ms": 417, "memory_kb": 61428}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s282541769", "group_id": "codeNet:p02947", "input_text": "0; $n--){\n fscanf(STDIN, \"%s\", $s);\n\n $split = str_split($s);\n sort($split);\n $sorted = implode('', $split);\n\n $arr[$sorted] = isset($arr[$sorted])? $arr[$sorted]+1 : 1;\n}\n\n$cnt = 0;\nforeach($arr as $str){\n if($str === 1) continue;\n\n $a = factorial($str);\n $b = 2;\n $cnt += $a / ($b*factorial($str-$b));\n}\n\necho $cnt, \"\\n\";\n\n\nfunction factorial($num){\n return ($num === 0)? 1 : array_product(range(1,$num));\n}", "language": "PHP", "metadata": {"date": 1565648515, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/PHP/s282541769.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s282541769", "user_id": "u386610210"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "0; $n--){\n fscanf(STDIN, \"%s\", $s);\n\n $split = str_split($s);\n sort($split);\n $sorted = implode('', $split);\n\n $arr[$sorted] = isset($arr[$sorted])? $arr[$sorted]+1 : 1;\n}\n\n$cnt = 0;\nforeach($arr as $str){\n if($str === 1) continue;\n\n $a = factorial($str);\n $b = 2;\n $cnt += $a / ($b*factorial($str-$b));\n}\n\necho $cnt, \"\\n\";\n\n\nfunction factorial($num){\n return ($num === 0)? 1 : array_product(range(1,$num));\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 472, "cpu_time_ms": 177, "memory_kb": 13048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s067422014", "group_id": "codeNet:p02948", "input_text": "setExtractFlags(SplPriorityQueue::EXTR_PRIORITY);\n$res=0;\nfor($i=$M;$i>=0;$i--) {\n if (isset($m[$i])) {\n foreach($m[$i] as $v) {\n $pq->insert($v,$v);\n }\n }\n if ($pq->isEmpty()==false) {\n $res += $pq->extract();\n }\n}\nprintf(\"%d\\n\",$res);\n", "language": "PHP", "metadata": {"date": 1566097907, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02948.html", "problem_id": "p02948", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02948/input.txt", "sample_output_relpath": "derived/input_output/data/p02948/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02948/PHP/s067422014.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s067422014", "user_id": "u278278558"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "setExtractFlags(SplPriorityQueue::EXTR_PRIORITY);\n$res=0;\nfor($i=$M;$i>=0;$i--) {\n if (isset($m[$i])) {\n foreach($m[$i] as $v) {\n $pq->insert($v,$v);\n }\n }\n if ($pq->isEmpty()==false) {\n $res += $pq->extract();\n }\n}\nprintf(\"%d\\n\",$res);\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "sample_input": "3 4\n4 3\n4 1\n2 2\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02948", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 527, "cpu_time_ms": 507, "memory_kb": 59896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s593400583", "group_id": "codeNet:p02951", "input_text": "= $c){\n echo 0;\n}else{\n $total = $c - $max;\n echo $total;\n}\n\n", "language": "PHP", "metadata": {"date": 1572987338, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02951/input.txt", "sample_output_relpath": "derived/input_output/data/p02951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02951/PHP/s593400583.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s593400583", "user_id": "u078274014"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "= $c){\n echo 0;\n}else{\n $total = $c - $max;\n echo $total;\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "sample_input": "6 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02951", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 221, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s773481809", "group_id": "codeNet:p02951", "input_text": "\n", "language": "PHP", "metadata": {"date": 1571684582, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02951/input.txt", "sample_output_relpath": "derived/input_output/data/p02951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02951/PHP/s773481809.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s773481809", "user_id": "u445624660"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "sample_input": "6 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02951", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 147, "cpu_time_ms": 13, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s212183185", "group_id": "codeNet:p02951", "input_text": "= ($b +$c)) {\n echo 0;\n }\n\telse {\n echo $c+$b-$a; \n }\n?>", "language": "PHP", "metadata": {"date": 1565150078, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02951/input.txt", "sample_output_relpath": "derived/input_output/data/p02951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02951/PHP/s212183185.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s212183185", "user_id": "u471479986"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "= ($b +$c)) {\n echo 0;\n }\n\telse {\n echo $c+$b-$a; \n }\n?>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "sample_input": "6 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02951", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 132, "cpu_time_ms": 10, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s881560724", "group_id": "codeNet:p02951", "input_text": " 9999) {\n $count += $n-9999;\n }\n\tif ($n > 99 && $n < 1000) {\n $count += $n-99;\n }\n\tif ($n > 9 && $n < 100) {\n $count += $n-9;\n }\n\techo $count;\n?>", "language": "PHP", "metadata": {"date": 1565152229, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02952.html", "problem_id": "p02952", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02952/input.txt", "sample_output_relpath": "derived/input_output/data/p02952/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02952/PHP/s175954932.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s175954932", "user_id": "u471479986"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": " 9999) {\n $count += $n-9999;\n }\n\tif ($n > 99 && $n < 1000) {\n $count += $n-99;\n }\n\tif ($n > 9 && $n < 100) {\n $count += $n-9;\n }\n\techo $count;\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "sample_input": "11\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02952", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 218, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s284454095", "group_id": "codeNet:p02952", "input_text": " $v){\n if($v=='R'){\n $temp[$k+1]+=$keepList[$k]; \n }else{\n $temp[$k-1]+=$keepList[$k]; \n }\n }\n $cnt++;\n if($cnt%2==1){\n if($oddList==$temp){\n break;\n }\n $oddList=$temp;\n }else{\n if($evenList==$temp){\n break;\n }\n $evenList=$temp;\n }\n $keepList=$temp;\n}\necho implode($evenList);", "language": "PHP", "metadata": {"date": 1565050295, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02954.html", "problem_id": "p02954", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02954/input.txt", "sample_output_relpath": "derived/input_output/data/p02954/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02954/PHP/s422441694.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s422441694", "user_id": "u336102890"}, "prompt_components": {"gold_output": "0 1 2 1 1\n", "input_to_evaluate": " $v){\n if($v=='R'){\n $temp[$k+1]+=$keepList[$k]; \n }else{\n $temp[$k-1]+=$keepList[$k]; \n }\n }\n $cnt++;\n if($cnt%2==1){\n if($oddList==$temp){\n break;\n }\n $oddList=$temp;\n }else{\n if($evenList==$temp){\n break;\n }\n $evenList=$temp;\n }\n $keepList=$temp;\n}\necho implode($evenList);", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "sample_input": "RRLRL\n"}, "reference_outputs": ["0 1 2 1 1\n"], "source_document_id": "p02954", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 551, "cpu_time_ms": 2107, "memory_kb": 73980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s436847052", "group_id": "codeNet:p02957", "input_text": "$arrayB[$i]){\n $total += $arrayB[$i];\n }else{\n $total += $arrayA[$i];\n $arrayB[$i] -= $arrayA[$i];\n \n if($arrayB[$i]>0){\n if($arrayA[$i+1]>$arrayB[$i]){\n $total += $arrayB[$i];\n }else{\n $total += $arrayA[$i+1];\n }\n }\n }\n }\n\n echo $total.\"\\n\";", "language": "PHP", "metadata": {"date": 1564280269, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02959.html", "problem_id": "p02959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02959/input.txt", "sample_output_relpath": "derived/input_output/data/p02959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02959/PHP/s271079902.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s271079902", "user_id": "u611310488"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "$arrayB[$i]){\n $total += $arrayB[$i];\n }else{\n $total += $arrayA[$i];\n $arrayB[$i] -= $arrayA[$i];\n \n if($arrayB[$i]>0){\n if($arrayA[$i+1]>$arrayB[$i]){\n $total += $arrayB[$i];\n }else{\n $total += $arrayA[$i+1];\n }\n }\n }\n }\n\n echo $total.\"\\n\";", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "sample_input": "2\n3 5 2\n4 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02959", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 507, "cpu_time_ms": 51, "memory_kb": 21108}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s624831713", "group_id": "codeNet:p02959", "input_text": "=0; --$i){\n $m*=10;\n $m%=13;\n for($j = 0; $j < 13; ++$j){\n $dp[$i][$j] = 0;\n }\n $dpi = &$dp[$i];\n $dpip = $dp[$i+1];\n if($str[$i] != \"?\"){\n $diff = $m*intval($str[$i])%13;\n for($j = 0; $j < 13; ++$j){\n $dpi[($j+$diff)%13] = $dpip[$j];\n }\n }else{\n for($k = 0; $k < 10; ++$k){\n $diff = $m*intval($k)%13;\n for($j = 0; $j < 13; ++$j){\n $dpi[($j+$diff)%13] += $dpip[$j];\n $c+=$dpip[$j];\n }\n }\n }\n for($j = 0; $j < 13; $j++){\n $dp[$i][$j] = $dp[$i][$j] % MOD;\n }\n}\necho $dp[0][5];\n\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array:\";\n echo implode(\" \", $val).\"\\n\";\n }else{\n echo \"array:array\\n\";\n foreach($val as $row){\n echo implode(\" \", $row).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\n", "language": "PHP", "metadata": {"date": 1582049503, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02960/input.txt", "sample_output_relpath": "derived/input_output/data/p02960/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02960/PHP/s975181833.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s975181833", "user_id": "u248209126"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "=0; --$i){\n $m*=10;\n $m%=13;\n for($j = 0; $j < 13; ++$j){\n $dp[$i][$j] = 0;\n }\n $dpi = &$dp[$i];\n $dpip = $dp[$i+1];\n if($str[$i] != \"?\"){\n $diff = $m*intval($str[$i])%13;\n for($j = 0; $j < 13; ++$j){\n $dpi[($j+$diff)%13] = $dpip[$j];\n }\n }else{\n for($k = 0; $k < 10; ++$k){\n $diff = $m*intval($k)%13;\n for($j = 0; $j < 13; ++$j){\n $dpi[($j+$diff)%13] += $dpip[$j];\n $c+=$dpip[$j];\n }\n }\n }\n for($j = 0; $j < 13; $j++){\n $dp[$i][$j] = $dp[$i][$j] % MOD;\n }\n}\necho $dp[0][5];\n\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array:\";\n echo implode(\" \", $val).\"\\n\";\n }else{\n echo \"array:array\\n\";\n foreach($val as $row){\n echo implode(\" \", $row).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "sample_input": "??2??5\n"}, "reference_outputs": ["768\n"], "source_document_id": "p02960", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1532, "cpu_time_ms": 1126, "memory_kb": 86904}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s780962513", "group_id": "codeNet:p02960", "input_text": " $v){\n for($m=0; $m<10; $m++){\n $tmp[(($k*pow(10,$keta)+$keep)*10+$m)%13]+=$v;\n $tmp[(($k*pow(10,$keta)+$keep)*10+$m)%13]%=(pow(10, 9)+7);\n }\n }\n $keep=0;\n $keta=0;\n $ans=$tmp;\n\n }else{\n $keep=$keep*10+$sList[$i];\n $keta+=1;\n }\n}\n\n//最後が数値の場合\nif($sList[count($sList)-1]!='?'){\n $tmp=array_fill(0,13,0);\n $pattern=array_diff($ans, array(0));\n foreach($pattern as $k => $v){\n $tmp[($k*pow(10,$keta)+$keep)%13]+=$v;\n $tmp[($k*pow(10,$keta)+$keep)%13]%=(pow(10, 9)+7);\n }\n $ans=$tmp;\n}\n\necho $ans[5];", "language": "PHP", "metadata": {"date": 1564629863, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02960/input.txt", "sample_output_relpath": "derived/input_output/data/p02960/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02960/PHP/s780962513.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s780962513", "user_id": "u336102890"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": " $v){\n for($m=0; $m<10; $m++){\n $tmp[(($k*pow(10,$keta)+$keep)*10+$m)%13]+=$v;\n $tmp[(($k*pow(10,$keta)+$keep)*10+$m)%13]%=(pow(10, 9)+7);\n }\n }\n $keep=0;\n $keta=0;\n $ans=$tmp;\n\n }else{\n $keep=$keep*10+$sList[$i];\n $keta+=1;\n }\n}\n\n//最後が数値の場合\nif($sList[count($sList)-1]!='?'){\n $tmp=array_fill(0,13,0);\n $pattern=array_diff($ans, array(0));\n foreach($pattern as $k => $v){\n $tmp[($k*pow(10,$keta)+$keep)%13]+=$v;\n $tmp[($k*pow(10,$keta)+$keep)%13]%=(pow(10, 9)+7);\n }\n $ans=$tmp;\n}\n\necho $ans[5];", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "sample_input": "??2??5\n"}, "reference_outputs": ["768\n"], "source_document_id": "p02960", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 843, "cpu_time_ms": 2105, "memory_kb": 21132}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s370761900", "group_id": "codeNet:p02960", "input_text": " $v){\n if($sList[$i]=='?'){\n for($m=0; $m<10; $m++){\n $tmp[($k*10+$m)%13]+=$v;\n $tmp[($k*10+$m)%13]%=(pow(10, 9)+7);\n }\n }else{\n $tmp[($k*10+$sList[$i])%13]+=$v;\n $tmp[($k*10+$sList[$i])%13]%=(pow(10, 9)+7);\n }\n }\n $ans=$tmp;\n}\necho $ans[5];\n ", "language": "PHP", "metadata": {"date": 1564530914, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02960/input.txt", "sample_output_relpath": "derived/input_output/data/p02960/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02960/PHP/s370761900.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s370761900", "user_id": "u336102890"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": " $v){\n if($sList[$i]=='?'){\n for($m=0; $m<10; $m++){\n $tmp[($k*10+$m)%13]+=$v;\n $tmp[($k*10+$m)%13]%=(pow(10, 9)+7);\n }\n }else{\n $tmp[($k*10+$sList[$i])%13]+=$v;\n $tmp[($k*10+$sList[$i])%13]%=(pow(10, 9)+7);\n }\n }\n $ans=$tmp;\n}\necho $ans[5];\n ", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "sample_input": "??2??5\n"}, "reference_outputs": ["768\n"], "source_document_id": "p02960", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 507, "cpu_time_ms": 2105, "memory_kb": 23180}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s895814271", "group_id": "codeNet:p02963", "input_text": "$s){\n break;\n }\n $i++;\n }\n $x1 = $i;\n $y2 = $i;\n $x2 = 1;\n $y1 = $i*$i - $s;\n echo(\"0 0 \".$x1.\" \".$y1.\" \".$x2.\" \".$y2);", "language": "PHP", "metadata": {"date": 1564008420, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02963.html", "problem_id": "p02963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02963/input.txt", "sample_output_relpath": "derived/input_output/data/p02963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02963/PHP/s895814271.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s895814271", "user_id": "u212632225"}, "prompt_components": {"gold_output": "1 0 2 2 0 1\n", "input_to_evaluate": "$s){\n break;\n }\n $i++;\n }\n $x1 = $i;\n $y2 = $i;\n $x2 = 1;\n $y1 = $i*$i - $s;\n echo(\"0 0 \".$x1.\" \".$y1.\" \".$x2.\" \".$y2);", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "sample_input": "3\n"}, "reference_outputs": ["1 0 2 2 0 1\n"], "source_document_id": "p02963", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 200, "cpu_time_ms": 2104, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s413315815", "group_id": "codeNet:p02963", "input_text": "1){\n $f[] = $M;\n }\n return $f;\n}\n\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}", "language": "PHP", "metadata": {"date": 1563758752, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02963.html", "problem_id": "p02963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02963/input.txt", "sample_output_relpath": "derived/input_output/data/p02963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02963/PHP/s112974874.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s112974874", "user_id": "u248209126"}, "prompt_components": {"gold_output": "1 0 2 2 0 1\n", "input_to_evaluate": "1){\n $f[] = $M;\n }\n return $f;\n}\n\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "sample_input": "3\n"}, "reference_outputs": ["1 0 2 2 0 1\n"], "source_document_id": "p02963", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 661, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s246862185", "group_id": "codeNet:p02969", "input_text": "", "language": "PHP", "metadata": {"date": 1563703399, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/PHP/s274075239.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s274075239", "user_id": "u662928684"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 78, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s158170387", "group_id": "codeNet:p02969", "input_text": " for ($r=1; $r<100; $r++){\n echo (pow($r,2))*3;\n }", "language": "PHP", "metadata": {"date": 1563674408, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/PHP/s158170387.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s158170387", "user_id": "u695427191"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": " for ($r=1; $r<100; $r++){\n echo (pow($r,2))*3;\n }", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 67, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s461310188", "group_id": "codeNet:p02970", "input_text": " $max) {\n $second_max = $max;\n $max = $a_;\n } else if ($a_ > $second_max) {\n $second_max = $a_;\n }\n }\n\n # マックス値と同じなら次に大きな値を出力 \n # そうでないならマックス値\n for ($i=0; $i<$n; $i++) {\n if ($a[$i] == $max) echo $second_max . \"\\n\";\n else echo $max . \"\\n\";\n }\n?>", "language": "PHP", "metadata": {"date": 1586386857, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/PHP/s938620649.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938620649", "user_id": "u094155508"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": " $max) {\n $second_max = $max;\n $max = $a_;\n } else if ($a_ > $second_max) {\n $second_max = $a_;\n }\n }\n\n # マックス値と同じなら次に大きな値を出力 \n # そうでないならマックス値\n for ($i=0; $i<$n; $i++) {\n if ($a[$i] == $max) echo $second_max . \"\\n\";\n else echo $max . \"\\n\";\n }\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 572, "cpu_time_ms": 414, "memory_kb": 14196}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s288740156", "group_id": "codeNet:p02971", "input_text": " $a[$i]) {\n $max = $sai;\n } elseif ($sai == $a[$i]) {\n sort($b);\n $max = $b[1];\n }\n echo $max . PHP_EOL;\n}\n?>", "language": "PHP", "metadata": {"date": 1563677535, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/PHP/s288740156.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s288740156", "user_id": "u044844077"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": " $a[$i]) {\n $max = $sai;\n } elseif ($sai == $a[$i]) {\n sort($b);\n $max = $b[1];\n }\n echo $max . PHP_EOL;\n}\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 321, "cpu_time_ms": 2104, "memory_kb": 6648}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s496370301", "group_id": "codeNet:p02971", "input_text": " $a[$i]) {\n $max = $sai;\n } elseif ($sai == $a[$i]) {\n sort($b);\n $max = $b[1];\n }\n echo $max . PHP_EOL;\n}\n\n?>", "language": "PHP", "metadata": {"date": 1563676465, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/PHP/s496370301.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s496370301", "user_id": "u044844077"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": " $a[$i]) {\n $max = $sai;\n } elseif ($sai == $a[$i]) {\n sort($b);\n $max = $b[1];\n }\n echo $max . PHP_EOL;\n}\n\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 354, "cpu_time_ms": 2104, "memory_kb": 8696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s618770777", "group_id": "codeNet:p02971", "input_text": " $v){\n if($v == $max){\n $array = array();\n $array = $stdin;\n unset($array[$k]);\n $ans .= max($array) . PHP_EOL;\n }else{\n $ans .= $max . PHP_EOL;\n }\n}\n\n\n\n\n\necho $ans . PHP_EOL;", "language": "PHP", "metadata": {"date": 1563674801, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/PHP/s618770777.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s618770777", "user_id": "u961087635"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": " $v){\n if($v == $max){\n $array = array();\n $array = $stdin;\n unset($array[$k]);\n $ans .= max($array) . PHP_EOL;\n }else{\n $ans .= $max . PHP_EOL;\n }\n}\n\n\n\n\n\necho $ans . PHP_EOL;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 421, "cpu_time_ms": 2107, "memory_kb": 62580}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s660255375", "group_id": "codeNet:p02972", "input_text": " 0; $i--) {\n $sum = 0;\n for ($j = 2; $i * $j <= $n; $j++) {\n if (isset($b[$i * $j])) {\n $sum++;\n }\n }\n if ($sum % 2 != $a[$i]) {\n $b[$i] = true;\n $result[] = $i;\n }\n}\n$cnt = count($b);\necho $cnt.PHP_EOL;\nif ($cnt > 0) {\n echo implode(\" \", $result).PHP_EOL;\n}\n?>", "language": "PHP", "metadata": {"date": 1564875498, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/PHP/s660255375.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s660255375", "user_id": "u055687468"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": " 0; $i--) {\n $sum = 0;\n for ($j = 2; $i * $j <= $n; $j++) {\n if (isset($b[$i * $j])) {\n $sum++;\n }\n }\n if ($sum % 2 != $a[$i]) {\n $b[$i] = true;\n $result[] = $i;\n }\n}\n$cnt = count($b);\necho $cnt.PHP_EOL;\nif ($cnt > 0) {\n echo implode(\" \", $result).PHP_EOL;\n}\n?>", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 477, "cpu_time_ms": 203, "memory_kb": 28272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s438079631", "group_id": "codeNet:p02972", "input_text": "$half;$i--){\n\n if($array[$i] == 1){\n $box[$i+1] = $i+1;\n }\n\n}\n$short = intdiv($half, 5);\nfor($i = $half; $i >$short; $i--){\n $check = ($i+1)*2;\n $flag = 0;\n while($check <= $n){\n $flag = ($flag + isset($box[$check])?1:0)%2;\n $check = $check * 2;\n }\n if(($flag && $array[$i] == 0) || !$flag && $array[$i] == 1){\n $box[$i+1] = $i+1;\n }\n}\n\nfor($i = $short; $i >0; $i--){\n $check = ($i+1);\n $double = $check*2;\n if(isset($box[$double])){\n $flag = 1;\n }else{\n $flag = 0;\n }\n $loop = $check + $double;\n while($loop <= $n){\n $flag = ($flag + isset($box[$loop])?1:0)%2;\n $loop = $loop + $double;\n }\n if(($flag && $array[$i] == 0) || !$flag && $array[$i] == 1){\n $box[$i+1] = $i+1;\n }\n}\nif(isset($box)) {\n $m = count($box);\n}else{\n $m = 0;\n $p = 1;\n}\n$num = $m % 2;\nif($array[0] == 1){\n if($num == 0){\n $box[1] = 1;\n $m++;\n }\n}elseif($num == 1){\n $box[1] = 1;\n $m++;\n}\n\necho $m.PHP_EOL;\nif($m == 0){\n echo 0;\n}else{\n echo implode(\" \", $box);\n}\n\n", "language": "PHP", "metadata": {"date": 1563673878, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/PHP/s438079631.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s438079631", "user_id": "u274811210"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "$half;$i--){\n\n if($array[$i] == 1){\n $box[$i+1] = $i+1;\n }\n\n}\n$short = intdiv($half, 5);\nfor($i = $half; $i >$short; $i--){\n $check = ($i+1)*2;\n $flag = 0;\n while($check <= $n){\n $flag = ($flag + isset($box[$check])?1:0)%2;\n $check = $check * 2;\n }\n if(($flag && $array[$i] == 0) || !$flag && $array[$i] == 1){\n $box[$i+1] = $i+1;\n }\n}\n\nfor($i = $short; $i >0; $i--){\n $check = ($i+1);\n $double = $check*2;\n if(isset($box[$double])){\n $flag = 1;\n }else{\n $flag = 0;\n }\n $loop = $check + $double;\n while($loop <= $n){\n $flag = ($flag + isset($box[$loop])?1:0)%2;\n $loop = $loop + $double;\n }\n if(($flag && $array[$i] == 0) || !$flag && $array[$i] == 1){\n $box[$i+1] = $i+1;\n }\n}\nif(isset($box)) {\n $m = count($box);\n}else{\n $m = 0;\n $p = 1;\n}\n$num = $m % 2;\nif($array[0] == 1){\n if($num == 0){\n $box[1] = 1;\n $m++;\n }\n}elseif($num == 1){\n $box[1] = 1;\n $m++;\n}\n\necho $m.PHP_EOL;\nif($m == 0){\n echo 0;\n}else{\n echo implode(\" \", $box);\n}\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1210, "cpu_time_ms": 144, "memory_kb": 25328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s655389593", "group_id": "codeNet:p02973", "input_text": " 1) {\n $mid = intdiv($ok + $ng, 2);\n if ($ends[$mid] < $a[$i]) $ok = $mid;\n else $ng = $mid;\n }\n // 見つからない場合はok=lなので要素が追加される\n $ends[$ok] = $a[$i];\n}\necho count($ends);\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1594914059, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p02973.html", "problem_id": "p02973", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02973/input.txt", "sample_output_relpath": "derived/input_output/data/p02973/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02973/PHP/s655389593.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s655389593", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " 1) {\n $mid = intdiv($ok + $ng, 2);\n if ($ends[$mid] < $a[$i]) $ok = $mid;\n else $ng = $mid;\n }\n // 見つからない場合はok=lなので要素が追加される\n $ends[$ok] = $a[$i];\n}\necho count($ends);\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence with N integers: A = \\{ A_1, A_2, \\cdots, A_N \\}.\nFor each of these N integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:\n\nIf A_i and A_j (i < j) are painted with the same color, A_i < A_j.\n\nFind the minimum number of colors required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of colors required to satisfy the condition.\n\nSample Input 1\n\n5\n2\n1\n4\n5\n3\n\nSample Output 1\n\n2\n\nWe can satisfy the condition with two colors by, for example, painting 2 and 3 red and painting 1, 4, and 5 blue.\n\nSample Input 2\n\n4\n0\n0\n0\n0\n\nSample Output 2\n\n4\n\nWe have to paint all the integers with distinct colors.", "sample_input": "5\n2\n1\n4\n5\n3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02973", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence with N integers: A = \\{ A_1, A_2, \\cdots, A_N \\}.\nFor each of these N integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:\n\nIf A_i and A_j (i < j) are painted with the same color, A_i < A_j.\n\nFind the minimum number of colors required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of colors required to satisfy the condition.\n\nSample Input 1\n\n5\n2\n1\n4\n5\n3\n\nSample Output 1\n\n2\n\nWe can satisfy the condition with two colors by, for example, painting 2 and 3 red and painting 1, 4, and 5 blue.\n\nSample Input 2\n\n4\n0\n0\n0\n0\n\nSample Output 2\n\n4\n\nWe have to paint all the integers with distinct colors.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 854, "cpu_time_ms": 129, "memory_kb": 24092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s853000346", "group_id": "codeNet:p02973", "input_text": "= $c){\n echo $c;\n}else{\n echo $r;\n}", "language": "PHP", "metadata": {"date": 1588303802, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02981.html", "problem_id": "p02981", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02981/input.txt", "sample_output_relpath": "derived/input_output/data/p02981/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02981/PHP/s499794281.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s499794281", "user_id": "u280551395"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "= $c){\n echo $c;\n}else{\n echo $r;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "sample_input": "4 2 9\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02981", "source_text": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 109, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s087306385", "group_id": "codeNet:p02982", "input_text": "0){\n $count++;\n }\n }\n}\n \n echo ($count).\"\\n\";\n \n?>", "language": "PHP", "metadata": {"date": 1562550982, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02982.html", "problem_id": "p02982", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02982/input.txt", "sample_output_relpath": "derived/input_output/data/p02982/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02982/PHP/s976407832.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s976407832", "user_id": "u109925697"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "0){\n $count++;\n }\n }\n}\n \n echo ($count).\"\\n\";\n \n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N points in a D-dimensional space.\n\nThe coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).\n\nThe distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \\sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}.\n\nHow many pairs (i, j) (i < j) are there such that the distance between the i-th point and the j-th point is an integer?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10\n\n1 \\leq D \\leq 10\n\n-20 \\leq X_{ij} \\leq 20\n\nNo two given points have the same coordinates. That is, if i \\neq j, there exists k such that X_{ik} \\neq X_{jk}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_{11} X_{12} ... X_{1D}\nX_{21} X_{22} ... X_{2D}\n\\vdots\nX_{N1} X_{N2} ... X_{ND}\n\nOutput\n\nPrint the number of pairs (i, j) (i < j) such that the distance between the i-th point and the j-th point is an integer.\n\nSample Input 1\n\n3 2\n1 2\n5 5\n-2 8\n\nSample Output 1\n\n1\n\nThe number of pairs with an integer distance is one, as follows:\n\nThe distance between the first point and the second point is \\sqrt{|1-5|^2 + |2-5|^2} = 5, which is an integer.\n\nThe distance between the second point and the third point is \\sqrt{|5-(-2)|^2 + |5-8|^2} = \\sqrt{58}, which is not an integer.\n\nThe distance between the third point and the first point is \\sqrt{|-2-1|^2+|8-2|^2} = 3\\sqrt{5}, which is not an integer.\n\nSample Input 2\n\n3 4\n-3 7 8 2\n-12 1 10 2\n-2 8 9 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 1\n1\n2\n3\n4\n5\n\nSample Output 3\n\n10", "sample_input": "3 2\n1 2\n5 5\n-2 8\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02982", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N points in a D-dimensional space.\n\nThe coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).\n\nThe distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \\sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}.\n\nHow many pairs (i, j) (i < j) are there such that the distance between the i-th point and the j-th point is an integer?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10\n\n1 \\leq D \\leq 10\n\n-20 \\leq X_{ij} \\leq 20\n\nNo two given points have the same coordinates. That is, if i \\neq j, there exists k such that X_{ik} \\neq X_{jk}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_{11} X_{12} ... X_{1D}\nX_{21} X_{22} ... X_{2D}\n\\vdots\nX_{N1} X_{N2} ... X_{ND}\n\nOutput\n\nPrint the number of pairs (i, j) (i < j) such that the distance between the i-th point and the j-th point is an integer.\n\nSample Input 1\n\n3 2\n1 2\n5 5\n-2 8\n\nSample Output 1\n\n1\n\nThe number of pairs with an integer distance is one, as follows:\n\nThe distance between the first point and the second point is \\sqrt{|1-5|^2 + |2-5|^2} = 5, which is an integer.\n\nThe distance between the second point and the third point is \\sqrt{|5-(-2)|^2 + |5-8|^2} = \\sqrt{58}, which is not an integer.\n\nThe distance between the third point and the first point is \\sqrt{|-2-1|^2+|8-2|^2} = 3\\sqrt{5}, which is not an integer.\n\nSample Input 2\n\n3 4\n-3 7 8 2\n-12 1 10 2\n-2 8 9 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 1\n1\n2\n3\n4\n5\n\nSample Output 3\n\n10", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 543, "cpu_time_ms": 19, "memory_kb": 4984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s735193891", "group_id": "codeNet:p02987", "input_text": "", "language": "PHP", "metadata": {"date": 1576529411, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02987/input.txt", "sample_output_relpath": "derived/input_output/data/p02987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02987/PHP/s735193891.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s735193891", "user_id": "u397596606"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 129, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s188761464", "group_id": "codeNet:p02987", "input_text": " $p[$i] && $p[$i] >= $p[$i + 1] ){\n $count++;\n }\n}\n\necho $count;", "language": "PHP", "metadata": {"date": 1573071909, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02988.html", "problem_id": "p02988", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02988/input.txt", "sample_output_relpath": "derived/input_output/data/p02988/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02988/PHP/s681502160.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s681502160", "user_id": "u078274014"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $p[$i] && $p[$i] >= $p[$i + 1] ){\n $count++;\n }\n}\n\necho $count;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "sample_input": "5\n1 3 5 4 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02988", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 289, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s153452752", "group_id": "codeNet:p02988", "input_text": " $arr[$i] && $arr[$i+1] < $arr[$i]) $ans++;\n elseif($arr[$i - 1] < $arr[$i] && $arr[$i+1] > $arr[$i]) $ans++;\n}\necho $ans, PHP_EOL;", "language": "PHP", "metadata": {"date": 1570507363, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02988.html", "problem_id": "p02988", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02988/input.txt", "sample_output_relpath": "derived/input_output/data/p02988/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02988/PHP/s153452752.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s153452752", "user_id": "u762933560"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $arr[$i] && $arr[$i+1] < $arr[$i]) $ans++;\n elseif($arr[$i - 1] < $arr[$i] && $arr[$i+1] > $arr[$i]) $ans++;\n}\necho $ans, PHP_EOL;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "sample_input": "5\n1 3 5 4 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02988", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s892540831", "group_id": "codeNet:p02988", "input_text": " $input[$i] && $input[$i] > $input[$i + 1])) {\n $count++;\n \n }\n}\necho $count;\n?>", "language": "PHP", "metadata": {"date": 1561947923, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02988.html", "problem_id": "p02988", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02988/input.txt", "sample_output_relpath": "derived/input_output/data/p02988/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02988/PHP/s892540831.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s892540831", "user_id": "u044844077"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $input[$i] && $input[$i] > $input[$i + 1])) {\n $count++;\n \n }\n}\necho $count;\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "sample_input": "5\n1 3 5 4 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02988", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 320, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s271749620", "group_id": "codeNet:p02993", "input_text": "", "language": "PHP", "metadata": {"date": 1561253773, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02993/input.txt", "sample_output_relpath": "derived/input_output/data/p02993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02993/PHP/s527893817.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s527893817", "user_id": "u042425771"}, "prompt_components": {"gold_output": "Bad\n", "input_to_evaluate": " ", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "sample_input": "3776\n"}, "reference_outputs": ["Bad\n"], "source_document_id": "p02993", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 306, "cpu_time_ms": 13, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s226149778", "group_id": "codeNet:p02993", "input_text": "", "language": "PHP", "metadata": {"date": 1561253163, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02993/input.txt", "sample_output_relpath": "derived/input_output/data/p02993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02993/PHP/s226149778.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s226149778", "user_id": "u728165608"}, "prompt_components": {"gold_output": "Bad\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "sample_input": "3776\n"}, "reference_outputs": ["Bad\n"], "source_document_id": "p02993", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 244, "cpu_time_ms": 11, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s580954061", "group_id": "codeNet:p02993", "input_text": "\n", "language": "PHP", "metadata": {"date": 1561252859, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02993/input.txt", "sample_output_relpath": "derived/input_output/data/p02993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02993/PHP/s580954061.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s580954061", "user_id": "u895983227"}, "prompt_components": {"gold_output": "Bad\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "sample_input": "3776\n"}, "reference_outputs": ["Bad\n"], "source_document_id": "p02993", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 203, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s373398897", "group_id": "codeNet:p02994", "input_text": " abs($result[$i])){\n $min = $result[$i];\n }\n}\necho array_sum($result) - $min,PHP_EOL;", "language": "PHP", "metadata": {"date": 1561254942, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02994.html", "problem_id": "p02994", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02994/input.txt", "sample_output_relpath": "derived/input_output/data/p02994/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02994/PHP/s373398897.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s373398897", "user_id": "u175840996"}, "prompt_components": {"gold_output": "18\n", "input_to_evaluate": " abs($result[$i])){\n $min = $result[$i];\n }\n}\necho array_sum($result) - $min,PHP_EOL;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "sample_input": "5 2\n"}, "reference_outputs": ["18\n"], "source_document_id": "p02994", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 274, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s736784708", "group_id": "codeNet:p02994", "input_text": " abs($apple)){\n $check = $apple;\n }\n}\n$total -= $check;\n\nprint $total;", "language": "PHP", "metadata": {"date": 1561254264, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02994.html", "problem_id": "p02994", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02994/input.txt", "sample_output_relpath": "derived/input_output/data/p02994/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02994/PHP/s736784708.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s736784708", "user_id": "u021310602"}, "prompt_components": {"gold_output": "18\n", "input_to_evaluate": " abs($apple)){\n $check = $apple;\n }\n}\n$total -= $check;\n\nprint $total;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "sample_input": "5 2\n"}, "reference_outputs": ["18\n"], "source_document_id": "p02994", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 273, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s487671234", "group_id": "codeNet:p02995", "input_text": " $m) list($m, $n) = array($n, $m);\n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n }\n\n function lcm($m, $n){\n return $m * $n / gcd($m, $n);\n }\n \n $cd = lcm($c,$d);\n \n $a--;\n if($c>$b && $d>$b){\n echo $b-$a;\n exit;\n }\n \n $count1 = (int)($b/$c)-(int)($a/$c);\n $count2 = (int)($b/$d)-(int)($a/$d);\n $count3 = (int)($b/$cd)-(int)($a/$cd);\n echo ($b-$a)-($count1+$count2-$count3);", "language": "PHP", "metadata": {"date": 1591115744, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02995/input.txt", "sample_output_relpath": "derived/input_output/data/p02995/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02995/PHP/s487671234.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s487671234", "user_id": "u769447691"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $m) list($m, $n) = array($n, $m);\n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n }\n\n function lcm($m, $n){\n return $m * $n / gcd($m, $n);\n }\n \n $cd = lcm($c,$d);\n \n $a--;\n if($c>$b && $d>$b){\n echo $b-$a;\n exit;\n }\n \n $count1 = (int)($b/$c)-(int)($a/$c);\n $count2 = (int)($b/$d)-(int)($a/$d);\n $count3 = (int)($b/$cd)-(int)($a/$cd);\n echo ($b-$a)-($count1+$count2-$count3);", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "sample_input": "4 9 2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02995", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 559, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s554520376", "group_id": "codeNet:p02995", "input_text": " $m) list($m, $n) = array($n, $m);\n \n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n}\n \n//最小公倍数\nfunction lcm($m, $n){\n return $m * $n / gcd($m, $n);\n}", "language": "PHP", "metadata": {"date": 1561472189, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02995/input.txt", "sample_output_relpath": "derived/input_output/data/p02995/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02995/PHP/s554520376.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s554520376", "user_id": "u846084461"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $m) list($m, $n) = array($n, $m);\n \n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n}\n \n//最小公倍数\nfunction lcm($m, $n){\n return $m * $n / gcd($m, $n);\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "sample_input": "4 9 2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02995", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 718, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s626130192", "group_id": "codeNet:p02995", "input_text": " const INPUT_DELIMITER = \" \";\n\n // 最小公倍数を求める\n function getLCM ($a, $b) {\n return $a * $b / getGCM($a, $b);\n }\n\n // 最大公約数を求める\n function getGCM ($a, $b) {\n if ($a < $b) {\n list($min, $max) = [$a, $b];\n } else {\n list($min, $max) = [$b, $a];\n }\n\n $mod = $max % $min;\n if ($mod === 0) {\n return $min;\n }\n\n return getGCM($min, $mod);\n }\n\n // 入力\n $input = fgets(STDIN);\n $inputArray = explode(INPUT_DELIMITER, $input);\n\n $A = $inputArray[0];\n $B = $inputArray[1];\n $C = $inputArray[2];\n $D = $inputArray[3];\n\n \n // CとDの公倍数\n $CD = getLCM($C, $D);\n\n $range = $B - $A;\n // 割り切れないものの個数\n $countC = floor($range / $C);\n $countD = floor($range / $D);\n $countCD = floor($range / $CD);\n\n // \n $count = bcsub($range , ($countC + $countD - $countCD));\n\n echo $count;\n", "language": "PHP", "metadata": {"date": 1561308550, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02995/input.txt", "sample_output_relpath": "derived/input_output/data/p02995/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02995/PHP/s626130192.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s626130192", "user_id": "u812146724"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " const INPUT_DELIMITER = \" \";\n\n // 最小公倍数を求める\n function getLCM ($a, $b) {\n return $a * $b / getGCM($a, $b);\n }\n\n // 最大公約数を求める\n function getGCM ($a, $b) {\n if ($a < $b) {\n list($min, $max) = [$a, $b];\n } else {\n list($min, $max) = [$b, $a];\n }\n\n $mod = $max % $min;\n if ($mod === 0) {\n return $min;\n }\n\n return getGCM($min, $mod);\n }\n\n // 入力\n $input = fgets(STDIN);\n $inputArray = explode(INPUT_DELIMITER, $input);\n\n $A = $inputArray[0];\n $B = $inputArray[1];\n $C = $inputArray[2];\n $D = $inputArray[3];\n\n \n // CとDの公倍数\n $CD = getLCM($C, $D);\n\n $range = $B - $A;\n // 割り切れないものの個数\n $countC = floor($range / $C);\n $countD = floor($range / $D);\n $countCD = floor($range / $CD);\n\n // \n $count = bcsub($range , ($countC + $countD - $countCD));\n\n echo $count;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "sample_input": "4 9 2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02995", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 986, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s086316722", "group_id": "codeNet:p02999", "input_text": "= 10){\n echo 10;\n}\n\n\n\n\n", "language": "PHP", "metadata": {"date": 1572972577, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p02999.html", "problem_id": "p02999", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02999/input.txt", "sample_output_relpath": "derived/input_output/data/p02999/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02999/PHP/s086316722.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s086316722", "user_id": "u078274014"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "= 10){\n echo 10;\n}\n\n\n\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02999", "source_text": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 135, "cpu_time_ms": 10, "memory_kb": 3704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s885832887", "group_id": "codeNet:p02999", "input_text": " $x) {\n $c = $i + 1;\n break;\n }\n}\necho $c;\n?>\n", "language": "PHP", "metadata": {"date": 1560712645, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03000.html", "problem_id": "p03000", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03000/input.txt", "sample_output_relpath": "derived/input_output/data/p03000/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03000/PHP/s651002966.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s651002966", "user_id": "u380019875"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $x) {\n $c = $i + 1;\n break;\n }\n}\necho $c;\n?>\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "sample_input": "3 6\n3 4 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03000", "source_text": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 221, "cpu_time_ms": 13, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s187973020", "group_id": "codeNet:p03001", "input_text": "$x,'y'=>$y);\n}\n\n\nfor($i=0;$i<$N;$i++){\n for($j=$i+1;$j<$N;$j++){\n $p = $xy[$i]['x']-$xy[$j]['x'];\n $q = $xy[$i]['y']-$xy[$j]['y'];\n if(isset($pq[$p.'-'.$q])){\n $pq[$p.'-'.$q] = $pq[$p.'-'.$q]+1;\n }else{\n $pq[$p.'-'.$q] = 1;\n }\n }\n}\narsort($pq);\n\nforeach($pq as $value){\n echo ($N-$value).\"\\n\";\n exit;\n}\n \n?>", "language": "PHP", "metadata": {"date": 1560648414, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03006.html", "problem_id": "p03006", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03006/input.txt", "sample_output_relpath": "derived/input_output/data/p03006/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03006/PHP/s856696757.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s856696757", "user_id": "u109925697"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$x,'y'=>$y);\n}\n\n\nfor($i=0;$i<$N;$i++){\n for($j=$i+1;$j<$N;$j++){\n $p = $xy[$i]['x']-$xy[$j]['x'];\n $q = $xy[$i]['y']-$xy[$j]['y'];\n if(isset($pq[$p.'-'.$q])){\n $pq[$p.'-'.$q] = $pq[$p.'-'.$q]+1;\n }else{\n $pq[$p.'-'.$q] = 1;\n }\n }\n}\narsort($pq);\n\nforeach($pq as $value){\n echo ($N-$value).\"\\n\";\n exit;\n}\n \n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N balls in a two-dimensional plane. The i-th ball is at coordinates (x_i, y_i).\n\nWe will collect all of these balls, by choosing two integers p and q such that p \\neq 0 or q \\neq 0 and then repeating the following operation:\n\nChoose a ball remaining in the plane and collect it. Let (a, b) be the coordinates of this ball. If we collected a ball at coordinates (a - p, b - q) in the previous operation, the cost of this operation is 0. Otherwise, including when this is the first time to do this operation, the cost of this operation is 1.\n\nFind the minimum total cost required to collect all the balls when we optimally choose p and q.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n|x_i|, |y_i| \\leq 10^9\n\nIf i \\neq j, x_i \\neq x_j or y_i \\neq y_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum total cost required to collect all the balls.\n\nSample Input 1\n\n2\n1 1\n2 2\n\nSample Output 1\n\n1\n\nIf we choose p = 1, q = 1, we can collect all the balls at a cost of 1 by collecting them in the order (1, 1), (2, 2).\n\nSample Input 2\n\n3\n1 4\n4 6\n7 8\n\nSample Output 2\n\n1\n\nIf we choose p = -3, q = -2, we can collect all the balls at a cost of 1 by collecting them in the order (7, 8), (4, 6), (1, 4).\n\nSample Input 3\n\n4\n1 1\n1 2\n2 1\n2 2\n\nSample Output 3\n\n2", "sample_input": "2\n1 1\n2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03006", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N balls in a two-dimensional plane. The i-th ball is at coordinates (x_i, y_i).\n\nWe will collect all of these balls, by choosing two integers p and q such that p \\neq 0 or q \\neq 0 and then repeating the following operation:\n\nChoose a ball remaining in the plane and collect it. Let (a, b) be the coordinates of this ball. If we collected a ball at coordinates (a - p, b - q) in the previous operation, the cost of this operation is 0. Otherwise, including when this is the first time to do this operation, the cost of this operation is 1.\n\nFind the minimum total cost required to collect all the balls when we optimally choose p and q.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n|x_i|, |y_i| \\leq 10^9\n\nIf i \\neq j, x_i \\neq x_j or y_i \\neq y_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum total cost required to collect all the balls.\n\nSample Input 1\n\n2\n1 1\n2 2\n\nSample Output 1\n\n1\n\nIf we choose p = 1, q = 1, we can collect all the balls at a cost of 1 by collecting them in the order (1, 1), (2, 2).\n\nSample Input 2\n\n3\n1 4\n4 6\n7 8\n\nSample Output 2\n\n1\n\nIf we choose p = -3, q = -2, we can collect all the balls at a cost of 1 by collecting them in the order (7, 8), (4, 6), (1, 4).\n\nSample Input 3\n\n4\n1 1\n1 2\n2 1\n2 2\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 457, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s040693548", "group_id": "codeNet:p03007", "input_text": "0;$i++){\n $str[]=$numArray[$N-$i].\" \".$numArray[1];\n $numArray[$N-$i]=$numArray[$N-$i]-$numArray[1];\n array_splice($numArray, 1, 1);\n}\n\nsort($numArray);\n$M=count($numArray);\nfor($j=1;$j<$M;$j++){\n $str[]= $numArray[$j].\" \".$numArray[0];\n $numArray[0]=$numArray[$j]-$numArray[0];\n}\n\n echo ($numArray[0]).\"\\n\";\nforeach($str as $s){\n echo ($s).\"\\n\";\n}\n \n?>", "language": "PHP", "metadata": {"date": 1560653269, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03007.html", "problem_id": "p03007", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03007/input.txt", "sample_output_relpath": "derived/input_output/data/p03007/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03007/PHP/s040693548.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s040693548", "user_id": "u109925697"}, "prompt_components": {"gold_output": "4\n-1 1\n2 -2\n", "input_to_evaluate": "0;$i++){\n $str[]=$numArray[$N-$i].\" \".$numArray[1];\n $numArray[$N-$i]=$numArray[$N-$i]-$numArray[1];\n array_splice($numArray, 1, 1);\n}\n\nsort($numArray);\n$M=count($numArray);\nfor($j=1;$j<$M;$j++){\n $str[]= $numArray[$j].\" \".$numArray[0];\n $numArray[0]=$numArray[$j]-$numArray[0];\n}\n\n echo ($numArray[0]).\"\\n\";\nforeach($str as $s){\n echo ($s).\"\\n\";\n}\n \n?>", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on a blackboard.\n\nWe will repeat the following operation N-1 times so that we have only one integer on the blackboard.\n\nChoose two integers x and y on the blackboard and erase these two integers. Then, write a new integer x-y.\n\nFind the maximum possible value of the final integer on the blackboard and a sequence of operations that maximizes the final integer.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-10^4 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value M of the final integer on the blackboard, and a sequence of operations x_i, y_i that maximizes the final integer, in the format below.\n\nHere x_i and y_i represent the integers x and y chosen in the i-th operation, respectively.\n\nIf there are multiple sequences of operations that maximize the final integer, any of them will be accepted.\n\nM\nx_1 y_1\n:\nx_{N-1} y_{N-1}\n\nSample Input 1\n\n3\n1 -1 2\n\nSample Output 1\n\n4\n-1 1\n2 -2\n\nIf we choose x = -1 and y = 1 in the first operation, the set of integers written on the blackboard becomes (-2, 2).\n\nThen, if we choose x = 2 and y = -2 in the second operation, the set of integers written on the blackboard becomes (4).\n\nIn this case, we have 4 as the final integer. We cannot end with a greater integer, so the answer is 4.\n\nSample Input 2\n\n3\n1 1 1\n\nSample Output 2\n\n1\n1 1\n1 0", "sample_input": "3\n1 -1 2\n"}, "reference_outputs": ["4\n-1 1\n2 -2\n"], "source_document_id": "p03007", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on a blackboard.\n\nWe will repeat the following operation N-1 times so that we have only one integer on the blackboard.\n\nChoose two integers x and y on the blackboard and erase these two integers. Then, write a new integer x-y.\n\nFind the maximum possible value of the final integer on the blackboard and a sequence of operations that maximizes the final integer.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-10^4 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value M of the final integer on the blackboard, and a sequence of operations x_i, y_i that maximizes the final integer, in the format below.\n\nHere x_i and y_i represent the integers x and y chosen in the i-th operation, respectively.\n\nIf there are multiple sequences of operations that maximize the final integer, any of them will be accepted.\n\nM\nx_1 y_1\n:\nx_{N-1} y_{N-1}\n\nSample Input 1\n\n3\n1 -1 2\n\nSample Output 1\n\n4\n-1 1\n2 -2\n\nIf we choose x = -1 and y = 1 in the first operation, the set of integers written on the blackboard becomes (-2, 2).\n\nThen, if we choose x = 2 and y = -2 in the second operation, the set of integers written on the blackboard becomes (4).\n\nIn this case, we have 4 as the final integer. We cannot end with a greater integer, so the answer is 4.\n\nSample Input 2\n\n3\n1 1 1\n\nSample Output 2\n\n1\n1 1\n1 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 529, "cpu_time_ms": 2108, "memory_kb": 20980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s199310361", "group_id": "codeNet:p03007", "input_text": "", "language": "PHP", "metadata": {"date": 1567021751, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03011.html", "problem_id": "p03011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03011/input.txt", "sample_output_relpath": "derived/input_output/data/p03011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03011/PHP/s094027944.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s094027944", "user_id": "u216734998"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are three airports A, B and C, and flights between each pair of airports in both directions.\n\nA one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.\n\nConsider a route where we start at one of the airports, fly to another airport and then fly to the other airport.\n\nWhat is the minimum possible sum of the flight times?\n\nConstraints\n\n1 \\leq P,Q,R \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nP Q R\n\nOutput\n\nPrint the minimum possible sum of the flight times.\n\nSample Input 1\n\n1 3 4\n\nSample Output 1\n\n4\n\nThe sum of the flight times in the route A \\rightarrow B \\rightarrow C: 1 + 3 = 4 hours\n\nThe sum of the flight times in the route A \\rightarrow C \\rightarrow C: 4 + 3 = 7 hours\n\nThe sum of the flight times in the route B \\rightarrow A \\rightarrow C: 1 + 4 = 5 hours\n\nThe sum of the flight times in the route B \\rightarrow C \\rightarrow A: 3 + 4 = 7 hours\n\nThe sum of the flight times in the route C \\rightarrow A \\rightarrow B: 4 + 1 = 5 hours\n\nThe sum of the flight times in the route C \\rightarrow B \\rightarrow A: 3 + 1 = 4 hours\n\nThe minimum of these is 4 hours.\n\nSample Input 2\n\n3 2 3\n\nSample Output 2\n\n5", "sample_input": "1 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are three airports A, B and C, and flights between each pair of airports in both directions.\n\nA one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.\n\nConsider a route where we start at one of the airports, fly to another airport and then fly to the other airport.\n\nWhat is the minimum possible sum of the flight times?\n\nConstraints\n\n1 \\leq P,Q,R \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nP Q R\n\nOutput\n\nPrint the minimum possible sum of the flight times.\n\nSample Input 1\n\n1 3 4\n\nSample Output 1\n\n4\n\nThe sum of the flight times in the route A \\rightarrow B \\rightarrow C: 1 + 3 = 4 hours\n\nThe sum of the flight times in the route A \\rightarrow C \\rightarrow C: 4 + 3 = 7 hours\n\nThe sum of the flight times in the route B \\rightarrow A \\rightarrow C: 1 + 4 = 5 hours\n\nThe sum of the flight times in the route B \\rightarrow C \\rightarrow A: 3 + 4 = 7 hours\n\nThe sum of the flight times in the route C \\rightarrow A \\rightarrow B: 4 + 1 = 5 hours\n\nThe sum of the flight times in the route C \\rightarrow B \\rightarrow A: 3 + 1 = 4 hours\n\nThe minimum of these is 4 hours.\n\nSample Input 2\n\n3 2 3\n\nSample Output 2\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 83, "cpu_time_ms": 11, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s973454019", "group_id": "codeNet:p03011", "input_text": "", "language": "PHP", "metadata": {"date": 1566872636, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03011.html", "problem_id": "p03011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03011/input.txt", "sample_output_relpath": "derived/input_output/data/p03011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03011/PHP/s973454019.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s973454019", "user_id": "u471479986"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are three airports A, B and C, and flights between each pair of airports in both directions.\n\nA one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.\n\nConsider a route where we start at one of the airports, fly to another airport and then fly to the other airport.\n\nWhat is the minimum possible sum of the flight times?\n\nConstraints\n\n1 \\leq P,Q,R \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nP Q R\n\nOutput\n\nPrint the minimum possible sum of the flight times.\n\nSample Input 1\n\n1 3 4\n\nSample Output 1\n\n4\n\nThe sum of the flight times in the route A \\rightarrow B \\rightarrow C: 1 + 3 = 4 hours\n\nThe sum of the flight times in the route A \\rightarrow C \\rightarrow C: 4 + 3 = 7 hours\n\nThe sum of the flight times in the route B \\rightarrow A \\rightarrow C: 1 + 4 = 5 hours\n\nThe sum of the flight times in the route B \\rightarrow C \\rightarrow A: 3 + 4 = 7 hours\n\nThe sum of the flight times in the route C \\rightarrow A \\rightarrow B: 4 + 1 = 5 hours\n\nThe sum of the flight times in the route C \\rightarrow B \\rightarrow A: 3 + 1 = 4 hours\n\nThe minimum of these is 4 hours.\n\nSample Input 2\n\n3 2 3\n\nSample Output 2\n\n5", "sample_input": "1 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are three airports A, B and C, and flights between each pair of airports in both directions.\n\nA one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.\n\nConsider a route where we start at one of the airports, fly to another airport and then fly to the other airport.\n\nWhat is the minimum possible sum of the flight times?\n\nConstraints\n\n1 \\leq P,Q,R \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nP Q R\n\nOutput\n\nPrint the minimum possible sum of the flight times.\n\nSample Input 1\n\n1 3 4\n\nSample Output 1\n\n4\n\nThe sum of the flight times in the route A \\rightarrow B \\rightarrow C: 1 + 3 = 4 hours\n\nThe sum of the flight times in the route A \\rightarrow C \\rightarrow C: 4 + 3 = 7 hours\n\nThe sum of the flight times in the route B \\rightarrow A \\rightarrow C: 1 + 4 = 5 hours\n\nThe sum of the flight times in the route B \\rightarrow C \\rightarrow A: 3 + 4 = 7 hours\n\nThe sum of the flight times in the route C \\rightarrow A \\rightarrow B: 4 + 1 = 5 hours\n\nThe sum of the flight times in the route C \\rightarrow B \\rightarrow A: 3 + 1 = 4 hours\n\nThe minimum of these is 4 hours.\n\nSample Input 2\n\n3 2 3\n\nSample Output 2\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 83, "cpu_time_ms": 10, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s455451883", "group_id": "codeNet:p03012", "input_text": " $preDif && is_numeric($preDif)){\n break;\n }\n $preDif = $curDif;\n }\n\n echo $preDif;\n\n?>\n", "language": "PHP", "metadata": {"date": 1560577051, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03012.html", "problem_id": "p03012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03012/input.txt", "sample_output_relpath": "derived/input_output/data/p03012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03012/PHP/s455451883.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s455451883", "user_id": "u410334963"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": " $preDif && is_numeric($preDif)){\n break;\n }\n $preDif = $curDif;\n }\n\n echo $preDif;\n\n?>\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03012", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 406, "cpu_time_ms": 10, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s877330075", "group_id": "codeNet:p03013", "input_text": " $d){\n $flag2 = false;\n //bとcの間に3個連続する.が存在する\n for($i = $b; $i < $c - 1 ; $i++){\n if($s[$i]==\".\" && $s[$i+1]==\".\" && $s[$i+2]==\".\"){\n $flag2 = true;\n }\n }\n}else{\n $flag2 = true;\n}\necho ($flag1 && $flag2) ? \"Yes\" : \"No\";\n", "language": "PHP", "metadata": {"date": 1562676309, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03017/input.txt", "sample_output_relpath": "derived/input_output/data/p03017/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03017/PHP/s375966828.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s375966828", "user_id": "u248209126"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " $d){\n $flag2 = false;\n //bとcの間に3個連続する.が存在する\n for($i = $b; $i < $c - 1 ; $i++){\n if($s[$i]==\".\" && $s[$i+1]==\".\" && $s[$i+2]==\".\"){\n $flag2 = true;\n }\n }\n}else{\n $flag2 = true;\n}\necho ($flag1 && $flag2) ? \"Yes\" : \"No\";\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 505, "cpu_time_ms": 68, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s125240735", "group_id": "codeNet:p03017", "input_text": "$b){\n $i=$b;\n while($i<$d){\n if($s[$i]==\"#\"){\n if($s[$i+1]==\"#\"){\n echo \"No\";\n exit;\n }\n }\n ++$i;\n }\n $i=$a;\n while($i<$c){\n if($s[$i]==\"#\"){\n if($s[$i+1]==\"#\"){\n echo \"No\";\n exit;\n }\n }\n ++$i;\n }\n echo \"Yes\";\n exit;\n}else{\n $i=$a;\n $vmax=0;\n $v=0;\n while($i<$c){\n if($s[$i]==\"#\"){\n $vmax=max($vmax,$v);\n $v=0;\n if($s[$i+1]==\"#\"){\n echo \"No\";\n exit;\n }\n }else{\n ++$v;\n }\n ++$i;\n }\n $vmax=max($vmax,$v);\n if($vmax>=3){\n echo \"Yes\";\n exit;\n }else{\n echo \"No\";\n exit;\n }\n}\n", "language": "PHP", "metadata": {"date": 1559529007, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03017/input.txt", "sample_output_relpath": "derived/input_output/data/p03017/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03017/PHP/s125240735.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s125240735", "user_id": "u281500237"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$b){\n $i=$b;\n while($i<$d){\n if($s[$i]==\"#\"){\n if($s[$i+1]==\"#\"){\n echo \"No\";\n exit;\n }\n }\n ++$i;\n }\n $i=$a;\n while($i<$c){\n if($s[$i]==\"#\"){\n if($s[$i+1]==\"#\"){\n echo \"No\";\n exit;\n }\n }\n ++$i;\n }\n echo \"Yes\";\n exit;\n}else{\n $i=$a;\n $vmax=0;\n $v=0;\n while($i<$c){\n if($s[$i]==\"#\"){\n $vmax=max($vmax,$v);\n $v=0;\n if($s[$i+1]==\"#\"){\n echo \"No\";\n exit;\n }\n }else{\n ++$v;\n }\n ++$i;\n }\n $vmax=max($vmax,$v);\n if($vmax>=3){\n echo \"Yes\";\n exit;\n }else{\n echo \"No\";\n exit;\n }\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1025, "cpu_time_ms": 36, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s864326912", "group_id": "codeNet:p03026", "input_text": " $value){\n foreach($tree[$n] as $valuen => $hoge){\n $newcounttree[$n] += $counttree[$valuen]/ 20000;\n }\n}\n\nsort($str_array);\nasort($newcounttree);\n$i=0;\n$goalstr = \"\";\nforeach($newcounttree as $num => $value){\n $goaltree[$num] = $str_array[$i];\n $i++;\n}\n$sum = 0;\nforeach($hen as $array){\n $sum += min($goaltree[$array[0]],$goaltree[$array[1]]);\n}\nksort($goaltree);\necho $sum.PHP_EOL.implode(\" \",$goaltree);\n\nfunction init($n){\n global $tree;\n global $counttree;\n for($i=1;$i<=$n;$i++){\n $tree[$i] = [];\n $counttree[$i] = 0;\n }\n}\n\nfunction set($x, $y){\n global $tree;\n global $counttree;\n if(!isset($tree[$x][$y])) {\n $tree[$x][$y] = 1;\n $counttree[$x]++;\n }\n if(!isset($tree[$y][$x])) {\n $tree[$y][$x] = 1;\n $counttree[$y]++;\n }\n}\n", "language": "PHP", "metadata": {"date": 1559443322, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03026.html", "problem_id": "p03026", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03026/input.txt", "sample_output_relpath": "derived/input_output/data/p03026/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03026/PHP/s864326912.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s864326912", "user_id": "u274811210"}, "prompt_components": {"gold_output": "10\n1 2 3 4 5\n", "input_to_evaluate": " $value){\n foreach($tree[$n] as $valuen => $hoge){\n $newcounttree[$n] += $counttree[$valuen]/ 20000;\n }\n}\n\nsort($str_array);\nasort($newcounttree);\n$i=0;\n$goalstr = \"\";\nforeach($newcounttree as $num => $value){\n $goaltree[$num] = $str_array[$i];\n $i++;\n}\n$sum = 0;\nforeach($hen as $array){\n $sum += min($goaltree[$array[0]],$goaltree[$array[1]]);\n}\nksort($goaltree);\necho $sum.PHP_EOL.implode(\" \",$goaltree);\n\nfunction init($n){\n global $tree;\n global $counttree;\n for($i=1;$i<=$n;$i++){\n $tree[$i] = [];\n $counttree[$i] = 0;\n }\n}\n\nfunction set($x, $y){\n global $tree;\n global $counttree;\n if(!isset($tree[$x][$y])) {\n $tree[$x][$y] = 1;\n $counttree[$x]++;\n }\n if(!isset($tree[$y][$x])) {\n $tree[$y][$x] = 1;\n $counttree[$y]++;\n }\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a tree with N vertices 1,2,\\ldots,N, and positive integers c_1,c_2,\\ldots,c_N.\nThe i-th edge in the tree (1 \\leq i \\leq N-1) connects Vertex a_i and Vertex b_i.\n\nWe will write a positive integer on each vertex in T and calculate our score as follows:\n\nOn each edge, write the smaller of the integers written on the two endpoints.\n\nLet our score be the sum of the integers written on all the edges.\n\nFind the maximum possible score when we write each of c_1,c_2,\\ldots,c_N on one vertex in T, and show one way to achieve it. If an integer occurs multiple times in c_1,c_2,\\ldots,c_N, we must use it that number of times.\n\nConstraints\n\n1 \\leq N \\leq 10000\n\n1 \\leq a_i,b_i \\leq N\n\n1 \\leq c_i \\leq 10^5\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nc_1 \\ldots c_N\n\nOutput\n\nUse the following format:\n\nM\nd_1 \\ldots d_N\n\nwhere M is the maximum possible score, and d_i is the integer to write on Vertex i.\nd_1,d_2,\\ldots,d_N must be a permutation of c_1,c_2,\\ldots,c_N.\nIf there are multiple ways to achieve the maximum score, any of them will be accepted.\n\nSample Input 1\n\n5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n\nSample Output 1\n\n10\n1 2 3 4 5\n\nIf we write 1,2,3,4,5 on Vertex 1,2,3,4,5, respectively, the integers written on the four edges will be 1,2,3,4, for the score of 10. This is the maximum possible score.\n\nSample Input 2\n\n5\n1 2\n1 3\n1 4\n1 5\n3141 59 26 53 59\n\nSample Output 2\n\n197\n59 26 3141 59 53\n\nc_1,c_2,\\ldots,c_N may not be pairwise distinct.", "sample_input": "5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n"}, "reference_outputs": ["10\n1 2 3 4 5\n"], "source_document_id": "p03026", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a tree with N vertices 1,2,\\ldots,N, and positive integers c_1,c_2,\\ldots,c_N.\nThe i-th edge in the tree (1 \\leq i \\leq N-1) connects Vertex a_i and Vertex b_i.\n\nWe will write a positive integer on each vertex in T and calculate our score as follows:\n\nOn each edge, write the smaller of the integers written on the two endpoints.\n\nLet our score be the sum of the integers written on all the edges.\n\nFind the maximum possible score when we write each of c_1,c_2,\\ldots,c_N on one vertex in T, and show one way to achieve it. If an integer occurs multiple times in c_1,c_2,\\ldots,c_N, we must use it that number of times.\n\nConstraints\n\n1 \\leq N \\leq 10000\n\n1 \\leq a_i,b_i \\leq N\n\n1 \\leq c_i \\leq 10^5\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nc_1 \\ldots c_N\n\nOutput\n\nUse the following format:\n\nM\nd_1 \\ldots d_N\n\nwhere M is the maximum possible score, and d_i is the integer to write on Vertex i.\nd_1,d_2,\\ldots,d_N must be a permutation of c_1,c_2,\\ldots,c_N.\nIf there are multiple ways to achieve the maximum score, any of them will be accepted.\n\nSample Input 1\n\n5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n\nSample Output 1\n\n10\n1 2 3 4 5\n\nIf we write 1,2,3,4,5 on Vertex 1,2,3,4,5, respectively, the integers written on the four edges will be 1,2,3,4, for the score of 10. This is the maximum possible score.\n\nSample Input 2\n\n5\n1 2\n1 3\n1 4\n1 5\n3141 59 26 53 59\n\nSample Output 2\n\n197\n59 26 3141 59 53\n\nc_1,c_2,\\ldots,c_N may not be pairwise distinct.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1114, "cpu_time_ms": 38, "memory_kb": 17272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s847818780", "group_id": "codeNet:p03029", "input_text": " $n) continue;\n\n // 取り出した奴を入れる\n $s = [];\n $value = 0;\n\n\n for ($i = 1; $i <= $l; ++$i) {\n /* echo \" [l] i: $i, i-1: \" . ($i - 1), PHP_EOL; */\n $value += $V[$i - 1];\n $s[] = $V[$i - 1];\n }\n\n for ($i = 1; $i <= $r; ++$i) {\n /* echo \" [r] i: $i, n-i: \" . ($n - $i) . \", V: \" . $V[$n - $i], PHP_EOL; */\n $value += $V[$n - $i];\n $s[] = $V[$n - $i];\n }\n\n $bval = $value;\n\n // 取り出す数\n $d = $k - $r - $l;\n sort($s);\n for ($i = 0; $i < $d; ++$i) {\n if ($i >= count($s)) break;\n if ($s[$i] > 0) break;\n\n $value -= $s[$i];\n }\n\n $max = max($max, $value);\n /* echo \"l: $l, r: $r, d: $d, before_v: $bval, after_v: $value, max: $max\", PHP_EOL; */\n }\n}\necho $max;\n", "language": "PHP", "metadata": {"date": 1589904673, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03032.html", "problem_id": "p03032", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03032/input.txt", "sample_output_relpath": "derived/input_output/data/p03032/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03032/PHP/s497807094.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s497807094", "user_id": "u376366206"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": " $n) continue;\n\n // 取り出した奴を入れる\n $s = [];\n $value = 0;\n\n\n for ($i = 1; $i <= $l; ++$i) {\n /* echo \" [l] i: $i, i-1: \" . ($i - 1), PHP_EOL; */\n $value += $V[$i - 1];\n $s[] = $V[$i - 1];\n }\n\n for ($i = 1; $i <= $r; ++$i) {\n /* echo \" [r] i: $i, n-i: \" . ($n - $i) . \", V: \" . $V[$n - $i], PHP_EOL; */\n $value += $V[$n - $i];\n $s[] = $V[$n - $i];\n }\n\n $bval = $value;\n\n // 取り出す数\n $d = $k - $r - $l;\n sort($s);\n for ($i = 0; $i < $d; ++$i) {\n if ($i >= count($s)) break;\n if ($s[$i] > 0) break;\n\n $value -= $s[$i];\n }\n\n $max = max($max, $value);\n /* echo \"l: $l, r: $r, d: $d, before_v: $bval, after_v: $value, max: $max\", PHP_EOL; */\n }\n}\necho $max;\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "sample_input": "6 4\n-10 8 2 1 2 6\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03032", "source_text": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1087, "cpu_time_ms": 18, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s898545670", "group_id": "codeNet:p03032", "input_text": " $max){\n $max = $value;\n }\n }\n }\n }\n echo $max;\n}\n\nfunction calculate($left,$right,$delete,$array,$N){\n $arrayResult = array();\n for($i=0;$i<$left;$i++){\n $arrayResult[] = $array[$i];\n }\n for($i=0;$i<$right;$i++){\n $arrayResult[] = $array[$N-1-$i];\n }\n for($i=0;$i<$delete;$i++){\n $mins = array_keys($arrayResult, min($arrayResult));\n unset($arrayResult[$mins[0]]);\n }\n return array_sum($arrayResult);\n}\n", "language": "PHP", "metadata": {"date": 1568747030, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03032.html", "problem_id": "p03032", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03032/input.txt", "sample_output_relpath": "derived/input_output/data/p03032/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03032/PHP/s898545670.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s898545670", "user_id": "u819330049"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": " $max){\n $max = $value;\n }\n }\n }\n }\n echo $max;\n}\n\nfunction calculate($left,$right,$delete,$array,$N){\n $arrayResult = array();\n for($i=0;$i<$left;$i++){\n $arrayResult[] = $array[$i];\n }\n for($i=0;$i<$right;$i++){\n $arrayResult[] = $array[$N-1-$i];\n }\n for($i=0;$i<$delete;$i++){\n $mins = array_keys($arrayResult, min($arrayResult));\n unset($arrayResult[$mins[0]]);\n }\n return array_sum($arrayResult);\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "sample_input": "6 4\n-10 8 2 1 2 6\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03032", "source_text": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 770, "cpu_time_ms": 2104, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s765820987", "group_id": "codeNet:p03032", "input_text": " $K){\n break;\n }\n for($m=0;$m<$K;$m++){\n if($i+$j+$m > $K || $i+$j <= $m){\n break;\n }\n $value = calculate($i,$j,$m,$arrayV,$N);\n if($value > $max){\n $max = $value;\n }\n }\n }\n }\n echo $max;\n}\n\nfunction calculate($left,$right,$delete,$array,$N){\n $arrayResult = array();\n for($i=0;$i<$left;$i++){\n $arrayResult[] = $array[$i];\n }\n for($i=0;$i<$right;$i++){\n $arrayResult[] = $array[$N-1-$i];\n }\n for($i=0;$i<$delete;$i++){\n $mins = array_keys($arrayResult, min($arrayResult));\n unset($arrayResult[$mins[0]]);\n }\n return array_sum($arrayResult);\n}\n", "language": "PHP", "metadata": {"date": 1568745447, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03032.html", "problem_id": "p03032", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03032/input.txt", "sample_output_relpath": "derived/input_output/data/p03032/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03032/PHP/s765820987.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s765820987", "user_id": "u819330049"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": " $K){\n break;\n }\n for($m=0;$m<$K;$m++){\n if($i+$j+$m > $K || $i+$j <= $m){\n break;\n }\n $value = calculate($i,$j,$m,$arrayV,$N);\n if($value > $max){\n $max = $value;\n }\n }\n }\n }\n echo $max;\n}\n\nfunction calculate($left,$right,$delete,$array,$N){\n $arrayResult = array();\n for($i=0;$i<$left;$i++){\n $arrayResult[] = $array[$i];\n }\n for($i=0;$i<$right;$i++){\n $arrayResult[] = $array[$N-1-$i];\n }\n for($i=0;$i<$delete;$i++){\n $mins = array_keys($arrayResult, min($arrayResult));\n unset($arrayResult[$mins[0]]);\n }\n return array_sum($arrayResult);\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "sample_input": "6 4\n-10 8 2 1 2 6\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03032", "source_text": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 860, "cpu_time_ms": 2104, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s031051829", "group_id": "codeNet:p03032", "input_text": " $point_max) {\n $point_max = $point;\n }\n }\n}\n\necho $point_max, PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1559002782, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03032.html", "problem_id": "p03032", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03032/input.txt", "sample_output_relpath": "derived/input_output/data/p03032/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03032/PHP/s143965541.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s143965541", "user_id": "u852360042"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": " $point_max) {\n $point_max = $point;\n }\n }\n}\n\necho $point_max, PHP_EOL;\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "sample_input": "6 4\n-10 8 2 1 2 6\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03032", "source_text": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 904, "cpu_time_ms": 17, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s254127943", "group_id": "codeNet:p03035", "input_text": " $x * $i; $i++) {\n// }\n// if (strpos($s, 'RRR') !== false) {\n// $r = 3;\n// } elseif (strpos($s, 'RR') !== false) {\n// $r = 2;\n// } elseif (strpos($s, 'R') !== false) {\n// $r = 1;\n// } else {\n// $r = 0;\n// }\n// $s = \"No\";\n// if ($x >= 30) {\n// $s = \"Yes\";\n// }\n// for ($i = 0; $i * 1000 < $n; $i++) {\n// }\n// $c = \"a\";\n// if (ctype_upper($a)) {\n// $c = \"A\";\n// }\n// $s = \"Yes\";\n// echo count($arr1);\n// for ($i = 0; $i < strlen($s1); $i++) {\n// if ($arr1[$i] != $arr2[$i]) {\n// $s = \"No\";\n// }\n// }\n// $unit;\n// switch ($n % 10) {\n// case 0:\n// case 1:\n// case 6:\n// case 8:\n// $unit = \"pon\";\n// break;\n// case 3:\n// $unit = \"bon\";\n// break;\n// default:\n// $unit = \"hon\";\n// break;\n// }\n// if ($s == \"ABC\") {\n// $r = \"ARC\";\n// } else {\n// $r = \"ABC\";\n// }\n// $r = \"NG\";\n// $arr = array(\"SAT\", \"FRI\", \"THU\", \"WED\", \"TUE\", \"MON\", \"SUN\");\n// for ($i = 0; $i <= count($arr); $i++) {\n// if ($arr[$i] == $s) {\n// break;\n// }\n// }\n// $r = \"safe\";\n// if ($s <= $w) {\n// $r = \"unsafe\";\n// }\n// $r = \"No\";\n// if (strpos($n, \"7\") !== false) {\n// $r = \"Yes\";\n// }\n// $r = \"No\";\n// if ($arr[2] == $arr[3] && $arr[4] == $arr[5]) {\n// $r = \"Yes\";\n// }\n// $r = \"Yes\";\n// if ($s == \"AAA\" || $s == \"BBB\") {\n// $r = \"No\";\n// }\n// if ($n % 2 == 0) {\n// $r = $n / 2 / $n;\n// } else {\n// $r = ($n + 1) / 2 / $n;\n// }\n// if ($n < 10) {\n// $r += (10 - $n) * 100;\n// }\n// $arr = array($a, $b, $c);\n// $arr = array_unique($arr);\n// if (count($arr) == 2) {\n// $r = \"Yes\";\n// } else {\n// $r = \"No\";\n// }\n// if ($s == $u) {\n// $a--;\n// } else {\n// $b--;\n// }\n// for ($i = 0; $h > 0; $i++) {\n// $h -= $a;\n// }\n// $r = \"No\";\n// if ($n == $m) {\n// $r = \"Yes\";\n// }\n// $r = \"win\";\n// if ($a + $b + $c >= 22) {\n// $r = \"bust\n// \";\n// }\n// $arr = array(1, 2, 3);\n// unset($arr[$a - 1]);\n// unset($arr[$b - 1]);\n// $arr = array_values($arr);\n// if ($n < 10 && $m < 10) {\n// $r = $n * $m;\n// } else {\n// $r = -1;\n// }\n// switch ($s) {\n// case \"Sunny\":\n// $r = \"Cloudy\";\n// break;\n// case \"Cloudy\":\n// $r = \"Rainy\";\n// break;\n// case \"Rainy\":\n// $r = \"Sunny\";\n// break;\n// }\n// if ($a >= 3200) {\n// $r = $s;\n// } else {\n// $r = \"red\";\n// }\n// $arr = array($a + $b, $a * $b, $a - $b);\n// rsort($arr);\n// $r = $c - ($a - $b);\n// if ($r < 0) {\n// $r = 0;\n// }\n// $r = ($a + $b) / 2.0;\n// $q = round(($a + $b) / 2);\n// // echo $r;\n// // echo $q;\n// if ($n * $a <= $b) {\n// $r = $n * $a;\n// } else {\n// $r = $b;\n// }\n// if ($arr[0] == $arr[1] && $arr[2] == $arr[3] && $arr[1] != $arr[2]) {\n// $r = \"Yes\";\n// } else {\n// $r = \"No\";\n// }\n// $r = \"Good\";\n// for ($i = 0; $i < count($arr) - 1; $i++) {\n// if ($arr[$i] == $arr[$i + 1]) {\n// $r = \"Bad\";\n// break;\n// }\n// // echo $arr[$i] . \"\\n\";\n// }\n// if ($x < $a) {\n// $r = 0;\n// } else {\n// $r = 10;\n// }\n// $arr = array($a, $b, $c);\n// sort($arr);\n// $r = ($a * 3 + $p) / 2;\n// $r = floor($r);\nif ($a <= 5) {\n $r = 0;\n} elseif ($a <= 12) {\n $r = $b / 2;\n} else {\n $r = $b;\n}\n# 出力部\n// echo ($n * ($n - 1) / 2) + ($m * ($m - 1) / 2) . \"\\n\";\n// echo $z . \" \" . $x . \" \" . $y . \"\\n\";\n// echo ($i * 1000) - $n . \"\\n\";\n// echo json_encode($arr) . \"\\n\";\n// echo $arr[0] . \"\\n\";\n// echo $i + 1 . \"\\n\";\n// echo $n ** 3 . \"\\n\";\necho $r . \"\\n\";\n// echo $a . \" \" . $b . \"\\n\";\n// echo $t . $s . \"\\n\";\n", "language": "PHP", "metadata": {"date": 1598597043, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03035.html", "problem_id": "p03035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03035/input.txt", "sample_output_relpath": "derived/input_output/data/p03035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03035/PHP/s254127943.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s254127943", "user_id": "u847977106"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": " $x * $i; $i++) {\n// }\n// if (strpos($s, 'RRR') !== false) {\n// $r = 3;\n// } elseif (strpos($s, 'RR') !== false) {\n// $r = 2;\n// } elseif (strpos($s, 'R') !== false) {\n// $r = 1;\n// } else {\n// $r = 0;\n// }\n// $s = \"No\";\n// if ($x >= 30) {\n// $s = \"Yes\";\n// }\n// for ($i = 0; $i * 1000 < $n; $i++) {\n// }\n// $c = \"a\";\n// if (ctype_upper($a)) {\n// $c = \"A\";\n// }\n// $s = \"Yes\";\n// echo count($arr1);\n// for ($i = 0; $i < strlen($s1); $i++) {\n// if ($arr1[$i] != $arr2[$i]) {\n// $s = \"No\";\n// }\n// }\n// $unit;\n// switch ($n % 10) {\n// case 0:\n// case 1:\n// case 6:\n// case 8:\n// $unit = \"pon\";\n// break;\n// case 3:\n// $unit = \"bon\";\n// break;\n// default:\n// $unit = \"hon\";\n// break;\n// }\n// if ($s == \"ABC\") {\n// $r = \"ARC\";\n// } else {\n// $r = \"ABC\";\n// }\n// $r = \"NG\";\n// $arr = array(\"SAT\", \"FRI\", \"THU\", \"WED\", \"TUE\", \"MON\", \"SUN\");\n// for ($i = 0; $i <= count($arr); $i++) {\n// if ($arr[$i] == $s) {\n// break;\n// }\n// }\n// $r = \"safe\";\n// if ($s <= $w) {\n// $r = \"unsafe\";\n// }\n// $r = \"No\";\n// if (strpos($n, \"7\") !== false) {\n// $r = \"Yes\";\n// }\n// $r = \"No\";\n// if ($arr[2] == $arr[3] && $arr[4] == $arr[5]) {\n// $r = \"Yes\";\n// }\n// $r = \"Yes\";\n// if ($s == \"AAA\" || $s == \"BBB\") {\n// $r = \"No\";\n// }\n// if ($n % 2 == 0) {\n// $r = $n / 2 / $n;\n// } else {\n// $r = ($n + 1) / 2 / $n;\n// }\n// if ($n < 10) {\n// $r += (10 - $n) * 100;\n// }\n// $arr = array($a, $b, $c);\n// $arr = array_unique($arr);\n// if (count($arr) == 2) {\n// $r = \"Yes\";\n// } else {\n// $r = \"No\";\n// }\n// if ($s == $u) {\n// $a--;\n// } else {\n// $b--;\n// }\n// for ($i = 0; $h > 0; $i++) {\n// $h -= $a;\n// }\n// $r = \"No\";\n// if ($n == $m) {\n// $r = \"Yes\";\n// }\n// $r = \"win\";\n// if ($a + $b + $c >= 22) {\n// $r = \"bust\n// \";\n// }\n// $arr = array(1, 2, 3);\n// unset($arr[$a - 1]);\n// unset($arr[$b - 1]);\n// $arr = array_values($arr);\n// if ($n < 10 && $m < 10) {\n// $r = $n * $m;\n// } else {\n// $r = -1;\n// }\n// switch ($s) {\n// case \"Sunny\":\n// $r = \"Cloudy\";\n// break;\n// case \"Cloudy\":\n// $r = \"Rainy\";\n// break;\n// case \"Rainy\":\n// $r = \"Sunny\";\n// break;\n// }\n// if ($a >= 3200) {\n// $r = $s;\n// } else {\n// $r = \"red\";\n// }\n// $arr = array($a + $b, $a * $b, $a - $b);\n// rsort($arr);\n// $r = $c - ($a - $b);\n// if ($r < 0) {\n// $r = 0;\n// }\n// $r = ($a + $b) / 2.0;\n// $q = round(($a + $b) / 2);\n// // echo $r;\n// // echo $q;\n// if ($n * $a <= $b) {\n// $r = $n * $a;\n// } else {\n// $r = $b;\n// }\n// if ($arr[0] == $arr[1] && $arr[2] == $arr[3] && $arr[1] != $arr[2]) {\n// $r = \"Yes\";\n// } else {\n// $r = \"No\";\n// }\n// $r = \"Good\";\n// for ($i = 0; $i < count($arr) - 1; $i++) {\n// if ($arr[$i] == $arr[$i + 1]) {\n// $r = \"Bad\";\n// break;\n// }\n// // echo $arr[$i] . \"\\n\";\n// }\n// if ($x < $a) {\n// $r = 0;\n// } else {\n// $r = 10;\n// }\n// $arr = array($a, $b, $c);\n// sort($arr);\n// $r = ($a * 3 + $p) / 2;\n// $r = floor($r);\nif ($a <= 5) {\n $r = 0;\n} elseif ($a <= 12) {\n $r = $b / 2;\n} else {\n $r = $b;\n}\n# 出力部\n// echo ($n * ($n - 1) / 2) + ($m * ($m - 1) / 2) . \"\\n\";\n// echo $z . \" \" . $x . \" \" . $y . \"\\n\";\n// echo ($i * 1000) - $n . \"\\n\";\n// echo json_encode($arr) . \"\\n\";\n// echo $arr[0] . \"\\n\";\n// echo $i + 1 . \"\\n\";\n// echo $n ** 3 . \"\\n\";\necho $r . \"\\n\";\n// echo $a . \" \" . $b . \"\\n\";\n// echo $t . $s . \"\\n\";\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "sample_input": "30 100\n"}, "reference_outputs": ["100\n"], "source_document_id": "p03035", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4165, "cpu_time_ms": 20, "memory_kb": 16132}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s996353381", "group_id": "codeNet:p03036", "input_text": "", "language": "PHP", "metadata": {"date": 1576818521, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03036.html", "problem_id": "p03036", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03036/input.txt", "sample_output_relpath": "derived/input_output/data/p03036/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03036/PHP/s996353381.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s996353381", "user_id": "u397596606"}, "prompt_components": {"gold_output": "30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "sample_input": "2 10 20\n"}, "reference_outputs": ["30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n"], "source_document_id": "p03036", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 175, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s674803939", "group_id": "codeNet:p03036", "input_text": "\n\n", "language": "PHP", "metadata": {"date": 1560891288, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03037/input.txt", "sample_output_relpath": "derived/input_output/data/p03037/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03037/PHP/s904397320.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s904397320", "user_id": "u118284895"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "sample_input": "4 2\n1 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03037", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 292, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s968800735", "group_id": "codeNet:p03037", "input_text": "", "language": "PHP", "metadata": {"date": 1558486984, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03041.html", "problem_id": "p03041", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03041/input.txt", "sample_output_relpath": "derived/input_output/data/p03041/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03041/PHP/s553364535.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s553364535", "user_id": "u348482601"}, "prompt_components": {"gold_output": "aBC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "sample_input": "3 1\nABC\n"}, "reference_outputs": ["aBC\n"], "source_document_id": "p03041", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 251, "cpu_time_ms": 13, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s787572529", "group_id": "codeNet:p03041", "input_text": "", "language": "PHP", "metadata": {"date": 1558485734, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03041.html", "problem_id": "p03041", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03041/input.txt", "sample_output_relpath": "derived/input_output/data/p03041/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03041/PHP/s787572529.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s787572529", "user_id": "u348482601"}, "prompt_components": {"gold_output": "aBC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "sample_input": "3 1\nABC\n"}, "reference_outputs": ["aBC\n"], "source_document_id": "p03041", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s824651155", "group_id": "codeNet:p03041", "input_text": "= 1 && $a <= 12 && $b >=1 && $b <= 12) {\n $ans = 'AMBIGUOUS';\n} elseif ($a >= 1 && $a <= 12) {\n $ans = 'MMYY';\n} elseif ($b >=1 && $b <= 12) {\n $ans = 'YYMM';\n} else {\n $ans = 'NA';\n}\necho $ans . PHP_EOL;", "language": "PHP", "metadata": {"date": 1566174050, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03042/input.txt", "sample_output_relpath": "derived/input_output/data/p03042/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03042/PHP/s508476083.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s508476083", "user_id": "u055687468"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "= 1 && $a <= 12 && $b >=1 && $b <= 12) {\n $ans = 'AMBIGUOUS';\n} elseif ($a >= 1 && $a <= 12) {\n $ans = 'MMYY';\n} elseif ($b >=1 && $b <= 12) {\n $ans = 'YYMM';\n} else {\n $ans = 'NA';\n}\necho $ans . PHP_EOL;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "sample_input": "1905\n"}, "reference_outputs": ["YYMM\n"], "source_document_id": "p03042", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 311, "cpu_time_ms": 20, "memory_kb": 5496}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s361784588", "group_id": "codeNet:p03042", "input_text": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$s = $sc->next();\n\n$A = $s[0] . $s[1];\n$B = $s[2] . $s[3];\n$isYYMM = $B >= '01' && $B <= '12';\n$isMMYY = $A >= '01' && $A <= '12';\nswitch (true) {\n case $isYYMM && $isMMYY:\n $result = 'AMBIGUOUS';\n break;\n case $isYYMM && !$isMMYY:\n $result = 'YYMM';\n break;\n case !$isYYMM && $isMMYY:\n $result = 'MMYY';\n break;\n default:\n $result = 'NA';\n break;\n}\n\nout::println($result);", "language": "PHP", "metadata": {"date": 1558315067, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03042/input.txt", "sample_output_relpath": "derived/input_output/data/p03042/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03042/PHP/s355141576.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s355141576", "user_id": "u791734812"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$s = $sc->next();\n\n$A = $s[0] . $s[1];\n$B = $s[2] . $s[3];\n$isYYMM = $B >= '01' && $B <= '12';\n$isMMYY = $A >= '01' && $A <= '12';\nswitch (true) {\n case $isYYMM && $isMMYY:\n $result = 'AMBIGUOUS';\n break;\n case $isYYMM && !$isMMYY:\n $result = 'YYMM';\n break;\n case !$isYYMM && $isMMYY:\n $result = 'MMYY';\n break;\n default:\n $result = 'NA';\n break;\n}\n\nout::println($result);", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "sample_input": "1905\n"}, "reference_outputs": ["YYMM\n"], "source_document_id": "p03042", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1242, "cpu_time_ms": 14, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s004103230", "group_id": "codeNet:p03043", "input_text": " $score) {\n $score *= 2;\n $coin_count++;\n }\n\n #コイントス回数からサイコロが$iの時の分母を計算\n $denominator = 1;\n for ( $j = 1; $j <= $coin_count; $j++ ) {\n $denominator *= 2;\n }\n\n $score = $i;\n $coin_count = 0;\n \n $P[] = $N * $denominator;\n}\n\n$numerator = 0;\nforeach ($P as $el) {\n $numerator += ($P[0] / $el);\n}\n\n$probability = ($numerator / $P[0]);\n\necho $probability;", "language": "PHP", "metadata": {"date": 1558328291, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03043/input.txt", "sample_output_relpath": "derived/input_output/data/p03043/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03043/PHP/s272151528.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272151528", "user_id": "u846084461"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": " $score) {\n $score *= 2;\n $coin_count++;\n }\n\n #コイントス回数からサイコロが$iの時の分母を計算\n $denominator = 1;\n for ( $j = 1; $j <= $coin_count; $j++ ) {\n $denominator *= 2;\n }\n\n $score = $i;\n $coin_count = 0;\n \n $P[] = $N * $denominator;\n}\n\n$numerator = 0;\nforeach ($P as $el) {\n $numerator += ($P[0] / $el);\n}\n\n$probability = ($numerator / $P[0]);\n\necho $probability;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "sample_input": "3 10\n"}, "reference_outputs": ["0.145833333333\n"], "source_document_id": "p03043", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 787, "cpu_time_ms": 28, "memory_kb": 10744}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s427864334", "group_id": "codeNet:p03043", "input_text": " 0; $i--){\n if ($i >= $k) {\n $ret += 1/$n;\n } else {\n $tmp = 1/$n;\n $j = $i;\n while($j < $k) {\n $j *= 2;\n $tmp*=0.5;\n }\n $ret += $tmp;\n }\n } \n echo $ret.\"\\n\";\n }\n\n public function run() {\n self::main();\n }\n \n}\n\nMyTest::run();", "language": "PHP", "metadata": {"date": 1558321489, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03043/input.txt", "sample_output_relpath": "derived/input_output/data/p03043/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03043/PHP/s427864334.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s427864334", "user_id": "u401914623"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": " 0; $i--){\n if ($i >= $k) {\n $ret += 1/$n;\n } else {\n $tmp = 1/$n;\n $j = $i;\n while($j < $k) {\n $j *= 2;\n $tmp*=0.5;\n }\n $ret += $tmp;\n }\n } \n echo $ret.\"\\n\";\n }\n\n public function run() {\n self::main();\n }\n \n}\n\nMyTest::run();", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "sample_input": "3 10\n"}, "reference_outputs": ["0.145833333333\n"], "source_document_id": "p03043", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 554, "cpu_time_ms": 14, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s403068664", "group_id": "codeNet:p03048", "input_text": "", "language": "PHP", "metadata": {"date": 1558041221, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/PHP/s718387394.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s718387394", "user_id": "u921332245"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 70, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s745921023", "group_id": "codeNet:p03059", "input_text": "", "language": "PHP", "metadata": {"date": 1557210376, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/PHP/s249683305.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s249683305", "user_id": "u546587364"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 80, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s720082737", "group_id": "codeNet:p03059", "input_text": "$T = '';\n$A = 2;\n$B = 4;\n\nif($T + 0.5 < 20) {\n echo $A;\n $B++;\n}", "language": "PHP", "metadata": {"date": 1556418864, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/PHP/s720082737.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s720082737", "user_id": "u891851075"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$T = '';\n$A = 2;\n$B = 4;\n\nif($T + 0.5 < 20) {\n echo $A;\n $B++;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 66, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s053248381", "group_id": "codeNet:p03059", "input_text": " 0) $x += $d;\n}\necho $x;", "language": "PHP", "metadata": {"date": 1556413699, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03060.html", "problem_id": "p03060", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03060/input.txt", "sample_output_relpath": "derived/input_output/data/p03060/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03060/PHP/s705019947.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s705019947", "user_id": "u705304778"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": " 0) $x += $d;\n}\necho $x;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N gems. The value of the i-th gem is V_i.\n\nYou will choose some of these gems, possibly all or none, and get them.\n\nHowever, you need to pay a cost of C_i to get the i-th gem.\n\nLet X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.\n\nFind the maximum possible value of X-Y.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq C_i, V_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nV_1 V_2 ... V_N\nC_1 C_2 ... C_N\n\nOutput\n\nPrint the maximum possible value of X-Y.\n\nSample Input 1\n\n3\n10 2 5\n6 3 4\n\nSample Output 1\n\n5\n\nIf we choose the first and third gems, X = 10 + 5 = 15 and Y = 6 + 4 = 10.\nWe have X-Y = 5 here, which is the maximum possible value.\n\nSample Input 2\n\n4\n13 21 6 19\n11 30 6 15\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1\n1\n50\n\nSample Output 3\n\n0", "sample_input": "3\n10 2 5\n6 3 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03060", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N gems. The value of the i-th gem is V_i.\n\nYou will choose some of these gems, possibly all or none, and get them.\n\nHowever, you need to pay a cost of C_i to get the i-th gem.\n\nLet X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.\n\nFind the maximum possible value of X-Y.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq C_i, V_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nV_1 V_2 ... V_N\nC_1 C_2 ... C_N\n\nOutput\n\nPrint the maximum possible value of X-Y.\n\nSample Input 1\n\n3\n10 2 5\n6 3 4\n\nSample Output 1\n\n5\n\nIf we choose the first and third gems, X = 10 + 5 = 15 and Y = 6 + 4 = 10.\nWe have X-Y = 5 here, which is the maximum possible value.\n\nSample Input 2\n\n4\n13 21 6 19\n11 30 6 15\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1\n1\n50\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 203, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s596641111", "group_id": "codeNet:p03062", "input_text": " $value) {\n $data[] = explode(' ', $value);\n}\n\n//foreach ($data as &$line) {\n// $line = array_map(function($val) { return (int)$val; }, $line);\n//}\n\n$N = $data[0][0];\n$A = $data[1];\n\n$min = null;\n$sum = 0;\n$minusCnt = 0;\nfor ($i = 0; $i < $N; $i++) {\n $abs = abs($A[$i]);\n if (is_null($min) || $min > $abs) {\n $min = $abs;\n }\n $sum += $abs;\n if ($A[$i] < 0) {\n $minusCnt++;\n }\n}\n\nif ($minusCnt % 2 === 1) {\n $sum -= $min * 2;\n}\n$ans = $sum;\n\nprintf('%d', $ans);\n\n?>\n", "language": "PHP", "metadata": {"date": 1589618662, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03062.html", "problem_id": "p03062", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03062/input.txt", "sample_output_relpath": "derived/input_output/data/p03062/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03062/PHP/s596641111.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s596641111", "user_id": "u671910250"}, "prompt_components": {"gold_output": "19\n", "input_to_evaluate": " $value) {\n $data[] = explode(' ', $value);\n}\n\n//foreach ($data as &$line) {\n// $line = array_map(function($val) { return (int)$val; }, $line);\n//}\n\n$N = $data[0][0];\n$A = $data[1];\n\n$min = null;\n$sum = 0;\n$minusCnt = 0;\nfor ($i = 0; $i < $N; $i++) {\n $abs = abs($A[$i]);\n if (is_null($min) || $min > $abs) {\n $min = $abs;\n }\n $sum += $abs;\n if ($A[$i] < 0) {\n $minusCnt++;\n }\n}\n\nif ($minusCnt % 2 === 1) {\n $sum -= $min * 2;\n}\n$ans = $sum;\n\nprintf('%d', $ans);\n\n?>\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, arranged in a row in this order.\n\nYou can perform the following operation on this integer sequence any number of times:\n\nOperation: Choose an integer i satisfying 1 \\leq i \\leq N-1. Multiply both A_i and A_{i+1} by -1.\n\nLet B_1, B_2, ..., B_N be the integer sequence after your operations.\n\nFind the maximum possible value of B_1 + B_2 + ... + B_N.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n-10^9 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value of B_1 + B_2 + ... + B_N.\n\nSample Input 1\n\n3\n-10 5 -4\n\nSample Output 1\n\n19\n\nIf we perform the operation as follows:\n\nChoose 1 as i, which changes the sequence to 10, -5, -4.\n\nChoose 2 as i, which changes the sequence to 10, 5, 4.\n\nwe have B_1 = 10, B_2 = 5, B_3 = 4. The sum here, B_1 + B_2 + B_3 = 10 + 5 + 4 = 19, is the maximum possible result.\n\nSample Input 2\n\n5\n10 -4 -8 -11 3\n\nSample Output 2\n\n30\n\nSample Input 3\n\n11\n-1000000000 1000000000 -1000000000 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000000\n\nSample Output 3\n\n10000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "3\n-10 5 -4\n"}, "reference_outputs": ["19\n"], "source_document_id": "p03062", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, arranged in a row in this order.\n\nYou can perform the following operation on this integer sequence any number of times:\n\nOperation: Choose an integer i satisfying 1 \\leq i \\leq N-1. Multiply both A_i and A_{i+1} by -1.\n\nLet B_1, B_2, ..., B_N be the integer sequence after your operations.\n\nFind the maximum possible value of B_1 + B_2 + ... + B_N.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n-10^9 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value of B_1 + B_2 + ... + B_N.\n\nSample Input 1\n\n3\n-10 5 -4\n\nSample Output 1\n\n19\n\nIf we perform the operation as follows:\n\nChoose 1 as i, which changes the sequence to 10, -5, -4.\n\nChoose 2 as i, which changes the sequence to 10, 5, 4.\n\nwe have B_1 = 10, B_2 = 5, B_3 = 4. The sum here, B_1 + B_2 + B_3 = 10 + 5 + 4 = 19, is the maximum possible result.\n\nSample Input 2\n\n5\n10 -4 -8 -11 3\n\nSample Output 2\n\n30\n\nSample Input 3\n\n11\n-1000000000 1000000000 -1000000000 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000000\n\nSample Output 3\n\n10000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 601, "cpu_time_ms": 41, "memory_kb": 14840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s685326199", "group_id": "codeNet:p03068", "input_text": " $black){\n echo $black.\"\\n\";\n }else{\n echo $white.\"\\n\";\n }\n\n?>", "language": "PHP", "metadata": {"date": 1555810076, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03069.html", "problem_id": "p03069", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03069/input.txt", "sample_output_relpath": "derived/input_output/data/p03069/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03069/PHP/s080905056.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s080905056", "user_id": "u437779158"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $black){\n echo $black.\"\\n\";\n }else{\n echo $white.\"\\n\";\n }\n\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N stones arranged in a row. Every stone is painted white or black.\nA string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is ., and the stone is black if the character is #.\n\nTakahashi wants to change the colors of some stones to black or white so that there will be no white stone immediately to the right of a black stone.\nFind the minimum number of stones that needs to be recolored.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS is a string of length N consisting of . and #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of stones that needs to be recolored.\n\nSample Input 1\n\n3\n#.#\n\nSample Output 1\n\n1\n\nIt is enough to change the color of the first stone to white.\n\nSample Input 2\n\n5\n#.##.\n\nSample Output 2\n\n2\n\nSample Input 3\n\n9\n.........\n\nSample Output 3\n\n0", "sample_input": "3\n#.#\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03069", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N stones arranged in a row. Every stone is painted white or black.\nA string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is ., and the stone is black if the character is #.\n\nTakahashi wants to change the colors of some stones to black or white so that there will be no white stone immediately to the right of a black stone.\nFind the minimum number of stones that needs to be recolored.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS is a string of length N consisting of . and #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of stones that needs to be recolored.\n\nSample Input 1\n\n3\n#.#\n\nSample Output 1\n\n1\n\nIt is enough to change the color of the first stone to white.\n\nSample Input 2\n\n5\n#.##.\n\nSample Output 2\n\n2\n\nSample Input 3\n\n9\n.........\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 279, "cpu_time_ms": 50, "memory_kb": 4084}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s982177184", "group_id": "codeNet:p03071", "input_text": "= 2) {\n $result = $a * 2 - 1;\n} elseif ($b - $a >= 2) {\n $result = $b * 2 - 1;\n} else {\n $result = $a + $b;\n}\n \necho $result, PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1557344996, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/PHP/s982177184.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s982177184", "user_id": "u852360042"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "= 2) {\n $result = $a * 2 - 1;\n} elseif ($b - $a >= 2) {\n $result = $b * 2 - 1;\n} else {\n $result = $a + $b;\n}\n \necho $result, PHP_EOL;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 230, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s633104677", "group_id": "codeNet:p03071", "input_text": "\n", "language": "PHP", "metadata": {"date": 1590969250, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03073.html", "problem_id": "p03073", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03073/input.txt", "sample_output_relpath": "derived/input_output/data/p03073/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03073/PHP/s457605900.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s457605900", "user_id": "u348811384"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03073", "source_text": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 647, "cpu_time_ms": 30, "memory_kb": 10744}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s851542291", "group_id": "codeNet:p03073", "input_text": "=$size){\n $max = array_sum($array1)+array_sum($array0);\n}else{\n $value = 0;\n $max = $array1[0]+$array0[0];\n for($i=0;$i<$size-$K+1;$i++){\n if($i===$size-$K && $i===0){\n for($j=0;$j<$K;$j++){\n $value += $array1[$i+$j];\n }\n }elseif($i===0){\n for($j=0;$j<$K+1;$j++){\n $value += $array1[$i+$j];\n }\n }elseif($i===$size-$K){\n //何もしない\n }else{\n $value += $array1[($K-1)+$i+1];\n }\n if($i===0){\n for($j=0;$j<$K;$j++){\n $value += $array0[$i+$j];\n }\n }else{\n $value += $array0[($K-1)+$i];\n }\n if($value > $max){\n $max = $value;\n }\n $value -= $array1[$i];\n $value -= $array0[$i];\n }\n}\necho $max;\n", "language": "PHP", "metadata": {"date": 1564491741, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03074/input.txt", "sample_output_relpath": "derived/input_output/data/p03074/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03074/PHP/s754996872.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s754996872", "user_id": "u819330049"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "=$size){\n $max = array_sum($array1)+array_sum($array0);\n}else{\n $value = 0;\n $max = $array1[0]+$array0[0];\n for($i=0;$i<$size-$K+1;$i++){\n if($i===$size-$K && $i===0){\n for($j=0;$j<$K;$j++){\n $value += $array1[$i+$j];\n }\n }elseif($i===0){\n for($j=0;$j<$K+1;$j++){\n $value += $array1[$i+$j];\n }\n }elseif($i===$size-$K){\n //何もしない\n }else{\n $value += $array1[($K-1)+$i+1];\n }\n if($i===0){\n for($j=0;$j<$K;$j++){\n $value += $array0[$i+$j];\n }\n }else{\n $value += $array0[($K-1)+$i];\n }\n if($value > $max){\n $max = $value;\n }\n $value -= $array1[$i];\n $value -= $array0[$i];\n }\n}\necho $max;\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "sample_input": "5 1\n00010\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03074", "source_text": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1457, "cpu_time_ms": 457, "memory_kb": 18956}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s412076143", "group_id": "codeNet:p03074", "input_text": " $number) {\n $cumulative_sum_list[$key + 1] = $cumulative_sum_list[$key] + $number;\n}\n\n$cumulative_sum_list_length = count($cumulative_sum_list);\n\n$result = 0;\n\nfor ($left = 0; $left < $cumulative_sum_list_length; $left += 2) {\n $right = min($left + $k * 2 + 1, $cumulative_sum_list_length - 1);\n $total = $cumulative_sum_list[$right] - $cumulative_sum_list[$left];\n if ($result < $total) {\n $result = $total;\n }\n}\n \necho $result, PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1557349378, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03074/input.txt", "sample_output_relpath": "derived/input_output/data/p03074/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03074/PHP/s412076143.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s412076143", "user_id": "u852360042"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": " $number) {\n $cumulative_sum_list[$key + 1] = $cumulative_sum_list[$key] + $number;\n}\n\n$cumulative_sum_list_length = count($cumulative_sum_list);\n\n$result = 0;\n\nfor ($left = 0; $left < $cumulative_sum_list_length; $left += 2) {\n $right = min($left + $k * 2 + 1, $cumulative_sum_list_length - 1);\n $total = $cumulative_sum_list[$right] - $cumulative_sum_list[$left];\n if ($result < $total) {\n $result = $total;\n }\n}\n \necho $result, PHP_EOL;\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "sample_input": "5 1\n00010\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03074", "source_text": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 934, "cpu_time_ms": 47, "memory_kb": 14836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s745368267", "group_id": "codeNet:p03075", "input_text": " $k) {\n\techo ':(';\n}else{\n\techo 'Yay!';\n}\n", "language": "PHP", "metadata": {"date": 1554632601, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/PHP/s270637374.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s270637374", "user_id": "u699888017"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": " $k) {\n\techo ':(';\n}else{\n\techo 'Yay!';\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s147941981", "group_id": "codeNet:p03075", "input_text": " $_k;\n}\n\n\n\nfunction delta($a,$b){\n if($a == $b){\n return 0;\n }else if($a > $b){\n return $a-$b;\n }else if($a < $b){\n return $b-$a;\n }\n}\n", "language": "PHP", "metadata": {"date": 1554582824, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/PHP/s147941981.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s147941981", "user_id": "u110145131"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": " $_k;\n}\n\n\n\nfunction delta($a,$b){\n if($a == $b){\n return 0;\n }else if($a > $b){\n return $a-$b;\n }else if($a < $b){\n return $b-$a;\n }\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1003, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s469492872", "group_id": "codeNet:p03075", "input_text": " $k) {\n // 出力\n echo \":(\\n\";\n} else {\n // 出力\n echo \"Yay!\\n\";\n}\n", "language": "PHP", "metadata": {"date": 1554577711, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/PHP/s469492872.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s469492872", "user_id": "u673460676"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": " $k) {\n // 出力\n echo \":(\\n\";\n} else {\n // 出力\n echo \"Yay!\\n\";\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 342, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s088114800", "group_id": "codeNet:p03076", "input_text": " $v % 10) {\n $min_x = $v;\n $min_mod = $v % 10;\n }\n}\n\n$sum = 0;\n$cnt = 0;\nforeach ($x as $v) {\n if ($cnt == 0 && $min_x == $v) {\n $cnt = 1;\n continue;\n }\n\n $sum += ceil($v / 10) * 10;\n}\n\n$sum += $min_x;\n\necho $sum . PHP_EOL;", "language": "PHP", "metadata": {"date": 1554579479, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03076.html", "problem_id": "p03076", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03076/input.txt", "sample_output_relpath": "derived/input_output/data/p03076/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03076/PHP/s088114800.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s088114800", "user_id": "u763389500"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": " $v % 10) {\n $min_x = $v;\n $min_mod = $v % 10;\n }\n}\n\n$sum = 0;\n$cnt = 0;\nforeach ($x as $v) {\n if ($cnt == 0 && $min_x == $v) {\n $cnt = 1;\n continue;\n }\n\n $sum += ceil($v / 10) * 10;\n}\n\n$sum += $min_x;\n\necho $sum . PHP_EOL;", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "sample_input": "29\n20\n7\n35\n120\n"}, "reference_outputs": ["215\n"], "source_document_id": "p03076", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 503, "cpu_time_ms": 12, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s097025670", "group_id": "codeNet:p03077", "input_text": "= 0; $i--){\n $move = min($person[$i] , $count[$i]);\n $person[$i + 1] += $move;\n $person[$i] -= $move;\n }\n}\n\necho $ans . \"\\n\";", "language": "PHP", "metadata": {"date": 1559338697, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/PHP/s097025670.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s097025670", "user_id": "u392319141"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "= 0; $i--){\n $move = min($person[$i] , $count[$i]);\n $person[$i + 1] += $move;\n $person[$i] -= $move;\n }\n}\n\necho $ans . \"\\n\";", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 513, "cpu_time_ms": 2104, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s857314359", "group_id": "codeNet:p03077", "input_text": "\n", "language": "PHP", "metadata": {"date": 1554580909, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/PHP/s857314359.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s857314359", "user_id": "u227248414"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 186, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s365154111", "group_id": "codeNet:p03077", "input_text": " $now) {\n $min = $now;\n }\n }\n $result = 4 + floor($N / $min);\n if ($N % $min >= 1) {\n $result++;\n }\n echo $result;\n", "language": "PHP", "metadata": {"date": 1554578970, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/PHP/s365154111.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s365154111", "user_id": "u428830428"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": " $now) {\n $min = $now;\n }\n }\n $result = 4 + floor($N / $min);\n if ($N % $min >= 1) {\n $result++;\n }\n echo $result;\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 299, "cpu_time_ms": 13, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s400911742", "group_id": "codeNet:p03078", "input_text": " $ab) {\n foreach ($c_list as $c) {\n $abc_list[$key . ',' . $c] = $ab + $c;\n }\n}\n\narsort($abc_list);\n$abc_list = array_slice($abc_list, 0, $k, true);\n\nforeach ($abc_list as $abc) {\n echo $abc, PHP_EOL;\n}\n", "language": "PHP", "metadata": {"date": 1560645778, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03078.html", "problem_id": "p03078", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03078/input.txt", "sample_output_relpath": "derived/input_output/data/p03078/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03078/PHP/s400911742.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s400911742", "user_id": "u852360042"}, "prompt_components": {"gold_output": "19\n17\n15\n14\n13\n12\n10\n8\n", "input_to_evaluate": " $ab) {\n foreach ($c_list as $c) {\n $abc_list[$key . ',' . $c] = $ab + $c;\n }\n}\n\narsort($abc_list);\n$abc_list = array_slice($abc_list, 0, $k, true);\n\nforeach ($abc_list as $abc) {\n echo $abc, PHP_EOL;\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "2 2 2 8\n4 6\n1 5\n3 8\n"}, "reference_outputs": ["19\n17\n15\n14\n13\n12\n10\n8\n"], "source_document_id": "p03078", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 861, "cpu_time_ms": 2105, "memory_kb": 348664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s064814361", "group_id": "codeNet:p03078", "input_text": "", "language": "PHP", "metadata": {"date": 1553458229, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03085/input.txt", "sample_output_relpath": "derived/input_output/data/p03085/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03085/PHP/s147645241.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s147645241", "user_id": "u944445179"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "sample_input": "A\n"}, "reference_outputs": ["T\n"], "source_document_id": "p03085", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 82, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s973768816", "group_id": "codeNet:p03086", "input_text": " 0) {\n foreach ($match as $m) {\n $maxLength = max([strlen($m[0]) , $maxLength]);\n }\n}\n\nprint($maxLength . \"\\n\");", "language": "PHP", "metadata": {"date": 1559546709, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03086.html", "problem_id": "p03086", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03086/input.txt", "sample_output_relpath": "derived/input_output/data/p03086/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03086/PHP/s973768816.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s973768816", "user_id": "u392319141"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " 0) {\n foreach ($match as $m) {\n $maxLength = max([strlen($m[0]) , $maxLength]);\n }\n}\n\nprint($maxLength . \"\\n\");", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "sample_input": "ATCODER\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03086", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 250, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s217960192", "group_id": "codeNet:p03087", "input_text": "= 0; --$i) {\n if ($S[$i + 1] === 'C' && $S[$i] === 'A') {\n $sr[$i] = $sr[$i + 1] + 1;\n } else {\n $sr[$i] = $sr[$i + 1];\n }\n}\n\n$total = $sl[$n - 1];\n\nfor ($i = 0; $i < $q; ++$i) {\n $tmp_total = $total;\n\n if ($L[$i] === 0) {\n $tl = 0;\n } else {\n $tl = $sl[$L[$i] - 1];\n\n if ($S[$L[$i]] === 'C' && $S[$L[$i] - 1] === 'A') {\n --$tmp_total;\n }\n }\n\n if ($R[$i] === $n - 1) {\n $tr = 0;\n } else {\n $tr = $sr[$R[$i] + 1];\n\n if ($S[$R[$i]] === 'A' && $S[$R[$i] + 1] === 'C') {\n --$tmp_total;\n }\n }\n/* echo \"tl: $tl, tr: $tr, tmp_total: $tmp_total\", PHP_EOL; */\n echo $tmp_total - $tr - $tl, PHP_EOL;\n}\n", "language": "PHP", "metadata": {"date": 1590222899, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03087.html", "problem_id": "p03087", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03087/input.txt", "sample_output_relpath": "derived/input_output/data/p03087/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03087/PHP/s217960192.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s217960192", "user_id": "u376366206"}, "prompt_components": {"gold_output": "2\n0\n3\n", "input_to_evaluate": "= 0; --$i) {\n if ($S[$i + 1] === 'C' && $S[$i] === 'A') {\n $sr[$i] = $sr[$i + 1] + 1;\n } else {\n $sr[$i] = $sr[$i + 1];\n }\n}\n\n$total = $sl[$n - 1];\n\nfor ($i = 0; $i < $q; ++$i) {\n $tmp_total = $total;\n\n if ($L[$i] === 0) {\n $tl = 0;\n } else {\n $tl = $sl[$L[$i] - 1];\n\n if ($S[$L[$i]] === 'C' && $S[$L[$i] - 1] === 'A') {\n --$tmp_total;\n }\n }\n\n if ($R[$i] === $n - 1) {\n $tr = 0;\n } else {\n $tr = $sr[$R[$i] + 1];\n\n if ($S[$R[$i]] === 'A' && $S[$R[$i] + 1] === 'C') {\n --$tmp_total;\n }\n }\n/* echo \"tl: $tl, tr: $tr, tmp_total: $tmp_total\", PHP_EOL; */\n echo $tmp_total - $tr - $tl, PHP_EOL;\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "sample_input": "8 3\nACACTACG\n3 7\n2 3\n1 8\n"}, "reference_outputs": ["2\n0\n3\n"], "source_document_id": "p03087", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1191, "cpu_time_ms": 448, "memory_kb": 22644}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s961298493", "group_id": "codeNet:p03087", "input_text": "\n", "language": "PHP", "metadata": {"date": 1552329235, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03101.html", "problem_id": "p03101", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03101/input.txt", "sample_output_relpath": "derived/input_output/data/p03101/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03101/PHP/s603316049.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s603316049", "user_id": "u109193095"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "sample_input": "3 2\n2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03101", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 90, "cpu_time_ms": 12, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s697710957", "group_id": "codeNet:p03102", "input_text": " 0){\n echo $i.\"\\n\";\n exit;\n }\n }\n echo \"0\\n\";", "language": "PHP", "metadata": {"date": 1586704710, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03102.html", "problem_id": "p03102", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03102/input.txt", "sample_output_relpath": "derived/input_output/data/p03102/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03102/PHP/s697710957.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s697710957", "user_id": "u769447691"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " 0){\n echo $i.\"\\n\";\n exit;\n }\n }\n echo \"0\\n\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}.\n\nAdditionally, you are given integers B_1, B_2, ..., B_M and C.\n\nThe i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0.\n\nAmong the N codes, find the number of codes that correctly solve this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 20\n\n-100 \\leq A_{ij} \\leq 100\n\n-100 \\leq B_i \\leq 100\n\n-100 \\leq C \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M C\nB_1 B_2 ... B_M\nA_{11} A_{12} ... A_{1M}\nA_{21} A_{22} ... A_{2M}\n\\vdots\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint the number of codes among the given N codes that correctly solve this problem.\n\nSample Input 1\n\n2 3 -10\n1 2 3\n3 2 1\n1 2 2\n\nSample Output 1\n\n1\n\nOnly the second code correctly solves this problem, as follows:\n\nSince 3 \\times 1 + 2 \\times 2 + 1 \\times 3 + (-10) = 0 \\leq 0, the first code does not solve this problem.\n\n1 \\times 1 + 2 \\times 2 + 2 \\times 3 + (-10) = 1 > 0, the second code solves this problem.\n\nSample Input 2\n\n5 2 -4\n-2 5\n100 41\n100 40\n-3 0\n-6 -2\n18 -13\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 0\n100 -100 0\n0 100 100\n100 100 100\n-100 100 100\n\nSample Output 3\n\n0\n\nAll of them are Wrong Answer. Except yours.", "sample_input": "2 3 -10\n1 2 3\n3 2 1\n1 2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03102", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}.\n\nAdditionally, you are given integers B_1, B_2, ..., B_M and C.\n\nThe i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0.\n\nAmong the N codes, find the number of codes that correctly solve this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 20\n\n-100 \\leq A_{ij} \\leq 100\n\n-100 \\leq B_i \\leq 100\n\n-100 \\leq C \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M C\nB_1 B_2 ... B_M\nA_{11} A_{12} ... A_{1M}\nA_{21} A_{22} ... A_{2M}\n\\vdots\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint the number of codes among the given N codes that correctly solve this problem.\n\nSample Input 1\n\n2 3 -10\n1 2 3\n3 2 1\n1 2 2\n\nSample Output 1\n\n1\n\nOnly the second code correctly solves this problem, as follows:\n\nSince 3 \\times 1 + 2 \\times 2 + 1 \\times 3 + (-10) = 0 \\leq 0, the first code does not solve this problem.\n\n1 \\times 1 + 2 \\times 2 + 2 \\times 3 + (-10) = 1 > 0, the second code solves this problem.\n\nSample Input 2\n\n5 2 -4\n-2 5\n100 41\n100 40\n-3 0\n-6 -2\n18 -13\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 0\n100 -100 0\n0 100 100\n100 100 100\n-100 100 100\n\nSample Output 3\n\n0\n\nAll of them are Wrong Answer. Except yours.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 304, "cpu_time_ms": 10, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s711782595", "group_id": "codeNet:p03103", "input_text": " $v){\n if ($c == $m) break;\n $min = min($v, $m-$c);\n $p += $k*$min;\n $c += $min;\n }\n}\n\necho intval($p);\n\n?>", "language": "PHP", "metadata": {"date": 1577590567, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/PHP/s711782595.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s711782595", "user_id": "u397596606"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": " $v){\n if ($c == $m) break;\n $min = min($v, $m-$c);\n $p += $k*$min;\n $c += $min;\n }\n}\n\necho intval($p);\n\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 361, "cpu_time_ms": 116, "memory_kb": 51700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s089569117", "group_id": "codeNet:p03103", "input_text": " $a){\n $buyCount = min($m, $a);\n $m = $m - $buyCount;\n $total += $price * $buyCount;\n}\necho $total;\n", "language": "PHP", "metadata": {"date": 1553952262, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/PHP/s089569117.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s089569117", "user_id": "u248209126"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": " $a){\n $buyCount = min($m, $a);\n $m = $m - $buyCount;\n $total += $price * $buyCount;\n}\necho $total;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 110, "memory_kb": 13048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s405634054", "group_id": "codeNet:p03103", "input_text": " $val)\n {\n //この店で買う数\n $buy = min($M, $val);\n \n //金額をたす\n $ans += $buy * $key;\n \n //必要な個数を減らす\n $M -= $buy;\n }\n \n echo $ans;\n \n?>", "language": "PHP", "metadata": {"date": 1552269691, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/PHP/s405634054.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s405634054", "user_id": "u353984160"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": " $val)\n {\n //この店で買う数\n $buy = min($M, $val);\n \n //金額をたす\n $ans += $buy * $key;\n \n //必要な個数を減らす\n $M -= $buy;\n }\n \n echo $ans;\n \n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 565, "cpu_time_ms": 295, "memory_kb": 39796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s918424159", "group_id": "codeNet:p03106", "input_text": "", "language": "PHP", "metadata": {"date": 1563375909, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03106.html", "problem_id": "p03106", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03106/input.txt", "sample_output_relpath": "derived/input_output/data/p03106/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03106/PHP/s918424159.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s918424159", "user_id": "u370696069"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nFind the K-th largest positive integer that divides both A and B.\n\nThe input guarantees that there exists such a number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 100\n\nThe K-th largest positive integer that divides both A and B exists.\n\nK \\geq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the K-th largest positive integer that divides both A and B.\n\nSample Input 1\n\n8 12 2\n\nSample Output 1\n\n2\n\nThree positive integers divides both 8 and 12: 1, 2 and 4.\nAmong them, the second largest is 2.\n\nSample Input 2\n\n100 50 4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1 1\n\nSample Output 3\n\n1", "sample_input": "8 12 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03106", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nFind the K-th largest positive integer that divides both A and B.\n\nThe input guarantees that there exists such a number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 100\n\nThe K-th largest positive integer that divides both A and B exists.\n\nK \\geq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the K-th largest positive integer that divides both A and B.\n\nSample Input 1\n\n8 12 2\n\nSample Output 1\n\n2\n\nThree positive integers divides both 8 and 12: 1, 2 and 4.\nAmong them, the second largest is 2.\n\nSample Input 2\n\n100 50 4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1 1\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 568, "cpu_time_ms": 18, "memory_kb": 3956}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s514947573", "group_id": "codeNet:p03106", "input_text": "size($row[0]);\n $s2 = $uft->size($row[1]);\n $uft->unite($row[0], $row[1]);\n $s3 = $uft->size($row[0]);\n if($s1 != $s3){\n $sum -= $s1 * $s2;\n }\n}\necho implode(\"\\n\", array_reverse($history));\n\nclass UFT{\n public $parent;\n public $size;\n public $rank;\n public function __construct($size){\n for($i = 1; $i <= $size; $i++){\n $this->size[$i] = 1;\n $this->rank[$i] = 1;\n $this->parent[$i] = 0;\n }\n }\n public function dump(){\n o(\"--------------\");\n o($this->parent);\n o($this->size);\n o($this->rank);\n }\n public function getRoot($i){\n if($this->parent[$i] == 0){\n return $i;\n }else{\n return $this->getRoot($this->parent[$i]);\n }\n }\n public function unite($i, $j){\n $rootI = $this->getRoot($j);\n $rootJ = $this->getRoot($i);\n if($rootJ == $rootI)return false;//元から同じグループ\n if($this->rank[$rootI] > $this->rank[$rootJ])list($rootI, $rootJ) = [$rootJ, $rootI];//Rank(J)>Rank(I)に揃えておく\n $this->parent[$rootI] = $rootJ;\n if($this->rank[$rootI] == $this->rank[$rootJ]){\n $this->rank[$rootJ]++;\n }\n $this->size[$rootJ]+=$this->size[$rootI];\n $this->size[$rootI] = '*';//不要な情報となるので潰す/デバッグ出力向けに*を入れている\n $this->rank[$rootI] = '*';//同上\n }\n public function size($i){return $this->size[$this->getRoot($i)];}\n public function isUnion($i, $j){return $this->getRoot($i) == $this->getRoot($j);}\n}\n\n//デバッグ用\nfunction o($val){\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array:\";\n echo implode(\" \", $val).\"\\n\";\n }else{\n echo \"array:array\\n\";\n foreach($val as $row){\n echo implode(\" \", $row).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}", "language": "PHP", "metadata": {"date": 1555248765, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03108.html", "problem_id": "p03108", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03108/input.txt", "sample_output_relpath": "derived/input_output/data/p03108/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03108/PHP/s298345054.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s298345054", "user_id": "u248209126"}, "prompt_components": {"gold_output": "0\n0\n4\n5\n6\n", "input_to_evaluate": "size($row[0]);\n $s2 = $uft->size($row[1]);\n $uft->unite($row[0], $row[1]);\n $s3 = $uft->size($row[0]);\n if($s1 != $s3){\n $sum -= $s1 * $s2;\n }\n}\necho implode(\"\\n\", array_reverse($history));\n\nclass UFT{\n public $parent;\n public $size;\n public $rank;\n public function __construct($size){\n for($i = 1; $i <= $size; $i++){\n $this->size[$i] = 1;\n $this->rank[$i] = 1;\n $this->parent[$i] = 0;\n }\n }\n public function dump(){\n o(\"--------------\");\n o($this->parent);\n o($this->size);\n o($this->rank);\n }\n public function getRoot($i){\n if($this->parent[$i] == 0){\n return $i;\n }else{\n return $this->getRoot($this->parent[$i]);\n }\n }\n public function unite($i, $j){\n $rootI = $this->getRoot($j);\n $rootJ = $this->getRoot($i);\n if($rootJ == $rootI)return false;//元から同じグループ\n if($this->rank[$rootI] > $this->rank[$rootJ])list($rootI, $rootJ) = [$rootJ, $rootI];//Rank(J)>Rank(I)に揃えておく\n $this->parent[$rootI] = $rootJ;\n if($this->rank[$rootI] == $this->rank[$rootJ]){\n $this->rank[$rootJ]++;\n }\n $this->size[$rootJ]+=$this->size[$rootI];\n $this->size[$rootI] = '*';//不要な情報となるので潰す/デバッグ出力向けに*を入れている\n $this->rank[$rootI] = '*';//同上\n }\n public function size($i){return $this->size[$this->getRoot($i)];}\n public function isUnion($i, $j){return $this->getRoot($i) == $this->getRoot($j);}\n}\n\n//デバッグ用\nfunction o($val){\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array:\";\n echo implode(\" \", $val).\"\\n\";\n }else{\n echo \"array:array\\n\";\n foreach($val as $row){\n echo implode(\" \", $row).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "sample_input": "4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n"}, "reference_outputs": ["0\n0\n4\n5\n6\n"], "source_document_id": "p03108", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2407, "cpu_time_ms": 412, "memory_kb": 72684}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s141916174", "group_id": "codeNet:p03108", "input_text": "findRootNode($row[0]-1)->size;\n $s2 = $tree->findRootNode($row[1]-1)->size;\n $tree->unite($row[0]-1, $row[1]-1);\n $s3 = $tree->findRootNode($row[0]-1)->size;\n $s4 = $tree->findRootNode($row[1]-1)->size;\n if($s1!=$s3){\n $sum -= $s1 * $s2;\n }\n o([$s1,$s2, $s3, $s4]);\n}\nforeach(array_reverse($hist) as $num){\n echo $num.\"\\n\";\n}\n\nclass Node\n{\n public $parentIndex;\n public $rank;\n public $size = 1;\n function __construct($parentIndex, $rank)\n {\n $this->parentIndex = $parentIndex;\n $this->rank = $rank;\n }\n}\nclass UnionFindTree\n{\n private $nodes = [];\n public function __construct($nodeCount)\n {\n for ($i = 0; $i < $nodeCount; $i++) {\n $this->nodes[$i] = new Node($i, 0);\n }\n }\n public function findRootNode($target){\n return $this->nodes[$this->findRoot($target)];\n }\n public function findRoot($target)\n {\n $parentIndex = $this->nodes[$target]->parentIndex;\n if($parentIndex === $target){\n return $target;\n } else {\n $rootIndex = $this->findRoot($parentIndex);\n $this->nodes[$target]->parentIndex = $rootIndex;\n return $rootIndex;\n }\n }\n public function unite($x, $y)\n {\n $xRootIndex = $this->findRoot($x);\n $yRootIndex = $this->findRoot($y);\n if ($xRootIndex === $yRootIndex) {\n return;\n }\n $xRootNode = $this->nodes[$xRootIndex];\n $yRootNode = $this->nodes[$yRootIndex];\n if ($xRootNode->rank < $yRootNode->rank) {\n $this->nodes[$x]->parentIndex = $y;\n $yRootNode->size+=$xRootNode->size;\n } else {\n $this->nodes[$y]->parentIndex = $x;\n $xRootNode->size+=$yRootNode->size;\n if ($xRootNode->rank === $yRootNode->rank) {\n $xRootNode->rank++;\n }\n }\n }\n public function isSameGroup($x, $y)\n {\n return $this->findRoot($x) === $this->findRoot($y);\n }\n}", "language": "PHP", "metadata": {"date": 1555244882, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03108.html", "problem_id": "p03108", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03108/input.txt", "sample_output_relpath": "derived/input_output/data/p03108/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03108/PHP/s141916174.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s141916174", "user_id": "u248209126"}, "prompt_components": {"gold_output": "0\n0\n4\n5\n6\n", "input_to_evaluate": "findRootNode($row[0]-1)->size;\n $s2 = $tree->findRootNode($row[1]-1)->size;\n $tree->unite($row[0]-1, $row[1]-1);\n $s3 = $tree->findRootNode($row[0]-1)->size;\n $s4 = $tree->findRootNode($row[1]-1)->size;\n if($s1!=$s3){\n $sum -= $s1 * $s2;\n }\n o([$s1,$s2, $s3, $s4]);\n}\nforeach(array_reverse($hist) as $num){\n echo $num.\"\\n\";\n}\n\nclass Node\n{\n public $parentIndex;\n public $rank;\n public $size = 1;\n function __construct($parentIndex, $rank)\n {\n $this->parentIndex = $parentIndex;\n $this->rank = $rank;\n }\n}\nclass UnionFindTree\n{\n private $nodes = [];\n public function __construct($nodeCount)\n {\n for ($i = 0; $i < $nodeCount; $i++) {\n $this->nodes[$i] = new Node($i, 0);\n }\n }\n public function findRootNode($target){\n return $this->nodes[$this->findRoot($target)];\n }\n public function findRoot($target)\n {\n $parentIndex = $this->nodes[$target]->parentIndex;\n if($parentIndex === $target){\n return $target;\n } else {\n $rootIndex = $this->findRoot($parentIndex);\n $this->nodes[$target]->parentIndex = $rootIndex;\n return $rootIndex;\n }\n }\n public function unite($x, $y)\n {\n $xRootIndex = $this->findRoot($x);\n $yRootIndex = $this->findRoot($y);\n if ($xRootIndex === $yRootIndex) {\n return;\n }\n $xRootNode = $this->nodes[$xRootIndex];\n $yRootNode = $this->nodes[$yRootIndex];\n if ($xRootNode->rank < $yRootNode->rank) {\n $this->nodes[$x]->parentIndex = $y;\n $yRootNode->size+=$xRootNode->size;\n } else {\n $this->nodes[$y]->parentIndex = $x;\n $xRootNode->size+=$yRootNode->size;\n if ($xRootNode->rank === $yRootNode->rank) {\n $xRootNode->rank++;\n }\n }\n }\n public function isSameGroup($x, $y)\n {\n return $this->findRoot($x) === $this->findRoot($y);\n }\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "sample_input": "4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n"}, "reference_outputs": ["0\n0\n4\n5\n6\n"], "source_document_id": "p03108", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2299, "cpu_time_ms": 106, "memory_kb": 66420}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s764818969", "group_id": "codeNet:p03109", "input_text": "", "language": "PHP", "metadata": {"date": 1576504954, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/PHP/s755370449.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s755370449", "user_id": "u397596606"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 164, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s433457413", "group_id": "codeNet:p03111", "input_text": "= 1) {\n break;\n } else {\n $arrayABC[3] = $l;\n }\n for ($m = 0; $m < 4; $m ++) {\n if ($N <= 4 && $m >= 1) {\n break;\n } else {\n $arrayABC[4] = $m;\n }\n for ($n = 0; $n < 4; $n ++) {\n if ($N <= 5 && $n >= 1) {\n break;\n } else {\n $arrayABC[5] = $n;\n }\n for ($o = 0; $o < 4; $o ++) {\n if ($N <= 6 && $o >= 1) {\n break;\n } else {\n $arrayABC[6] = $o;\n }\n for ($p = 0; $p < 4; $p ++) {\n if ($N <= 7 && $p >= 1) {\n break;\n } else {\n $arrayABC[7] = $p;\n }\n if (! in_array(1, $arrayABC) || ! in_array(2, $arrayABC) || ! in_array(3, $arrayABC)) {\n continue;\n }\n for ($z = 0; $z < $N; $z ++) {\n if ($arrayABC[$z] === 1) {\n $arrayA[] = $arrayL[$z];\n } elseif ($arrayABC[$z] === 2) {\n $arrayB[] = $arrayL[$z];\n } elseif ($arrayABC[$z] === 3) {\n $arrayC[] = $arrayL[$z];\n }\n }\n $value = abs(array_sum($arrayA) - $A) + abs(array_sum($arrayB) - $B) + abs(array_sum($arrayC) - $C);\n $value += (count($arrayA) - 1) * 10 + (count($arrayB) - 1) * 10 + (count($arrayC) - 1) * 10;\n if ($minMP > $value) {\n $minMP = $value;\n }\n $arrayA = array();\n $arrayB = array();\n $arrayC = array();\n }\n }\n }\n }\n }\n }\n }\n}\necho $minMP;\n", "language": "PHP", "metadata": {"date": 1572422934, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03111.html", "problem_id": "p03111", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03111/input.txt", "sample_output_relpath": "derived/input_output/data/p03111/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03111/PHP/s433457413.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s433457413", "user_id": "u819330049"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "= 1) {\n break;\n } else {\n $arrayABC[3] = $l;\n }\n for ($m = 0; $m < 4; $m ++) {\n if ($N <= 4 && $m >= 1) {\n break;\n } else {\n $arrayABC[4] = $m;\n }\n for ($n = 0; $n < 4; $n ++) {\n if ($N <= 5 && $n >= 1) {\n break;\n } else {\n $arrayABC[5] = $n;\n }\n for ($o = 0; $o < 4; $o ++) {\n if ($N <= 6 && $o >= 1) {\n break;\n } else {\n $arrayABC[6] = $o;\n }\n for ($p = 0; $p < 4; $p ++) {\n if ($N <= 7 && $p >= 1) {\n break;\n } else {\n $arrayABC[7] = $p;\n }\n if (! in_array(1, $arrayABC) || ! in_array(2, $arrayABC) || ! in_array(3, $arrayABC)) {\n continue;\n }\n for ($z = 0; $z < $N; $z ++) {\n if ($arrayABC[$z] === 1) {\n $arrayA[] = $arrayL[$z];\n } elseif ($arrayABC[$z] === 2) {\n $arrayB[] = $arrayL[$z];\n } elseif ($arrayABC[$z] === 3) {\n $arrayC[] = $arrayL[$z];\n }\n }\n $value = abs(array_sum($arrayA) - $A) + abs(array_sum($arrayB) - $B) + abs(array_sum($arrayC) - $C);\n $value += (count($arrayA) - 1) * 10 + (count($arrayB) - 1) * 10 + (count($arrayC) - 1) * 10;\n if ($minMP > $value) {\n $minMP = $value;\n }\n $arrayA = array();\n $arrayB = array();\n $arrayC = array();\n }\n }\n }\n }\n }\n }\n }\n}\necho $minMP;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "sample_input": "5 100 90 80\n98\n40\n30\n21\n80\n"}, "reference_outputs": ["23\n"], "source_document_id": "p03111", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3110, "cpu_time_ms": 209, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s677269623", "group_id": "codeNet:p03111", "input_text": " $centerValue){\n $min = $center + 1;\n }else{\n $max = $center;\n }\n if($min == $max){\n $center = floor(($min + $max) / 2);\n $centerValue = $nums[$center];\n if($centerValue == $target){\n return $center;\n }elseif($centerValue < $target){\n return $center;\n }else{\n return $center-1;\n }\n }\n }\n}\n", "language": "PHP", "metadata": {"date": 1556618192, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03112.html", "problem_id": "p03112", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03112/input.txt", "sample_output_relpath": "derived/input_output/data/p03112/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03112/PHP/s801709529.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s801709529", "user_id": "u248209126"}, "prompt_components": {"gold_output": "350\n1400\n301\n399\n", "input_to_evaluate": " $centerValue){\n $min = $center + 1;\n }else{\n $max = $center;\n }\n if($min == $max){\n $center = floor(($min + $max) / 2);\n $centerValue = $nums[$center];\n if($centerValue == $target){\n return $center;\n }elseif($centerValue < $target){\n return $center;\n }else{\n return $center-1;\n }\n }\n }\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "sample_input": "2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n"}, "reference_outputs": ["350\n1400\n301\n399\n"], "source_document_id": "p03112", "source_text": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1804, "cpu_time_ms": 781, "memory_kb": 18928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s833114283", "group_id": "codeNet:p03125", "input_text": "", "language": "PHP", "metadata": {"date": 1551038945, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03125.html", "problem_id": "p03125", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03125/input.txt", "sample_output_relpath": "derived/input_output/data/p03125/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03125/PHP/s833114283.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s833114283", "user_id": "u168621426"}, "prompt_components": {"gold_output": "16\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nSample Input 1\n\n4 12\n\nSample Output 1\n\n16\n\nAs 4 is a divisor of 12, 4 + 12 = 16 should be printed.\n\nSample Input 2\n\n8 20\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n2\n\n1 is a divisor of 1.", "sample_input": "4 12\n"}, "reference_outputs": ["16\n"], "source_document_id": "p03125", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nSample Input 1\n\n4 12\n\nSample Output 1\n\n16\n\nAs 4 is a divisor of 12, 4 + 12 = 16 should be printed.\n\nSample Input 2\n\n8 20\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n2\n\n1 is a divisor of 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 116, "cpu_time_ms": 12, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s878944376", "group_id": "codeNet:p03126", "input_text": "\n", "language": "PHP", "metadata": {"date": 1586390791, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03126.html", "problem_id": "p03126", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03126/input.txt", "sample_output_relpath": "derived/input_output/data/p03126/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03126/PHP/s878944376.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s878944376", "user_id": "u769447691"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "sample_input": "3 4\n2 1 3\n3 1 2 3\n2 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03126", "source_text": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 272, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s713314719", "group_id": "codeNet:p03126", "input_text": " $K) {\n printf(\"YES\\n\");\n}\nelse {\n printf(\"NO\\n\");\n}\n", "language": "PHP", "metadata": {"date": 1549764148, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03129.html", "problem_id": "p03129", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03129/input.txt", "sample_output_relpath": "derived/input_output/data/p03129/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03129/PHP/s412368457.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s412368457", "user_id": "u278278558"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": " $K) {\n printf(\"YES\\n\");\n}\nelse {\n printf(\"NO\\n\");\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "sample_input": "3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03129", "source_text": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 207, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s373308765", "group_id": "codeNet:p03131", "input_text": " $v){\n $d[$k] = $a[$k] - $b[$k];\n}\n\n$plus = [];\n$minus = [];\n\nforeach ($d as $i) {\n if ($i > 0) {\n $plus[] = $i;\n } elseif ($i < 0) {\n $minus[] = $i;\n }\n}\n\nif (array_sum($d) < 0) {\n echo -1 . \"\\n\";\n} elseif (count($minus) == 0) {\n echo 0 . \"\\n\";\n} else {\n arsort($plus);\n\n $sum_minus = array_sum($minus);\n\n $s = 0;\n $cnt = 0;\n foreach ($plus as $p) {\n $cnt++;\n $s += $p;\n\n if ($s >= -$sum_minus) {\n break;\n }\n }\n\n echo count($minus) + $cnt . \"\\n\";\n}", "language": "PHP", "metadata": {"date": 1547420604, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03151.html", "problem_id": "p03151", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03151/input.txt", "sample_output_relpath": "derived/input_output/data/p03151/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03151/PHP/s690910679.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s690910679", "user_id": "u619177558"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $v){\n $d[$k] = $a[$k] - $b[$k];\n}\n\n$plus = [];\n$minus = [];\n\nforeach ($d as $i) {\n if ($i > 0) {\n $plus[] = $i;\n } elseif ($i < 0) {\n $minus[] = $i;\n }\n}\n\nif (array_sum($d) < 0) {\n echo -1 . \"\\n\";\n} elseif (count($minus) == 0) {\n echo 0 . \"\\n\";\n} else {\n arsort($plus);\n\n $sum_minus = array_sum($minus);\n\n $s = 0;\n $cnt = 0;\n foreach ($plus as $p) {\n $cnt++;\n $s += $p;\n\n if ($s >= -$sum_minus) {\n break;\n }\n }\n\n echo count($minus) + $cnt . \"\\n\";\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA university student, Takahashi, has to take N examinations and pass all of them.\nCurrently, his readiness for the i-th examination is A_{i}, and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i-th examination.\n\nTakahashi thinks that he may not be able to pass all the examinations, and he has decided to ask a magician, Aoki, to change the readiness for as few examinations as possible so that he can pass all of them, while not changing the total readiness.\n\nFor Takahashi, find the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the following conditions:\n\nThe sum of the sequence A_1, A_2, ..., A_{N} and the sum of the sequence C_1, C_2, ..., C_{N} are equal.\n\nFor every i, B_i \\leq C_i holds.\n\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nA_i and B_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N}\nB_1 B_2 ... B_{N}\n\nOutput\n\nPrint the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the conditions.\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nSample Input 1\n\n3\n2 3 5\n3 4 1\n\nSample Output 1\n\n3\n\n(A_1, A_2, A_3) = (2, 3, 5) and (B_1, B_2, B_3) = (3, 4, 1). If nothing is done, he cannot pass the first and second exams.\nThe minimum possible number of indices i such that A_i and C_i are different, 3, is achieved when:\n\n(C_1, C_2, C_3) = (3, 5, 2)\n\nSample Input 2\n\n3\n2 3 3\n2 2 1\n\nSample Output 2\n\n0\n\nIn this case, he has to do nothing in order to pass all the exams.\n\nSample Input 3\n\n3\n17 7 1\n25 6 14\n\nSample Output 3\n\n-1\n\nIn this case, no matter what is done, he cannot pass all the exams.\n\nSample Input 4\n\n12\n757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604\n74164189 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212\n\nSample Output 4\n\n5", "sample_input": "3\n2 3 5\n3 4 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03151", "source_text": "Score : 400 points\n\nProblem Statement\n\nA university student, Takahashi, has to take N examinations and pass all of them.\nCurrently, his readiness for the i-th examination is A_{i}, and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i-th examination.\n\nTakahashi thinks that he may not be able to pass all the examinations, and he has decided to ask a magician, Aoki, to change the readiness for as few examinations as possible so that he can pass all of them, while not changing the total readiness.\n\nFor Takahashi, find the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the following conditions:\n\nThe sum of the sequence A_1, A_2, ..., A_{N} and the sum of the sequence C_1, C_2, ..., C_{N} are equal.\n\nFor every i, B_i \\leq C_i holds.\n\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nA_i and B_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N}\nB_1 B_2 ... B_{N}\n\nOutput\n\nPrint the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the conditions.\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nSample Input 1\n\n3\n2 3 5\n3 4 1\n\nSample Output 1\n\n3\n\n(A_1, A_2, A_3) = (2, 3, 5) and (B_1, B_2, B_3) = (3, 4, 1). If nothing is done, he cannot pass the first and second exams.\nThe minimum possible number of indices i such that A_i and C_i are different, 3, is achieved when:\n\n(C_1, C_2, C_3) = (3, 5, 2)\n\nSample Input 2\n\n3\n2 3 3\n2 2 1\n\nSample Output 2\n\n0\n\nIn this case, he has to do nothing in order to pass all the exams.\n\nSample Input 3\n\n3\n17 7 1\n25 6 14\n\nSample Output 3\n\n-1\n\nIn this case, no matter what is done, he cannot pass all the exams.\n\nSample Input 4\n\n12\n757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604\n74164189 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212\n\nSample Output 4\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 682, "cpu_time_ms": 57, "memory_kb": 31468}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s277638894", "group_id": "codeNet:p03156", "input_text": "$k){\n $dp[$i][$j] = max($dp[$i][$j], $dp[$i-1][$k] + $map[$i][$j]);\n }\n }\n }\n}\necho max($dp[$N-1]);\n", "language": "PHP", "metadata": {"date": 1556804106, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03162.html", "problem_id": "p03162", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03162/input.txt", "sample_output_relpath": "derived/input_output/data/p03162/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03162/PHP/s023340418.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s023340418", "user_id": "u248209126"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "$k){\n $dp[$i][$j] = max($dp[$i][$j], $dp[$i-1][$k] + $map[$i][$j]);\n }\n }\n }\n}\necho max($dp[$N-1]);\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 424, "cpu_time_ms": 237, "memory_kb": 86516}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s259538473", "group_id": "codeNet:p03164", "input_text": "$single_line_input = fgets(STDIN);\n// 取得した入力値を半角スペースで分解します\n$array = explode(\" \", $single_line_input);\n$item_num = $array[0];\n$weight_upper = $array[1];\nfor($i=0;$i<$array[0];++$i){\n fscanf(STDIN,\"%d %d \",$x,$y);\n $weight[$i]=$x;\n $value[$i]=$y;\n}\n\n$dp = [];\nforeach (range(0, $item_num-1) as $item_index) {\n $i_value = $value[$item_index];\n $i_weight = $weight[$item_index];\n\n foreach (range(1, 100001) as $value_index) {\n $zantei=$dp[$item_index-1][$value_index]?? PHP_INT_MAX;\n $new=(($dp[$item_index-1][$value_index-$value[$item_index]] ?? 0 )+$i_weight);\n $dp[$item_index][$value_index]=$new >=$zantei ? $zantei:$new;\n// if($value[$item_index] > $value_index) {\n// $new=($dp[$item_index-1][$weight_index-$weight[$item_index]] +$i_value);\n// $dp[$item_index][$weight_index]=$zantei >=$new ? $zantei:$new;\n// }else{\n// $dp[$item_index][$weight_index] = $zantei;};\n }\n\n\n\n}\necho $dp;", "language": "PHP", "metadata": {"date": 1572595402, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03164.html", "problem_id": "p03164", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03164/input.txt", "sample_output_relpath": "derived/input_output/data/p03164/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03164/PHP/s259538473.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s259538473", "user_id": "u891506774"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "$single_line_input = fgets(STDIN);\n// 取得した入力値を半角スペースで分解します\n$array = explode(\" \", $single_line_input);\n$item_num = $array[0];\n$weight_upper = $array[1];\nfor($i=0;$i<$array[0];++$i){\n fscanf(STDIN,\"%d %d \",$x,$y);\n $weight[$i]=$x;\n $value[$i]=$y;\n}\n\n$dp = [];\nforeach (range(0, $item_num-1) as $item_index) {\n $i_value = $value[$item_index];\n $i_weight = $weight[$item_index];\n\n foreach (range(1, 100001) as $value_index) {\n $zantei=$dp[$item_index-1][$value_index]?? PHP_INT_MAX;\n $new=(($dp[$item_index-1][$value_index-$value[$item_index]] ?? 0 )+$i_weight);\n $dp[$item_index][$value_index]=$new >=$zantei ? $zantei:$new;\n// if($value[$item_index] > $value_index) {\n// $new=($dp[$item_index-1][$weight_index-$weight[$item_index]] +$i_value);\n// $dp[$item_index][$weight_index]=$zantei >=$new ? $zantei:$new;\n// }else{\n// $dp[$item_index][$weight_index] = $zantei;};\n }\n\n\n\n}\necho $dp;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^9\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n1 1000000000\n1000000000 10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03164", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^9\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n1 1000000000\n1000000000 10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1012, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s951019189", "group_id": "codeNet:p03173", "input_text": "= 0; $l--){\n $sum = $As[$r+1]-$As[$l];\n $min = 10**18;\n for($m = $l; $m < $r; $m++){\n $tmp = $dp[$l][$m] + $dp[$m+1][$r];\n if($min > $tmp){\n $min = $tmp;\n }\n }\n $dp[$l][$r] = $sum+$min;\n }\n}\necho $dp[0][$n-1];\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array: \";\n echo implode(\" \", addIndex($val)).\"\\n\";\n }else{\n echo \"array:array\\n\";\n if(isCleanArray($val)){\n foreach($val as $row)echo implode(\" \", addIndex($row)).\"\\n\";\n }else{\n foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\nfunction addIndex($val){\n if(!isCleanArray($val)){\n $val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);\n }\n return $val;\n}\nfunction isCleanArray($array){\n $clean = true;\n $i = 0;\n foreach($array as $k => $v){\n if($k != $i++)$clean = false;\n }\n return $clean;\n}", "language": "PHP", "metadata": {"date": 1580588341, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03173.html", "problem_id": "p03173", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03173/input.txt", "sample_output_relpath": "derived/input_output/data/p03173/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03173/PHP/s951019189.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s951019189", "user_id": "u248209126"}, "prompt_components": {"gold_output": "190\n", "input_to_evaluate": "= 0; $l--){\n $sum = $As[$r+1]-$As[$l];\n $min = 10**18;\n for($m = $l; $m < $r; $m++){\n $tmp = $dp[$l][$m] + $dp[$m+1][$r];\n if($min > $tmp){\n $min = $tmp;\n }\n }\n $dp[$l][$r] = $sum+$min;\n }\n}\necho $dp[0][$n-1];\n\nfunction str(){\n return trim(fgets(STDIN));\n}\nfunction ints(){\n return array_map(\"intval\", explode(\" \", trim(fgets(STDIN))));\n}\nfunction int(){\n return intval(trim(fgets(STDIN)));\n}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\n\nfunction o(...$val){\n if(count($val)==1)$val = array_shift($val);\n $trace = debug_backtrace();\n echo $trace[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0){\n echo \"empty array\";\n }elseif(!is_array(current($val))){\n echo \"array: \";\n echo implode(\" \", addIndex($val)).\"\\n\";\n }else{\n echo \"array:array\\n\";\n if(isCleanArray($val)){\n foreach($val as $row)echo implode(\" \", addIndex($row)).\"\\n\";\n }else{\n foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)).\"\\n\";\n }\n }\n }else{\n echo $val.\"\\n\";\n }\n}\nfunction addIndex($val){\n if(!isCleanArray($val)){\n $val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);\n }\n return $val;\n}\nfunction isCleanArray($array){\n $clean = true;\n $i = 0;\n foreach($array as $k => $v){\n if($k != $i++)$clean = false;\n }\n return $clean;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N slimes lining up in a row.\nInitially, the i-th slime from the left has a size of a_i.\n\nTaro is trying to combine all the slimes into a larger slime.\nHe will perform the following operation repeatedly until there is only one slime:\n\nChoose two adjacent slimes, and combine them into a new slime. The new slime has a size of x + y, where x and y are the sizes of the slimes before combining them. Here, a cost of x + y is incurred. The positional relationship of the slimes does not change while combining slimes.\n\nFind the minimum possible total cost incurred.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 400\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 20 30 40\n\nSample Output 1\n\n190\n\nTaro should do as follows (slimes being combined are shown in bold):\n\n(10, 20, 30, 40) → (30, 30, 40)\n\n(30, 30, 40) → (60, 40)\n\n(60, 40) → (100)\n\nSample Input 2\n\n5\n10 10 10 10 10\n\nSample Output 2\n\n120\n\nTaro should do, for example, as follows:\n\n(10, 10, 10, 10, 10) → (20, 10, 10, 10)\n\n(20, 10, 10, 10) → (20, 20, 10)\n\n(20, 20, 10) → (20, 30)\n\n(20, 30) → (50)\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 4\n\n6\n7 6 8 6 1 1\n\nSample Output 4\n\n68\n\nTaro should do, for example, as follows:\n\n(7, 6, 8, 6, 1, 1) → (7, 6, 8, 6, 2)\n\n(7, 6, 8, 6, 2) → (7, 6, 8, 8)\n\n(7, 6, 8, 8) → (13, 8, 8)\n\n(13, 8, 8) → (13, 16)\n\n(13, 16) → (29)", "sample_input": "4\n10 20 30 40\n"}, "reference_outputs": ["190\n"], "source_document_id": "p03173", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N slimes lining up in a row.\nInitially, the i-th slime from the left has a size of a_i.\n\nTaro is trying to combine all the slimes into a larger slime.\nHe will perform the following operation repeatedly until there is only one slime:\n\nChoose two adjacent slimes, and combine them into a new slime. The new slime has a size of x + y, where x and y are the sizes of the slimes before combining them. Here, a cost of x + y is incurred. The positional relationship of the slimes does not change while combining slimes.\n\nFind the minimum possible total cost incurred.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 400\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 20 30 40\n\nSample Output 1\n\n190\n\nTaro should do as follows (slimes being combined are shown in bold):\n\n(10, 20, 30, 40) → (30, 30, 40)\n\n(30, 30, 40) → (60, 40)\n\n(60, 40) → (100)\n\nSample Input 2\n\n5\n10 10 10 10 10\n\nSample Output 2\n\n120\n\nTaro should do, for example, as follows:\n\n(10, 10, 10, 10, 10) → (20, 10, 10, 10)\n\n(20, 10, 10, 10) → (20, 20, 10)\n\n(20, 20, 10) → (20, 30)\n\n(20, 30) → (50)\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 4\n\n6\n7 6 8 6 1 1\n\nSample Output 4\n\n68\n\nTaro should do, for example, as follows:\n\n(7, 6, 8, 6, 1, 1) → (7, 6, 8, 6, 2)\n\n(7, 6, 8, 6, 2) → (7, 6, 8, 8)\n\n(7, 6, 8, 8) → (13, 8, 8)\n\n(13, 8, 8) → (13, 16)\n\n(13, 16) → (29)", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1809, "cpu_time_ms": 897, "memory_kb": 8696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s931170696", "group_id": "codeNet:p03192", "input_text": "nextInt();\n$P = $sc->nextInt();\n \nif ($N == 1) {\n echo $P . PHP_EOL;\n exit;\n}\nif ($P == 1) {\n echo 1 . PHP_EOL;\n exit;\n}\n \n$result = get_prime_factors($P);\n$ans = 1;\n\nforeach($result as $k => $v) {\n $ans *= pow($k, (int)($v/$N));\n}\n \necho $ans . PHP_EOL;\n \nclass Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nfunction get_prime_factors($N) {\n $result = [];\n \n for($i = 2; $i * $i <= $N; $i++) {\n if ($N % $i == 0) {\n while($N % $i == 0) {\n $result[$i]++;\n $N /= $i;\n }\n }\n }\n if ($N > 1) {\n $result[$N]++;\n $N /= $N;\n }\n return $result;\n}\n", "language": "PHP", "metadata": {"date": 1545593908, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03194.html", "problem_id": "p03194", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03194/input.txt", "sample_output_relpath": "derived/input_output/data/p03194/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03194/PHP/s953381537.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s953381537", "user_id": "u975773137"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "nextInt();\n$P = $sc->nextInt();\n \nif ($N == 1) {\n echo $P . PHP_EOL;\n exit;\n}\nif ($P == 1) {\n echo 1 . PHP_EOL;\n exit;\n}\n \n$result = get_prime_factors($P);\n$ans = 1;\n\nforeach($result as $k => $v) {\n $ans *= pow($k, (int)($v/$N));\n}\n \necho $ans . PHP_EOL;\n \nclass Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nfunction get_prime_factors($N) {\n $result = [];\n \n for($i = 2; $i * $i <= $N; $i++) {\n if ($N % $i == 0) {\n while($N % $i == 0) {\n $result[$i]++;\n $N /= $i;\n }\n }\n }\n if ($N > 1) {\n $result[$N]++;\n $N /= $N;\n }\n return $result;\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "sample_input": "3 24\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03194", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1350, "cpu_time_ms": 13, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s580146098", "group_id": "codeNet:p03200", "input_text": "\n", "language": "PHP", "metadata": {"date": 1552363716, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03207.html", "problem_id": "p03207", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03207/input.txt", "sample_output_relpath": "derived/input_output/data/p03207/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03207/PHP/s329198853.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s329198853", "user_id": "u109193095"}, "prompt_components": {"gold_output": "15950\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "sample_input": "3\n4980\n7980\n6980\n"}, "reference_outputs": ["15950\n"], "source_document_id": "p03207", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 222, "cpu_time_ms": 12, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s387488406", "group_id": "codeNet:p03208", "input_text": "count($trees)){continue;};\n $answer= $tree-$trees[$needed+$index];\n\n if ($final_answer > $answer) {\n $final_answer = $answer;\n }\n $index += 1;\n}\necho($final_answer);\n\n\n\n?>\n \n", "language": "PHP", "metadata": {"date": 1569632061, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03208.html", "problem_id": "p03208", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03208/input.txt", "sample_output_relpath": "derived/input_output/data/p03208/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03208/PHP/s222759863.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s222759863", "user_id": "u891506774"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "count($trees)){continue;};\n $answer= $tree-$trees[$needed+$index];\n\n if ($final_answer > $answer) {\n $final_answer = $answer;\n }\n $index += 1;\n}\necho($final_answer);\n\n\n\n?>\n \n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "sample_input": "5 3\n10\n15\n11\n14\n12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03208", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 490, "cpu_time_ms": 429, "memory_kb": 24052}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s354991551", "group_id": "codeNet:p03208", "input_text": " 1) {\n $sabun = max($tmpSabun1, $tmpSabun2);\n }\n $tmpSabun2 = $tmpSabun1;\n }\n echo $sabun;\n} \n?>", "language": "PHP", "metadata": {"date": 1561768472, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03211.html", "problem_id": "p03211", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03211/input.txt", "sample_output_relpath": "derived/input_output/data/p03211/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03211/PHP/s611809605.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s611809605", "user_id": "u248885906"}, "prompt_components": {"gold_output": "34\n", "input_to_evaluate": " 1) {\n $sabun = max($tmpSabun1, $tmpSabun2);\n }\n $tmpSabun2 = $tmpSabun1;\n }\n echo $sabun;\n} \n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a string S consisting of digits 1, 2, ..., 9.\nLunlun, the Dachshund, will take out three consecutive digits from S, treat them as a single integer X and bring it to her master. (She cannot rearrange the digits.)\n\nThe master's favorite number is 753. The closer to this number, the better.\nWhat is the minimum possible (absolute) difference between X and 753?\n\nConstraints\n\nS is a string of length between 4 and 10 (inclusive).\n\nEach character in S is 1, 2, ..., or 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum possible difference between X and 753.\n\nSample Input 1\n\n1234567876\n\nSample Output 1\n\n34\n\nTaking out the seventh to ninth characters results in X = 787, and the difference between this and 753 is 787 - 753 = 34. The difference cannot be made smaller, no matter where X is taken from.\n\nNote that the digits cannot be rearranged. For example, taking out 567 and rearranging it to 765 is not allowed.\n\nWe cannot take out three digits that are not consecutive from S, either. For example, taking out the seventh digit 7, the ninth digit 7 and the tenth digit 6 to obtain 776 is not allowed.\n\nSample Input 2\n\n35753\n\nSample Output 2\n\n0\n\nIf 753 itself can be taken out, the answer is 0.\n\nSample Input 3\n\n1111111111\n\nSample Output 3\n\n642\n\nNo matter where X is taken from, X = 111, with the difference 753 - 111 = 642.", "sample_input": "1234567876\n"}, "reference_outputs": ["34\n"], "source_document_id": "p03211", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a string S consisting of digits 1, 2, ..., 9.\nLunlun, the Dachshund, will take out three consecutive digits from S, treat them as a single integer X and bring it to her master. (She cannot rearrange the digits.)\n\nThe master's favorite number is 753. The closer to this number, the better.\nWhat is the minimum possible (absolute) difference between X and 753?\n\nConstraints\n\nS is a string of length between 4 and 10 (inclusive).\n\nEach character in S is 1, 2, ..., or 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum possible difference between X and 753.\n\nSample Input 1\n\n1234567876\n\nSample Output 1\n\n34\n\nTaking out the seventh to ninth characters results in X = 787, and the difference between this and 753 is 787 - 753 = 34. The difference cannot be made smaller, no matter where X is taken from.\n\nNote that the digits cannot be rearranged. For example, taking out 567 and rearranging it to 765 is not allowed.\n\nWe cannot take out three digits that are not consecutive from S, either. For example, taking out the seventh digit 7, the ninth digit 7 and the tenth digit 6 to obtain 776 is not allowed.\n\nSample Input 2\n\n35753\n\nSample Output 2\n\n0\n\nIf 753 itself can be taken out, the answer is 0.\n\nSample Input 3\n\n1111111111\n\nSample Output 3\n\n642\n\nNo matter where X is taken from, X = 111, with the difference 753 - 111 = 642.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 501, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s140538313", "group_id": "codeNet:p03219", "input_text": "\n", "language": "PHP", "metadata": {"date": 1541989537, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03219.html", "problem_id": "p03219", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03219/input.txt", "sample_output_relpath": "derived/input_output/data/p03219/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03219/PHP/s680372586.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s680372586", "user_id": "u457573294"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "sample_input": "81 58\n"}, "reference_outputs": ["110\n"], "source_document_id": "p03219", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 54, "cpu_time_ms": 11, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s732358206", "group_id": "codeNet:p03220", "input_text": "$arr) {\n\tsort($arr);\n\t$sorted_country_array[$key] =$arr;\n}\n\nforeach ($array as $aaa) {\n\t$num1 = $aaa[0];\n\t$num2 = $aaa[1];\n\t$num3 = array_search($num2, $sorted_country_array[$num1])+1;\n\techo make_ans_num($num1, $num3) . \"\\n\";\n}\n\n\n\n// 0うめする関数\nfunction make_ans_num ($num1, $num2){\n\t$leftnum = sprintf('%06d', $num1);\n\t$rightnum = sprintf('%06d', $num2);\n\treturn $leftnum . $rightnum;\n}\n", "language": "PHP", "metadata": {"date": 1569028546, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/PHP/s901058492.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s901058492", "user_id": "u972505846"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "$arr) {\n\tsort($arr);\n\t$sorted_country_array[$key] =$arr;\n}\n\nforeach ($array as $aaa) {\n\t$num1 = $aaa[0];\n\t$num2 = $aaa[1];\n\t$num3 = array_search($num2, $sorted_country_array[$num1])+1;\n\techo make_ans_num($num1, $num3) . \"\\n\";\n}\n\n\n\n// 0うめする関数\nfunction make_ans_num ($num1, $num2){\n\t$leftnum = sprintf('%06d', $num1);\n\t$rightnum = sprintf('%06d', $num2);\n\treturn $leftnum . $rightnum;\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 657, "cpu_time_ms": 2104, "memory_kb": 135280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s147319776", "group_id": "codeNet:p03221", "input_text": " $a) {\n if ($a[0] === $i) {\n $pref_data[] = array(\n 'index' => $j,\n 'year' => $a[1],\n );\n }\n }\n var_dump($pref_data);\n if (!empty($pref_data)) {\n //多次元配列のソート\n foreach ($pref_data as $key => $value) {\n $sort[$key] = $value['year']; //yearでソート\n }\n\n array_multisort($sort, SORT_ASC, $pref_data);\n\n $k = 1;\n $id_first = sprintf('%06d', $i);\n foreach ($pref_data as $pref) {\n $id_last = sprintf('%06d', $k);\n $data[$pref['index']][2] = $id_first. $id_last;\n $k++;\n }\n }\n}\n\nforeach ($data as $a) {\n echo $a[2].\"\\n\";\n}\n\n?>\n", "language": "PHP", "metadata": {"date": 1541386306, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/PHP/s147319776.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s147319776", "user_id": "u711496357"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": " $a) {\n if ($a[0] === $i) {\n $pref_data[] = array(\n 'index' => $j,\n 'year' => $a[1],\n );\n }\n }\n var_dump($pref_data);\n if (!empty($pref_data)) {\n //多次元配列のソート\n foreach ($pref_data as $key => $value) {\n $sort[$key] = $value['year']; //yearでソート\n }\n\n array_multisort($sort, SORT_ASC, $pref_data);\n\n $k = 1;\n $id_first = sprintf('%06d', $i);\n foreach ($pref_data as $pref) {\n $id_last = sprintf('%06d', $k);\n $data[$pref['index']][2] = $id_first. $id_last;\n $k++;\n }\n }\n}\n\nforeach ($data as $a) {\n echo $a[2].\"\\n\";\n}\n\n?>\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 869, "cpu_time_ms": 2111, "memory_kb": 123124}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s489794797", "group_id": "codeNet:p03221", "input_text": "nextInt();\n$m = $sc->nextInt();\n\n$list = [];\n\nfor ($i = 0; $i < $m; $i++) {\n $p = $sc->nextInt();\n $y = $sc->nextInt();\n $list[$p][$y] = $i + 1;\n}\n$ans_list = [];\nforeach($list as $k => $v) {\n ksort($v);\n $first_id = str_pad($k, 6, '0', STR_PAD_LEFT);\n $i = 1;\n foreach($v as $a) {\n $last_id = str_pad($i++, 6, '0', STR_PAD_LEFT);\n $ans_list[$a] = $first_id . $last_id;\n }\n}\nksort($ans_list);\n\necho implode(PHP_EOL, $ans_list) . PHP_EOL;\n\nclass Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n", "language": "PHP", "metadata": {"date": 1541385534, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/PHP/s489794797.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s489794797", "user_id": "u975773137"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "nextInt();\n$m = $sc->nextInt();\n\n$list = [];\n\nfor ($i = 0; $i < $m; $i++) {\n $p = $sc->nextInt();\n $y = $sc->nextInt();\n $list[$p][$y] = $i + 1;\n}\n$ans_list = [];\nforeach($list as $k => $v) {\n ksort($v);\n $first_id = str_pad($k, 6, '0', STR_PAD_LEFT);\n $i = 1;\n foreach($v as $a) {\n $last_id = str_pad($i++, 6, '0', STR_PAD_LEFT);\n $ans_list[$a] = $first_id . $last_id;\n }\n}\nksort($ans_list);\n\necho implode(PHP_EOL, $ans_list) . PHP_EOL;\n\nclass Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1191, "cpu_time_ms": 188, "memory_kb": 57844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s291709762", "group_id": "codeNet:p03227", "input_text": "= 0; $i--) {\n echo $S[$i];\n }\n }\n?>\n", "language": "PHP", "metadata": {"date": 1540690295, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03227.html", "problem_id": "p03227", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03227/input.txt", "sample_output_relpath": "derived/input_output/data/p03227/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03227/PHP/s291709762.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s291709762", "user_id": "u353984160"}, "prompt_components": {"gold_output": "cba\n", "input_to_evaluate": "= 0; $i--) {\n echo $S[$i];\n }\n }\n?>\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.\n\nConstraints\n\nThe length of S is 2 or 3.\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the length of S is 2, print S as is; if the length is 3, print S after reversing it.\n\nSample Input 1\n\nabc\n\nSample Output 1\n\ncba\n\nAs the length of S is 3, we print it after reversing it.\n\nSample Input 2\n\nac\n\nSample Output 2\n\nac\n\nAs the length of S is 2, we print it as is.", "sample_input": "abc\n"}, "reference_outputs": ["cba\n"], "source_document_id": "p03227", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.\n\nConstraints\n\nThe length of S is 2 or 3.\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the length of S is 2, print S as is; if the length is 3, print S after reversing it.\n\nSample Input 1\n\nabc\n\nSample Output 1\n\ncba\n\nAs the length of S is 3, we print it after reversing it.\n\nSample Input 2\n\nac\n\nSample Output 2\n\nac\n\nAs the length of S is 2, we print it as is.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 179, "cpu_time_ms": 12, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s423175722", "group_id": "codeNet:p03229", "input_text": " $m) list($m, $n) = array($n, $m);\n \n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n}\n \n//最小公倍数\nfunction lcm($m, $n){\n return $m * $n / gcd($m, $n);\n}\n\n$lcmnm = lcm($n, $m);\n\n$l = [];\n\nfor ($i = 0; $i < $n; $i++) {\n $l[$lcmnm / $n * $i] = $s[$i];\n}\n\n$result = true;\nfor ($i = 0; $i < $m; $i++) {\n if (isset($l[$lcmnm / $m * $i]) && $l[$lcmnm / $m * $i] != $t[$i]) {\n $result = false;\n break;\n }\n}\n\nif ($result) {\n echo $lcmnm . \"\\n\";\n} else {\n echo \"-1\\n\";\n}", "language": "PHP", "metadata": {"date": 1541882351, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03231.html", "problem_id": "p03231", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03231/input.txt", "sample_output_relpath": "derived/input_output/data/p03231/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03231/PHP/s422744062.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s422744062", "user_id": "u561927136"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": " $m) list($m, $n) = array($n, $m);\n \n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n}\n \n//最小公倍数\nfunction lcm($m, $n){\n return $m * $n / gcd($m, $n);\n}\n\n$lcmnm = lcm($n, $m);\n\n$l = [];\n\nfor ($i = 0; $i < $n; $i++) {\n $l[$lcmnm / $n * $i] = $s[$i];\n}\n\n$result = true;\nfor ($i = 0; $i < $m; $i++) {\n if (isset($l[$lcmnm / $m * $i]) && $l[$lcmnm / $m * $i] != $t[$i]) {\n $result = false;\n break;\n }\n}\n\nif ($result) {\n echo $lcmnm . \"\\n\";\n} else {\n echo \"-1\\n\";\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N and another string T of length M.\nThese strings consist of lowercase English letters.\n\nA string X is called a good string when the following conditions are all met:\n\nLet L be the length of X. L is divisible by both N and M.\n\nConcatenating the 1-st, (\\frac{L}{N}+1)-th, (2 \\times \\frac{L}{N}+1)-th, ..., ((N-1)\\times\\frac{L}{N}+1)-th characters of X, without changing the order, results in S.\n\nConcatenating the 1-st, (\\frac{L}{M}+1)-th, (2 \\times \\frac{L}{M}+1)-th, ..., ((M-1)\\times\\frac{L}{M}+1)-th characters of X, without changing the order, results in T.\n\nDetermine if there exists a good string. If it exists, find the length of the shortest such string.\n\nConstraints\n\n1 \\leq N,M \\leq 10^5\n\nS and T consist of lowercase English letters.\n\n|S|=N\n\n|T|=M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\nT\n\nOutput\n\nIf a good string does not exist, print -1; if it exists, print the length of the shortest such string.\n\nSample Input 1\n\n3 2\nacp\nae\n\nSample Output 1\n\n6\n\nFor example, the string accept is a good string.\nThere is no good string shorter than this, so the answer is 6.\n\nSample Input 2\n\n6 3\nabcdef\nabc\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n15 9\ndnsusrayukuaiia\ndujrunuma\n\nSample Output 3\n\n45", "sample_input": "3 2\nacp\nae\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03231", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N and another string T of length M.\nThese strings consist of lowercase English letters.\n\nA string X is called a good string when the following conditions are all met:\n\nLet L be the length of X. L is divisible by both N and M.\n\nConcatenating the 1-st, (\\frac{L}{N}+1)-th, (2 \\times \\frac{L}{N}+1)-th, ..., ((N-1)\\times\\frac{L}{N}+1)-th characters of X, without changing the order, results in S.\n\nConcatenating the 1-st, (\\frac{L}{M}+1)-th, (2 \\times \\frac{L}{M}+1)-th, ..., ((M-1)\\times\\frac{L}{M}+1)-th characters of X, without changing the order, results in T.\n\nDetermine if there exists a good string. If it exists, find the length of the shortest such string.\n\nConstraints\n\n1 \\leq N,M \\leq 10^5\n\nS and T consist of lowercase English letters.\n\n|S|=N\n\n|T|=M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\nT\n\nOutput\n\nIf a good string does not exist, print -1; if it exists, print the length of the shortest such string.\n\nSample Input 1\n\n3 2\nacp\nae\n\nSample Output 1\n\n6\n\nFor example, the string accept is a good string.\nThere is no good string shorter than this, so the answer is 6.\n\nSample Input 2\n\n6 3\nabcdef\nabc\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n15 9\ndnsusrayukuaiia\ndujrunuma\n\nSample Output 3\n\n45", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 704, "cpu_time_ms": 26, "memory_kb": 13048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s669402856", "group_id": "codeNet:p03238", "input_text": " $max && $F <= $m/$n){\n $max = max($max, $F);\n }\n}\necho $max;", "language": "PHP", "metadata": {"date": 1555854567, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03241.html", "problem_id": "p03241", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03241/input.txt", "sample_output_relpath": "derived/input_output/data/p03241/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03241/PHP/s490837883.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s490837883", "user_id": "u248209126"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $max && $F <= $m/$n){\n $max = max($max, $F);\n }\n}\necho $max;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "sample_input": "3 14\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03241", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 286, "cpu_time_ms": 13, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s975578106", "group_id": "codeNet:p03242", "input_text": "", "language": "PHP", "metadata": {"date": 1567224350, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03242.html", "problem_id": "p03242", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03242/input.txt", "sample_output_relpath": "derived/input_output/data/p03242/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03242/PHP/s975578106.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s975578106", "user_id": "u216734998"}, "prompt_components": {"gold_output": "991\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "sample_input": "119\n"}, "reference_outputs": ["991\n"], "source_document_id": "p03242", "source_text": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 157, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s438405343", "group_id": "codeNet:p03244", "input_text": " $v) {\n if ($i % 2 === 0) {\n $even_arr[] = $v;\n } else {\n $odd_arr[] = $v;\n }\n}\n\n// Odd\n$tmp_arr = [];\nforeach ($odd_arr as $odd) {\n if (!isset($tmp_arr[$odd])) {\n $tmp_arr[$odd] = 1;\n } else {\n ++$tmp_arr[$odd];\n }\n}\narsort($tmp_arr);\n\n\n$tmp_arr2 = [];\nforeach ($even_arr as $even) {\n if (!isset($tmp_arr2[$even])) {\n $tmp_arr2[$even] = 1;\n } else {\n ++$tmp_arr2[$even];\n }\n}\narsort($tmp_arr2);\n\n\n$odds = array_keys($tmp_arr);\n$evens = array_keys($tmp_arr2);\n\nif ($odds[0] !== $evens[0]) {\n $odd_count = count($odd_arr) - $tmp_arr[$odds[0]];\n $even_count = count($even_arr) - $tmp_arr2[$evens[0]];\n\n echo $odd_count + $even_count;\n} else {\n if ($tmp_arr[$odds[0]] > $tmp_arr2[$evens[0]]) {\n $odd_count = count($odd_arr) - $tmp_arr[$odds[0]];\n $even_count = count($even_arr) - $tmp_arr2[$evens[1]];\n\n echo $odd_count + $even_count;\n } else {\n $odd_count = count($odd_arr) - $tmp_arr[$odds[1]];\n $even_count = count($even_arr) - $tmp_arr2[$evens[0]];\n\n echo $odd_count + $even_count;\n }\n}\n", "language": "PHP", "metadata": {"date": 1586014406, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/PHP/s438405343.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s438405343", "user_id": "u376366206"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $v) {\n if ($i % 2 === 0) {\n $even_arr[] = $v;\n } else {\n $odd_arr[] = $v;\n }\n}\n\n// Odd\n$tmp_arr = [];\nforeach ($odd_arr as $odd) {\n if (!isset($tmp_arr[$odd])) {\n $tmp_arr[$odd] = 1;\n } else {\n ++$tmp_arr[$odd];\n }\n}\narsort($tmp_arr);\n\n\n$tmp_arr2 = [];\nforeach ($even_arr as $even) {\n if (!isset($tmp_arr2[$even])) {\n $tmp_arr2[$even] = 1;\n } else {\n ++$tmp_arr2[$even];\n }\n}\narsort($tmp_arr2);\n\n\n$odds = array_keys($tmp_arr);\n$evens = array_keys($tmp_arr2);\n\nif ($odds[0] !== $evens[0]) {\n $odd_count = count($odd_arr) - $tmp_arr[$odds[0]];\n $even_count = count($even_arr) - $tmp_arr2[$evens[0]];\n\n echo $odd_count + $even_count;\n} else {\n if ($tmp_arr[$odds[0]] > $tmp_arr2[$evens[0]]) {\n $odd_count = count($odd_arr) - $tmp_arr[$odds[0]];\n $even_count = count($even_arr) - $tmp_arr2[$evens[1]];\n\n echo $odd_count + $even_count;\n } else {\n $odd_count = count($odd_arr) - $tmp_arr[$odds[1]];\n $even_count = count($even_arr) - $tmp_arr2[$evens[0]];\n\n echo $odd_count + $even_count;\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1248, "cpu_time_ms": 44, "memory_kb": 25076}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s802650361", "group_id": "codeNet:p03244", "input_text": " $cnt) {\n $qk->insert([$i, $cnt], $cnt);\n}\nforeach ($vg_cnt as $i => $cnt) {\n $qg->insert([$i, $cnt], $cnt);\n}\n\n$vk = $qk->extract();\n$vg = $qg->extract();\nif ($vk[0] === $vg[0]) {\n if (!$qk->isEmpty()) {\n $vk2 = $qk->extract();\n } else {\n $vk2 = [-1, 0];\n }\n\n if (!$qg->isEmpty()) {\n $vg2 = $qg->extract();\n } else {\n $vg2 = [-1, 0];\n }\n\n if ($vk[1] + $vg2[1] > $vk2[1] + $vg[1]) {\n $vg = $vg2;\n } else {\n $vk = $vk2;\n }\n}\n$ans = count($v) - $vk[1] - $vg[1];\necho $ans;", "language": "PHP", "metadata": {"date": 1585361774, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/PHP/s802650361.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s802650361", "user_id": "u055687468"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $cnt) {\n $qk->insert([$i, $cnt], $cnt);\n}\nforeach ($vg_cnt as $i => $cnt) {\n $qg->insert([$i, $cnt], $cnt);\n}\n\n$vk = $qk->extract();\n$vg = $qg->extract();\nif ($vk[0] === $vg[0]) {\n if (!$qk->isEmpty()) {\n $vk2 = $qk->extract();\n } else {\n $vk2 = [-1, 0];\n }\n\n if (!$qg->isEmpty()) {\n $vg2 = $qg->extract();\n } else {\n $vg2 = [-1, 0];\n }\n\n if ($vk[1] + $vg2[1] > $vk2[1] + $vg[1]) {\n $vg = $vg2;\n } else {\n $vk = $vk2;\n }\n}\n$ans = count($v) - $vk[1] - $vg[1];\necho $ans;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1057, "cpu_time_ms": 87, "memory_kb": 94708}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s797530941", "group_id": "codeNet:p03252", "input_text": " $count){\n $product *= nCm($count + $N - 1, $count);\n $product %= MOD;\n}\necho $product;\n \n//足し算\nfunction addm($a, $b){\n return ($a + $b) % MOD;\n}\n//引き算\nfunction subm($a, $b){\n return ($a + MOD - $b) % MOD;\n}\n//掛け算\nfunction mulm($a, $b){\n return ($a * $b) % MOD;\n}\n//割り算\nfunction divm($a, $b){\n static $memo;\n if(!isset($memo[$a][$b])){\n $memo[$a][$b] = mulm($a, powerm($b, MOD - 2));\n }\n return $memo[$a][$b];\n}\n//累乗\nfunction powerm($a, $b){\n if($b == 0)return 1;\n if($b & 1)return (powerm($a, $b>>1)**2 % MOD) * $a % MOD;\n return powerm($a, $b>>1)**2 % MOD;\n}\n//階乗\nfunction factorialm($a){\n if($a == 0)return 1;\n if(!isset($memo[$a])){\n $memo[$a] = factorialm($a - 1) * $a % MOD;\n }\n return $memo[$a];\n}\n//順列\nfunction nPm($n, $m){\n static $memo;\n if($m == 0)return 1;\n if(!isset($memo[$n][$m])){\n $memo[$n][$m] = nPm($n, $m - 1) * ($n - $m + 1) % MOD;\n }\n return $memo[$n][$m];\n}\n//組み合わせ\nfunction nCm($n, $m){\n static $memo;\n if(!isset($memo[$n][$m])){\n $m = min($m, $n-$m);\n $memo[$n][$m] = divm(nPm($n, $m), factorialm($m));\n }\n return $memo[$n][$m];\n}", "language": "PHP", "metadata": {"date": 1560013725, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03253.html", "problem_id": "p03253", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03253/input.txt", "sample_output_relpath": "derived/input_output/data/p03253/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03253/PHP/s093489417.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s093489417", "user_id": "u248209126"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": " $count){\n $product *= nCm($count + $N - 1, $count);\n $product %= MOD;\n}\necho $product;\n \n//足し算\nfunction addm($a, $b){\n return ($a + $b) % MOD;\n}\n//引き算\nfunction subm($a, $b){\n return ($a + MOD - $b) % MOD;\n}\n//掛け算\nfunction mulm($a, $b){\n return ($a * $b) % MOD;\n}\n//割り算\nfunction divm($a, $b){\n static $memo;\n if(!isset($memo[$a][$b])){\n $memo[$a][$b] = mulm($a, powerm($b, MOD - 2));\n }\n return $memo[$a][$b];\n}\n//累乗\nfunction powerm($a, $b){\n if($b == 0)return 1;\n if($b & 1)return (powerm($a, $b>>1)**2 % MOD) * $a % MOD;\n return powerm($a, $b>>1)**2 % MOD;\n}\n//階乗\nfunction factorialm($a){\n if($a == 0)return 1;\n if(!isset($memo[$a])){\n $memo[$a] = factorialm($a - 1) * $a % MOD;\n }\n return $memo[$a];\n}\n//順列\nfunction nPm($n, $m){\n static $memo;\n if($m == 0)return 1;\n if(!isset($memo[$n][$m])){\n $memo[$n][$m] = nPm($n, $m - 1) * ($n - $m + 1) % MOD;\n }\n return $memo[$n][$m];\n}\n//組み合わせ\nfunction nCm($n, $m){\n static $memo;\n if(!isset($memo[$n][$m])){\n $m = min($m, $n-$m);\n $memo[$n][$m] = divm(nPm($n, $m), factorialm($m));\n }\n return $memo[$n][$m];\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given positive integers N and M.\n\nHow many sequences a of length N consisting of positive integers satisfy a_1 \\times a_2 \\times ... \\times a_N = M? Find the count modulo 10^9+7.\n\nHere, two sequences a' and a'' are considered different when there exists some i such that a_i' \\neq a_i''.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n2 6\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: \\{a_1, a_2\\} = \\{1, 6\\}, \\{2, 3\\}, \\{3, 2\\} and \\{6, 1\\}.\n\nSample Input 2\n\n3 12\n\nSample Output 2\n\n18\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n957870001", "sample_input": "2 6\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03253", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given positive integers N and M.\n\nHow many sequences a of length N consisting of positive integers satisfy a_1 \\times a_2 \\times ... \\times a_N = M? Find the count modulo 10^9+7.\n\nHere, two sequences a' and a'' are considered different when there exists some i such that a_i' \\neq a_i''.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n2 6\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: \\{a_1, a_2\\} = \\{1, 6\\}, \\{2, 3\\}, \\{3, 2\\} and \\{6, 1\\}.\n\nSample Input 2\n\n3 12\n\nSample Output 2\n\n18\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n957870001", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1440, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s120729514", "group_id": "codeNet:p03254", "input_text": "\n", "language": "PHP", "metadata": {"date": 1537063260, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/PHP/s120729514.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s120729514", "user_id": "u711496357"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 453, "cpu_time_ms": 11, "memory_kb": 3956}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s188481716", "group_id": "codeNet:p03265", "input_text": " $p[$k + 1] && $p[$k + 1] > $p[$k + 2]) {\n list($p[$k], $p[$k + 2]) = [$p[$k + 2], $p[$k]];\n }\n }\n}\n\n$sorted = true;\n\nfor ($i = 0; $i < $N - 1; $i++) {\n if ($p[$i] > $p[$i + 1]) {\n $sorted = false;\n break;\n }\n}\n\necho $sorted ? \"Yes\\n\" : \"No\\n\";", "language": "PHP", "metadata": {"date": 1535853239, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03271.html", "problem_id": "p03271", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03271/input.txt", "sample_output_relpath": "derived/input_output/data/p03271/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03271/PHP/s173403745.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s173403745", "user_id": "u975073965"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " $p[$k + 1] && $p[$k + 1] > $p[$k + 2]) {\n list($p[$k], $p[$k + 2]) = [$p[$k + 2], $p[$k]];\n }\n }\n}\n\n$sorted = true;\n\nfor ($i = 0; $i < $N - 1; $i++) {\n if ($p[$i] > $p[$i + 1]) {\n $sorted = false;\n break;\n }\n}\n\necho $sorted ? \"Yes\\n\" : \"No\\n\";", "problem_context": "Score : 1200 points\n\nProblem Statement\n\nYou are given a permutation of 1,2,...,N: p_1,p_2,...,p_N. Determine if the state where p_i=i for every i can be reached by performing the following operation any number of times:\n\nChoose three elements p_{i-1},p_{i},p_{i+1} (2\\leq i\\leq N-1) such that p_{i-1}>p_{i}>p_{i+1} and reverse the order of these three.\n\nConstraints\n\n3 \\leq N \\leq 3 × 10^5\n\np_1,p_2,...,p_N is a permutation of 1,2,...,N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\n:\np_N\n\nOutput\n\nIf the state where p_i=i for every i can be reached by performing the operation, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n5\n2\n1\n4\n3\n\nSample Output 1\n\nYes\n\nThe state where p_i=i for every i can be reached as follows:\n\nReverse the order of p_1,p_2,p_3. The sequence p becomes 1,2,5,4,3.\n\nReverse the order of p_3,p_4,p_5. The sequence p becomes 1,2,3,4,5.\n\nSample Input 2\n\n4\n3\n2\n4\n1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n7\n3\n2\n1\n6\n5\n4\n7\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n6\n5\n3\n4\n1\n2\n6\n\nSample Output 4\n\nNo", "sample_input": "5\n5\n2\n1\n4\n3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03271", "source_text": "Score : 1200 points\n\nProblem Statement\n\nYou are given a permutation of 1,2,...,N: p_1,p_2,...,p_N. Determine if the state where p_i=i for every i can be reached by performing the following operation any number of times:\n\nChoose three elements p_{i-1},p_{i},p_{i+1} (2\\leq i\\leq N-1) such that p_{i-1}>p_{i}>p_{i+1} and reverse the order of these three.\n\nConstraints\n\n3 \\leq N \\leq 3 × 10^5\n\np_1,p_2,...,p_N is a permutation of 1,2,...,N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\n:\np_N\n\nOutput\n\nIf the state where p_i=i for every i can be reached by performing the operation, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n5\n2\n1\n4\n3\n\nSample Output 1\n\nYes\n\nThe state where p_i=i for every i can be reached as follows:\n\nReverse the order of p_1,p_2,p_3. The sequence p becomes 1,2,5,4,3.\n\nReverse the order of p_3,p_4,p_5. The sequence p becomes 1,2,3,4,5.\n\nSample Input 2\n\n4\n3\n2\n4\n1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n7\n3\n2\n1\n6\n5\n4\n7\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n6\n5\n3\n4\n1\n2\n6\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 563, "cpu_time_ms": 2104, "memory_kb": 133996}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s640162291", "group_id": "codeNet:p03273", "input_text": " 0) {\n echo $x[$k - 1];\n exit;\n}\nif ($x[$n - 1] < 0) {\n echo -$x[$n - $k];\n exit;\n}\n$l = $r = [0];\nfor ($i = 0; $i < $n; $i++) {\n if ($x[$i] < 0) {\n $l[] = -$x[$i];\n } elseif ($x[$i] > 0) {\n $r[] = $x[$i];\n } else {\n $k--;\n }\n}\n$ans = 10 ** 10;\nsort($l);\nfor ($i = 0; $i <= $k; $i++) {\n if (!isset($l[$i]) || !isset($r[$k - $i])) continue;\n $d = [$l[$i], $r[$k - $i]];\n sort($d);\n $ans = min($ans, $d[0] * 2 + $d[1]);\n}\necho $ans;", "language": "PHP", "metadata": {"date": 1590181696, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03274.html", "problem_id": "p03274", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03274/input.txt", "sample_output_relpath": "derived/input_output/data/p03274/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03274/PHP/s757180017.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s757180017", "user_id": "u055687468"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": " 0) {\n echo $x[$k - 1];\n exit;\n}\nif ($x[$n - 1] < 0) {\n echo -$x[$n - $k];\n exit;\n}\n$l = $r = [0];\nfor ($i = 0; $i < $n; $i++) {\n if ($x[$i] < 0) {\n $l[] = -$x[$i];\n } elseif ($x[$i] > 0) {\n $r[] = $x[$i];\n } else {\n $k--;\n }\n}\n$ans = 10 ** 10;\nsort($l);\nfor ($i = 0; $i <= $k; $i++) {\n if (!isset($l[$i]) || !isset($r[$k - $i])) continue;\n $d = [$l[$i], $r[$k - $i]];\n sort($d);\n $ans = min($ans, $d[0] * 2 + $d[1]);\n}\necho $ans;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "sample_input": "5 3\n-30 -10 10 20 50\n"}, "reference_outputs": ["40\n"], "source_document_id": "p03274", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 601, "cpu_time_ms": 59, "memory_kb": 20980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s991393998", "group_id": "codeNet:p03282", "input_text": "= $k) {\n $ans = $n;\n break;\n } else {\n $k -= $n ** $N;\n }\n}\necho $ans;", "language": "PHP", "metadata": {"date": 1590335394, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03282.html", "problem_id": "p03282", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03282/input.txt", "sample_output_relpath": "derived/input_output/data/p03282/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03282/PHP/s991393998.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s991393998", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= $k) {\n $ans = $n;\n break;\n } else {\n $k -= $n ** $N;\n }\n}\necho $ans;", "problem_context": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "sample_input": "1214\n4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03282", "source_text": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s699808516", "group_id": "codeNet:p03282", "input_text": " $array[$i]) {\n\t\t$other = $i;\n\t\t$pos = $array[$i];\n\t}\n}\n// echo \"other: \" . $other . PHP_EOL;\nif ($other == \"\") {\n\t$len1 = strlen($S);\n} else {\n\t$len1 = min($array);\n}\nif ($K <= $len1) {\n\techo \"1\";\n} else {\n\techo $other;\n}\n", "language": "PHP", "metadata": {"date": 1535065856, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03282.html", "problem_id": "p03282", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03282/input.txt", "sample_output_relpath": "derived/input_output/data/p03282/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03282/PHP/s373497973.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s373497973", "user_id": "u195912432"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $array[$i]) {\n\t\t$other = $i;\n\t\t$pos = $array[$i];\n\t}\n}\n// echo \"other: \" . $other . PHP_EOL;\nif ($other == \"\") {\n\t$len1 = strlen($S);\n} else {\n\t$len1 = min($array);\n}\nif ($K <= $len1) {\n\techo \"1\";\n} else {\n\techo $other;\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "sample_input": "1214\n4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03282", "source_text": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 530, "cpu_time_ms": 13, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s911707510", "group_id": "codeNet:p03282", "input_text": "", "language": "PHP", "metadata": {"date": 1534642976, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03282.html", "problem_id": "p03282", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03282/input.txt", "sample_output_relpath": "derived/input_output/data/p03282/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03282/PHP/s911707510.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s911707510", "user_id": "u121791689"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "sample_input": "1214\n4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03282", "source_text": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 341, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s333641035", "group_id": "codeNet:p03283", "input_text": "", "language": "PHP", "metadata": {"date": 1575946578, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03288.html", "problem_id": "p03288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03288/input.txt", "sample_output_relpath": "derived/input_output/data/p03288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03288/PHP/s699070319.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s699070319", "user_id": "u723414064"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "sample_input": "1199\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03288", "source_text": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 226, "cpu_time_ms": 10, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s156472960", "group_id": "codeNet:p03288", "input_text": "", "language": "PHP", "metadata": {"date": 1534288194, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03288.html", "problem_id": "p03288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03288/input.txt", "sample_output_relpath": "derived/input_output/data/p03288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03288/PHP/s156472960.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s156472960", "user_id": "u162430923"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "sample_input": "1199\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03288", "source_text": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 119, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s135375750", "group_id": "codeNet:p03288", "input_text": "", "language": "PHP", "metadata": {"date": 1534097130, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03288.html", "problem_id": "p03288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03288/input.txt", "sample_output_relpath": "derived/input_output/data/p03288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03288/PHP/s135375750.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s135375750", "user_id": "u692797455"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "sample_input": "1199\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03288", "source_text": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 107, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s922985401", "group_id": "codeNet:p03289", "input_text": " 0; $i--){\n $current_point = $i*100;\n if($zan_point <= $current_point*$p[$i-1] + $c[$i-1]){\n for($j = 1;$j <= $p[$i-1]; $j++){\n if($zan_point - $current_point*$j == 0){\n echo $result;\n return;\n }elseif($zan_point - $current_point*$j < 0){\n echo $result;\n return;\n }else{\n $result = $result + 1;\n }\n }\n }else{\n $zan_point = $zan_point - ($current_point*$p[$i-1] + $c[$i-1]);\n $result = $result + $p[$i-1];\n continue;\n }\n}\n?>", "language": "PHP", "metadata": {"date": 1534129573, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03290.html", "problem_id": "p03290", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03290/input.txt", "sample_output_relpath": "derived/input_output/data/p03290/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03290/PHP/s659373846.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s659373846", "user_id": "u365721562"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " 0; $i--){\n $current_point = $i*100;\n if($zan_point <= $current_point*$p[$i-1] + $c[$i-1]){\n for($j = 1;$j <= $p[$i-1]; $j++){\n if($zan_point - $current_point*$j == 0){\n echo $result;\n return;\n }elseif($zan_point - $current_point*$j < 0){\n echo $result;\n return;\n }else{\n $result = $result + 1;\n }\n }\n }else{\n $zan_point = $zan_point - ($current_point*$p[$i-1] + $c[$i-1]);\n $result = $result + $p[$i-1];\n continue;\n }\n}\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "sample_input": "2 700\n3 500\n5 800\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03290", "source_text": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 650, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s483435524", "group_id": "codeNet:p03291", "input_text": " $string){\n\t\tfor($i=0;$i<$length;$i++){\n\t\t\tif($string[$i] === \"?\"){\n\t\t\t\t#echo \"true\";\n\t\t\t\tunset($strings[$key]);\n\t\t\t\t$factor = explode(\"?\", $string, 2);\n\t\t\t\t\n\t\t\t\t#var_dump($factor);\n\t\t\t\t$strings[] = $factor[0] . \"A\" . $factor[1];\n\t\t\t\t$strings[] = $factor[0] . \"B\" . $factor[1];\n\t\t\t\t$strings[] = $factor[0] . \"C\" . $factor[1];\n\t\t\t\t#var_dump($strings);\n\t\t\t\tdisassembly($strings, $length);\n\t\t\t}\n\t\t}\n\t}\n\treturn $strings;\n}\n\nfunction check($strings, $length){\n\t$count = 0;\n\tforeach($strings as $string){\n\t\t$a = false;\n\t\t$b = false;\n\t\tfor($i=0;$i<$length;$i++){\n\t\t\tif($string[$i] === \"A\"){\n\t\t\t\t$a = true;\n\t\t\t}elseif($string[$i] === \"B\"){\n\t\t\t\t$b = true;\n\t\t\t}else{\n\t\t\t\tif($a and $b){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $count;\n}\n\n?>", "language": "PHP", "metadata": {"date": 1533522614, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03291.html", "problem_id": "p03291", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03291/input.txt", "sample_output_relpath": "derived/input_output/data/p03291/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03291/PHP/s483435524.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s483435524", "user_id": "u571053945"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": " $string){\n\t\tfor($i=0;$i<$length;$i++){\n\t\t\tif($string[$i] === \"?\"){\n\t\t\t\t#echo \"true\";\n\t\t\t\tunset($strings[$key]);\n\t\t\t\t$factor = explode(\"?\", $string, 2);\n\t\t\t\t\n\t\t\t\t#var_dump($factor);\n\t\t\t\t$strings[] = $factor[0] . \"A\" . $factor[1];\n\t\t\t\t$strings[] = $factor[0] . \"B\" . $factor[1];\n\t\t\t\t$strings[] = $factor[0] . \"C\" . $factor[1];\n\t\t\t\t#var_dump($strings);\n\t\t\t\tdisassembly($strings, $length);\n\t\t\t}\n\t\t}\n\t}\n\treturn $strings;\n}\n\nfunction check($strings, $length){\n\t$count = 0;\n\tforeach($strings as $string){\n\t\t$a = false;\n\t\t$b = false;\n\t\tfor($i=0;$i<$length;$i++){\n\t\t\tif($string[$i] === \"A\"){\n\t\t\t\t$a = true;\n\t\t\t}elseif($string[$i] === \"B\"){\n\t\t\t\t$b = true;\n\t\t\t}else{\n\t\t\t\tif($a and $b){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $count;\n}\n\n?>", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThe ABC number of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions:\n\n1 ≤ i < j < k ≤ |T| (|T| is the length of T.)\n\nT_i = A (T_i is the i-th character of T from the beginning.)\n\nT_j = B\n\nT_k = C\n\nFor example, when T = ABCBC, there are three triples of integers (i, j, k) that satisfy the conditions: (1, 2, 3), (1, 2, 5), (1, 4, 5). Thus, the ABC number of T is 3.\n\nYou are given a string S. Each character of S is A, B, C or ?.\n\nLet Q be the number of occurrences of ? in S. We can make 3^Q strings by replacing each occurrence of ? in S with A, B or C. Find the sum of the ABC numbers of all these strings.\n\nThis sum can be extremely large, so print the sum modulo 10^9 + 7.\n\nConstraints\n\n3 ≤ |S| ≤ 10^5\n\nEach character of S is A, B, C or ?.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the ABC numbers of all the 3^Q strings, modulo 10^9 + 7.\n\nSample Input 1\n\nA??C\n\nSample Output 1\n\n8\n\nIn this case, Q = 2, and we can make 3^Q = 9 strings by by replacing each occurrence of ? with A, B or C. The ABC number of each of these strings is as follows:\n\nAAAC: 0\n\nAABC: 2\n\nAACC: 0\n\nABAC: 1\n\nABBC: 2\n\nABCC: 2\n\nACAC: 0\n\nACBC: 1\n\nACCC: 0\n\nThe sum of these is 0 + 2 + 0 + 1 + 2 + 2 + 0 + 1 + 0 = 8, so we print 8 modulo 10^9 + 7, that is, 8.\n\nSample Input 2\n\nABCBC\n\nSample Output 2\n\n3\n\nWhen Q = 0, we print the ABC number of S itself, modulo 10^9 + 7. This string is the same as the one given as an example in the problem statement, and its ABC number is 3.\n\nSample Input 3\n\n????C?????B??????A???????\n\nSample Output 3\n\n979596887\n\nIn this case, the sum of the ABC numbers of all the 3^Q strings is 2291979612924, and we should print this number modulo 10^9 + 7, that is, 979596887.", "sample_input": "A??C\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03291", "source_text": "Score : 400 points\n\nProblem Statement\n\nThe ABC number of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions:\n\n1 ≤ i < j < k ≤ |T| (|T| is the length of T.)\n\nT_i = A (T_i is the i-th character of T from the beginning.)\n\nT_j = B\n\nT_k = C\n\nFor example, when T = ABCBC, there are three triples of integers (i, j, k) that satisfy the conditions: (1, 2, 3), (1, 2, 5), (1, 4, 5). Thus, the ABC number of T is 3.\n\nYou are given a string S. Each character of S is A, B, C or ?.\n\nLet Q be the number of occurrences of ? in S. We can make 3^Q strings by replacing each occurrence of ? in S with A, B or C. Find the sum of the ABC numbers of all these strings.\n\nThis sum can be extremely large, so print the sum modulo 10^9 + 7.\n\nConstraints\n\n3 ≤ |S| ≤ 10^5\n\nEach character of S is A, B, C or ?.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the ABC numbers of all the 3^Q strings, modulo 10^9 + 7.\n\nSample Input 1\n\nA??C\n\nSample Output 1\n\n8\n\nIn this case, Q = 2, and we can make 3^Q = 9 strings by by replacing each occurrence of ? with A, B or C. The ABC number of each of these strings is as follows:\n\nAAAC: 0\n\nAABC: 2\n\nAACC: 0\n\nABAC: 1\n\nABBC: 2\n\nABCC: 2\n\nACAC: 0\n\nACBC: 1\n\nACCC: 0\n\nThe sum of these is 0 + 2 + 0 + 1 + 2 + 2 + 0 + 1 + 0 = 8, so we print 8 modulo 10^9 + 7, that is, 8.\n\nSample Input 2\n\nABCBC\n\nSample Output 2\n\n3\n\nWhen Q = 0, we print the ABC number of S itself, modulo 10^9 + 7. This string is the same as the one given as an example in the problem statement, and its ABC number is 3.\n\nSample Input 3\n\n????C?????B??????A???????\n\nSample Output 3\n\n979596887\n\nIn this case, the sum of the ABC numbers of all the 3^Q strings is 2291979612924, and we should print this number modulo 10^9 + 7, that is, 979596887.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 961, "cpu_time_ms": 2123, "memory_kb": 375288}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s936666697", "group_id": "codeNet:p03292", "input_text": "= 2) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (count($args) >= 2) {\n\t\tbreak;\n\t}\n}\n\n\n$islands = (int)$args[0];\n$request_cnt = (int)$args[1];\n$b_count = $islands-1;\n$b_array = [];\n$cnt = 0;\n$requests=[];\n\nwhile ($cnt < $request_cnt) {\n\t$input = trim(fgets(STDIN));\n\t$input = explode(\" \", $input);\n\t$requests[(string)$input[0]] = (int)$input[1];\n\t++$cnt;\n}\nasort($requests);\n\n$result = 0;\n$prev = -1;\nforeach ($requests as $from => $to) {\n\tif ($from < $prev) {\n\t\tcontinue;\n\t}\n\t++$result;\n\t$prev = $to;\n}\n\n\nout($result);\n\n\n\nfunction out($var){\n\techo $var , PHP_EOL;\n}\n", "language": "PHP", "metadata": {"date": 1532303751, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03295.html", "problem_id": "p03295", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03295/input.txt", "sample_output_relpath": "derived/input_output/data/p03295/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03295/PHP/s875908961.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s875908961", "user_id": "u699888017"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "= 2) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (count($args) >= 2) {\n\t\tbreak;\n\t}\n}\n\n\n$islands = (int)$args[0];\n$request_cnt = (int)$args[1];\n$b_count = $islands-1;\n$b_array = [];\n$cnt = 0;\n$requests=[];\n\nwhile ($cnt < $request_cnt) {\n\t$input = trim(fgets(STDIN));\n\t$input = explode(\" \", $input);\n\t$requests[(string)$input[0]] = (int)$input[1];\n\t++$cnt;\n}\nasort($requests);\n\n$result = 0;\n$prev = -1;\nforeach ($requests as $from => $to) {\n\tif ($from < $prev) {\n\t\tcontinue;\n\t}\n\t++$result;\n\t$prev = $to;\n}\n\n\nout($result);\n\n\n\nfunction out($var){\n\techo $var , PHP_EOL;\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "sample_input": "5 2\n1 4\n2 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03295", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 700, "cpu_time_ms": 69, "memory_kb": 13048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s776474945", "group_id": "codeNet:p03295", "input_text": "= 2) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (count($args) >= 2) {\n\t\tbreak;\n\t}\n}\n\n\n$islands = (int)$args[0];\n$request_cnt = (int)$args[1];\n$b_count = $islands-1;\n$b_array = [];\n$cnt = 0;\n$requests=[];\n\nwhile ($cnt < $request_cnt) {\n\t$input = trim(fgets(STDIN));\n\t$input = explode(\" \", $input);\n\t$requests[] = [(int)$input[0], (int)$input[1]];\n\t++$cnt;\n}\n\nfor ($i=1; $i <= $b_count; $i++) { \n\t$b_array[] = $i;\n}\n\n$cut_num = 0;\n$end_flg = false;\nfor ($bridge=1; $bridge <= $b_count; $bridge++) { \n\t$cut_num = $bridge;\n\t$kumi = kumiawase($b_array, $cut_num);\n\tforeach ($kumi as $value) {\n\t\tif ($value === []) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (is_resolved($requests, $value)) {\n\t\t\t$end_flg = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif($end_flg == true){\n\t\tbreak;\n\t}\n}\n\n\nout($cut_num);\n\nfunction out($var){\n\techo $var , PHP_EOL;\n}\n\n\nfunction is_resolved($requests, $cut_bridge_array){\n\t$resolved = [];\n\tforeach ($requests as $key => $request) {\n\t\tforeach ($cut_bridge_array as $value) {\n\t\t\tif(_is_resolved($request, $value)){\n\t\t\t\t$resolved[$key] = $request;\n\t\t\t}\n\t\t}\n\t}\n\tif (count($requests) == count($resolved)) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction _is_resolved($request, $cut_bridge){\n\tif (!_include($request, $cut_bridge)) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n\nfunction _include($request, $bridge){\n\tif ($bridge >= $request[0] && $bridge < $request[1]) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction kumiawase($zentai,$nukitorisu){\n $zentaisu=count($zentai);\n $arrs = [];\n if($zentaisu<$nukitorisu){\n return [];\n }elseif($nukitorisu==1){\n for($i=0;$i<$zentaisu;$i++){\n $arrs[$i]=array($zentai[$i]);\n }\n }elseif($nukitorisu>1){\n $j=0;\n for($i=0;$i<$zentaisu-$nukitorisu+1;$i++){\n $ts=kumiawase(array_slice($zentai,$i+1),$nukitorisu-1);\n foreach($ts as $t){\n array_unshift($t,$zentai[$i]);\n $arrs[$j]=$t;\n $j++;\n }\n }\n }\n return $arrs;\n}", "language": "PHP", "metadata": {"date": 1532292899, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03295.html", "problem_id": "p03295", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03295/input.txt", "sample_output_relpath": "derived/input_output/data/p03295/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03295/PHP/s776474945.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s776474945", "user_id": "u699888017"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "= 2) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (count($args) >= 2) {\n\t\tbreak;\n\t}\n}\n\n\n$islands = (int)$args[0];\n$request_cnt = (int)$args[1];\n$b_count = $islands-1;\n$b_array = [];\n$cnt = 0;\n$requests=[];\n\nwhile ($cnt < $request_cnt) {\n\t$input = trim(fgets(STDIN));\n\t$input = explode(\" \", $input);\n\t$requests[] = [(int)$input[0], (int)$input[1]];\n\t++$cnt;\n}\n\nfor ($i=1; $i <= $b_count; $i++) { \n\t$b_array[] = $i;\n}\n\n$cut_num = 0;\n$end_flg = false;\nfor ($bridge=1; $bridge <= $b_count; $bridge++) { \n\t$cut_num = $bridge;\n\t$kumi = kumiawase($b_array, $cut_num);\n\tforeach ($kumi as $value) {\n\t\tif ($value === []) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (is_resolved($requests, $value)) {\n\t\t\t$end_flg = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif($end_flg == true){\n\t\tbreak;\n\t}\n}\n\n\nout($cut_num);\n\nfunction out($var){\n\techo $var , PHP_EOL;\n}\n\n\nfunction is_resolved($requests, $cut_bridge_array){\n\t$resolved = [];\n\tforeach ($requests as $key => $request) {\n\t\tforeach ($cut_bridge_array as $value) {\n\t\t\tif(_is_resolved($request, $value)){\n\t\t\t\t$resolved[$key] = $request;\n\t\t\t}\n\t\t}\n\t}\n\tif (count($requests) == count($resolved)) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction _is_resolved($request, $cut_bridge){\n\tif (!_include($request, $cut_bridge)) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n\nfunction _include($request, $bridge){\n\tif ($bridge >= $request[0] && $bridge < $request[1]) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction kumiawase($zentai,$nukitorisu){\n $zentaisu=count($zentai);\n $arrs = [];\n if($zentaisu<$nukitorisu){\n return [];\n }elseif($nukitorisu==1){\n for($i=0;$i<$zentaisu;$i++){\n $arrs[$i]=array($zentai[$i]);\n }\n }elseif($nukitorisu>1){\n $j=0;\n for($i=0;$i<$zentaisu-$nukitorisu+1;$i++){\n $ts=kumiawase(array_slice($zentai,$i+1),$nukitorisu-1);\n foreach($ts as $t){\n array_unshift($t,$zentai[$i]);\n $arrs[$j]=$t;\n $j++;\n }\n }\n }\n return $arrs;\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "sample_input": "5 2\n1 4\n2 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03295", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2022, "cpu_time_ms": 2107, "memory_kb": 90988}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s340524662", "group_id": "codeNet:p03307", "input_text": "= 1) {\n $mid = intdiv($r + $l, 2);\n /* echo \"l: $l, r: $r, mid: $mid\", PHP_EOL; */\n if ($A[$mid] === 1) {\n $i1 = $mid;\n break;\n } else if ($A[$mid] > 1) {\n $r = $mid;\n } else {\n $l = $mid + 1;\n }\n}\n\n// 左には$i1こ\n// 右には$n - 1 - $i1こ\n\n/* echo \"i1: $i1, \" . ceil($i1 / ($k - 1)) . \", \" . ceil(($n - 1 - $i1) / ($k - 1)), PHP_EOL; */\necho ceil($i1 / ($k - 1)) + ceil(($n - 1 - $i1) / ($k - 1));\n", "language": "PHP", "metadata": {"date": 1592080645, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03317.html", "problem_id": "p03317", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03317/input.txt", "sample_output_relpath": "derived/input_output/data/p03317/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03317/PHP/s976480781.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s976480781", "user_id": "u376366206"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= 1) {\n $mid = intdiv($r + $l, 2);\n /* echo \"l: $l, r: $r, mid: $mid\", PHP_EOL; */\n if ($A[$mid] === 1) {\n $i1 = $mid;\n break;\n } else if ($A[$mid] > 1) {\n $r = $mid;\n } else {\n $l = $mid + 1;\n }\n}\n\n// 左には$i1こ\n// 右には$n - 1 - $i1こ\n\n/* echo \"i1: $i1, \" . ceil($i1 / ($k - 1)) . \", \" . ceil(($n - 1 - $i1) / ($k - 1)), PHP_EOL; */\necho ceil($i1 / ($k - 1)) + ceil(($n - 1 - $i1) / ($k - 1));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N.\n\nOn this sequence, Snuke can perform the following operation:\n\nChoose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements.\n\nSnuke would like to make all the elements in this sequence equal by repeating the operation above some number of times.\nFind the minimum number of operations required.\nIt can be proved that, Under the constraints of this problem, this objective is always achievable.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 100000\n\nA_1, A_2, ..., A_N is a permutation of 1, 2, ..., N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 3\n2 3 1 4\n\nSample Output 1\n\n2\n\nOne optimal strategy is as follows:\n\nIn the first operation, choose the first, second and third elements. The sequence A becomes 1, 1, 1, 4.\n\nIn the second operation, choose the second, third and fourth elements. The sequence A becomes 1, 1, 1, 1.\n\nSample Input 2\n\n3 3\n1 2 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n8 3\n7 3 1 8 4 6 2 5\n\nSample Output 3\n\n4", "sample_input": "4 3\n2 3 1 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03317", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N.\n\nOn this sequence, Snuke can perform the following operation:\n\nChoose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements.\n\nSnuke would like to make all the elements in this sequence equal by repeating the operation above some number of times.\nFind the minimum number of operations required.\nIt can be proved that, Under the constraints of this problem, this objective is always achievable.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 100000\n\nA_1, A_2, ..., A_N is a permutation of 1, 2, ..., N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 3\n2 3 1 4\n\nSample Output 1\n\n2\n\nOne optimal strategy is as follows:\n\nIn the first operation, choose the first, second and third elements. The sequence A becomes 1, 1, 1, 4.\n\nIn the second operation, choose the second, third and fourth elements. The sequence A becomes 1, 1, 1, 1.\n\nSample Input 2\n\n3 3\n1 2 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n8 3\n7 3 1 8 4 6 2 5\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 589, "cpu_time_ms": 21, "memory_kb": 16884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s880016538", "group_id": "codeNet:p03323", "input_text": " 8 ? ':(' : 'Yay!';\n", "language": "PHP", "metadata": {"date": 1590782146, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03323.html", "problem_id": "p03323", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03323/input.txt", "sample_output_relpath": "derived/input_output/data/p03323/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03323/PHP/s880016538.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s880016538", "user_id": "u055687468"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": " 8 ? ':(' : 'Yay!';\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "sample_input": "5 4\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03323", "source_text": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 81, "cpu_time_ms": 10, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s472751515", "group_id": "codeNet:p03323", "input_text": " 8 || $B > 8) {\n printf(\":(\\n\");\n}\nelse {\n printf(\"Yay!\\n\");\n}\n", "language": "PHP", "metadata": {"date": 1529197453, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03323.html", "problem_id": "p03323", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03323/input.txt", "sample_output_relpath": "derived/input_output/data/p03323/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03323/PHP/s461163543.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s461163543", "user_id": "u278278558"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": " 8 || $B > 8) {\n printf(\":(\\n\");\n}\nelse {\n printf(\"Yay!\\n\");\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "sample_input": "5 4\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03323", "source_text": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 241, "cpu_time_ms": 10, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s950938396", "group_id": "codeNet:p03325", "input_text": "\n", "language": "PHP", "metadata": {"date": 1528681650, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03327.html", "problem_id": "p03327", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03327/input.txt", "sample_output_relpath": "derived/input_output/data/p03327/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03327/PHP/s170195067.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s170195067", "user_id": "u192239968"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "sample_input": "999\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03327", "source_text": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 233, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s642031940", "group_id": "codeNet:p03337", "input_text": " ($a - $b)) {\n if (($a + $b) > ($a * $b)) {\n echo ($a + $b);\n } else {\n echo ($a * $b);\n }\n} else {\n if (($a - $b) > ($a * $b)) {\n echo ($a - $b);\n } else {\n echo ($a * $b);\n }\n}", "language": "PHP", "metadata": {"date": 1544294494, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03337.html", "problem_id": "p03337", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03337/input.txt", "sample_output_relpath": "derived/input_output/data/p03337/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03337/PHP/s724843278.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s724843278", "user_id": "u640826299"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": " ($a - $b)) {\n if (($a + $b) > ($a * $b)) {\n echo ($a + $b);\n } else {\n echo ($a * $b);\n }\n} else {\n if (($a - $b) > ($a * $b)) {\n echo ($a - $b);\n } else {\n echo ($a * $b);\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "sample_input": "3 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03337", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 278, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s856984686", "group_id": "codeNet:p03338", "input_text": "", "language": "PHP", "metadata": {"date": 1576358726, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03351/input.txt", "sample_output_relpath": "derived/input_output/data/p03351/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03351/PHP/s059446936.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s059446936", "user_id": "u397596606"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "sample_input": "4 7 9 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03351", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 192, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s268441618", "group_id": "codeNet:p03351", "input_text": "\n", "language": "PHP", "metadata": {"date": 1568692501, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03351/input.txt", "sample_output_relpath": "derived/input_output/data/p03351/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03351/PHP/s268441618.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s268441618", "user_id": "u409926626"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "sample_input": "4 7 9 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03351", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 204, "cpu_time_ms": 11, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s621529725", "group_id": "codeNet:p03351", "input_text": "= $d) {\n $answer = $d;\n }\n }\n\n echo $answer;\n?>", "language": "PHP", "metadata": {"date": 1568695636, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03352.html", "problem_id": "p03352", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03352/input.txt", "sample_output_relpath": "derived/input_output/data/p03352/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03352/PHP/s107020393.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s107020393", "user_id": "u409926626"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "= $d) {\n $answer = $d;\n }\n }\n\n echo $answer;\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.\n\nConstraints\n\n1 ≤ X ≤ 1000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the largest perfect power that is at most X.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9.\nWe should print the largest among them, 9.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n999\n\nSample Output 3\n\n961", "sample_input": "10\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03352", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.\n\nConstraints\n\n1 ≤ X ≤ 1000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the largest perfect power that is at most X.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9.\nWe should print the largest among them, 9.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n999\n\nSample Output 3\n\n961", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 152, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s298317738", "group_id": "codeNet:p03352", "input_text": "", "language": "PHP", "metadata": {"date": 1529981237, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03352.html", "problem_id": "p03352", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03352/input.txt", "sample_output_relpath": "derived/input_output/data/p03352/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03352/PHP/s298317738.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s298317738", "user_id": "u218984487"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.\n\nConstraints\n\n1 ≤ X ≤ 1000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the largest perfect power that is at most X.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9.\nWe should print the largest among them, 9.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n999\n\nSample Output 3\n\n961", "sample_input": "10\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03352", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.\n\nConstraints\n\n1 ≤ X ≤ 1000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the largest perfect power that is at most X.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9.\nWe should print the largest among them, 9.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n999\n\nSample Output 3\n\n961", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 244, "cpu_time_ms": 22, "memory_kb": 4468}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s430204555", "group_id": "codeNet:p03353", "input_text": " y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "sample_input": "aba\n4\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03353", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string s.\nAmong the different substrings of s, print the K-th lexicographically smallest one.\n\nA substring of s is a string obtained by taking out a non-empty contiguous part in s.\nFor example, if s = ababc, a, bab and ababc are substrings of s, while ac, z and an empty string are not.\nAlso, we say that substrings are different when they are different as strings.\n\nLet X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 1537, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s293876878", "group_id": "codeNet:p03354", "input_text": "par[$i] = $i; // 最初は全てが根\n $this->size[$i] = 1;\n }\n }\n\n function root($x)\n { // 根を返す\n if ($this->par[$x] === $x) return $x; // 根の場合\n return $this->par[$x] = $this->root($this->par[$x]); // 全ての枝の親を根にしながら再帰処理\n }\n\n function unite($x, $y)\n { // $xと$yの木を併合\n $ix = $this->root($x);\n $iy = $this->root($y);\n if ($ix === $iy) return;\n if ($this->size[$ix] < $this->size[$iy]) list($ix, $iy) = [$iy, $ix];\n $this->size[$ix] += $this->size[$iy];\n $this->par[$iy] = $ix; // $yの根を$xの根に付ける\n }\n\n function isSame($x, $y)\n { // $xと$yの根が同じか\n return $this->root($x) === $this->root($y);\n }\n\n function size($x)\n {\n return $this->size[$this->root($x)];\n }\n}\n\nfscanf(STDIN, '%d %d', $n, $m);\n$p = array_map('intval', explode(' ', trim(fgets(STDIN))));\n\n$tree = new UnionFind($n);\n\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, '%d %d', $x, $y);\n $x--;\n $y--; // 0 ~ $n-1に合わせる\n $tree->unite($x, $y);\n}\n\n$cnt = 0;\nfor ($i = 0; $i < $n; $i++) {\n if ($i === $p[$i] - 1 || $tree->isSame($i, $p[$i] - 1)) $cnt++;\n}\n\necho $cnt . PHP_EOL;", "language": "PHP", "metadata": {"date": 1591199597, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03354.html", "problem_id": "p03354", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03354/input.txt", "sample_output_relpath": "derived/input_output/data/p03354/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03354/PHP/s293876878.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s293876878", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "par[$i] = $i; // 最初は全てが根\n $this->size[$i] = 1;\n }\n }\n\n function root($x)\n { // 根を返す\n if ($this->par[$x] === $x) return $x; // 根の場合\n return $this->par[$x] = $this->root($this->par[$x]); // 全ての枝の親を根にしながら再帰処理\n }\n\n function unite($x, $y)\n { // $xと$yの木を併合\n $ix = $this->root($x);\n $iy = $this->root($y);\n if ($ix === $iy) return;\n if ($this->size[$ix] < $this->size[$iy]) list($ix, $iy) = [$iy, $ix];\n $this->size[$ix] += $this->size[$iy];\n $this->par[$iy] = $ix; // $yの根を$xの根に付ける\n }\n\n function isSame($x, $y)\n { // $xと$yの根が同じか\n return $this->root($x) === $this->root($y);\n }\n\n function size($x)\n {\n return $this->size[$this->root($x)];\n }\n}\n\nfscanf(STDIN, '%d %d', $n, $m);\n$p = array_map('intval', explode(' ', trim(fgets(STDIN))));\n\n$tree = new UnionFind($n);\n\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, '%d %d', $x, $y);\n $x--;\n $y--; // 0 ~ $n-1に合わせる\n $tree->unite($x, $y);\n}\n\n$cnt = 0;\nfor ($i = 0; $i < $n; $i++) {\n if ($i === $p[$i] - 1 || $tree->isSame($i, $p[$i] - 1)) $cnt++;\n}\n\necho $cnt . PHP_EOL;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a permutation of the integers from 1 through N, p_1, p_2, .., p_N.\nWe also have M pairs of two integers between 1 and N (inclusive), represented as (x_1,y_1), (x_2,y_2), .., (x_M,y_M).\nAtCoDeer the deer is going to perform the following operation on p as many times as desired so that the number of i (1 ≤ i ≤ N) such that p_i = i is maximized:\n\nChoose j such that 1 ≤ j ≤ M, and swap p_{x_j} and p_{y_j}.\n\nFind the maximum possible number of i such that p_i = i after operations.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ M ≤ 10^5\n\np is a permutation of integers from 1 through N.\n\n1 ≤ x_j,y_j ≤ N\n\nx_j ≠ y_j\n\nIf i ≠ j, \\{x_i,y_i\\} ≠ \\{x_j,y_j\\}.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 p_2 .. p_N\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the maximum possible number of i such that p_i = i after operations.\n\nSample Input 1\n\n5 2\n5 3 1 4 2\n1 3\n5 4\n\nSample Output 1\n\n2\n\nIf we perform the operation by choosing j=1, p becomes 1 3 5 4 2, which is optimal, so the answer is 2.\n\nSample Input 2\n\n3 2\n3 2 1\n1 2\n2 3\n\nSample Output 2\n\n3\n\nIf we perform the operation by, for example, choosing j=1, j=2, j=1 in this order, p becomes 1 2 3, which is obviously optimal.\nNote that we may choose the same j any number of times.\n\nSample Input 3\n\n10 8\n5 3 6 8 7 10 9 1 2 4\n3 1\n4 1\n5 9\n2 5\n6 5\n3 5\n8 9\n7 9\n\nSample Output 3\n\n8\n\nSample Input 4\n\n5 1\n1 2 3 4 5\n1 5\n\nSample Output 4\n\n5\n\nWe do not have to perform the operation.", "sample_input": "5 2\n5 3 1 4 2\n1 3\n5 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03354", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a permutation of the integers from 1 through N, p_1, p_2, .., p_N.\nWe also have M pairs of two integers between 1 and N (inclusive), represented as (x_1,y_1), (x_2,y_2), .., (x_M,y_M).\nAtCoDeer the deer is going to perform the following operation on p as many times as desired so that the number of i (1 ≤ i ≤ N) such that p_i = i is maximized:\n\nChoose j such that 1 ≤ j ≤ M, and swap p_{x_j} and p_{y_j}.\n\nFind the maximum possible number of i such that p_i = i after operations.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ M ≤ 10^5\n\np is a permutation of integers from 1 through N.\n\n1 ≤ x_j,y_j ≤ N\n\nx_j ≠ y_j\n\nIf i ≠ j, \\{x_i,y_i\\} ≠ \\{x_j,y_j\\}.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 p_2 .. p_N\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the maximum possible number of i such that p_i = i after operations.\n\nSample Input 1\n\n5 2\n5 3 1 4 2\n1 3\n5 4\n\nSample Output 1\n\n2\n\nIf we perform the operation by choosing j=1, p becomes 1 3 5 4 2, which is optimal, so the answer is 2.\n\nSample Input 2\n\n3 2\n3 2 1\n1 2\n2 3\n\nSample Output 2\n\n3\n\nIf we perform the operation by, for example, choosing j=1, j=2, j=1 in this order, p becomes 1 2 3, which is obviously optimal.\nNote that we may choose the same j any number of times.\n\nSample Input 3\n\n10 8\n5 3 6 8 7 10 9 1 2 4\n3 1\n4 1\n5 9\n2 5\n6 5\n3 5\n8 9\n7 9\n\nSample Output 3\n\n8\n\nSample Input 4\n\n5 1\n1 2 3 4 5\n1 5\n\nSample Output 4\n\n5\n\nWe do not have to perform the operation.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1495, "cpu_time_ms": 195, "memory_kb": 20980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s603989938", "group_id": "codeNet:p03359", "input_text": "b){\necho a-1;\n}else{\necho a;\n}\n", "language": "PHP", "metadata": {"date": 1525900949, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03359.html", "problem_id": "p03359", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03359/input.txt", "sample_output_relpath": "derived/input_output/data/p03359/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03359/PHP/s603989938.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s603989938", "user_id": "u362825937"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "b){\necho a-1;\n}else{\necho a;\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder Kingdom, Gregorian calendar is used, and dates are written in the \"year-month-day\" order, or the \"month-day\" order without the year.\n\nFor example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.\n\nIn this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi.\n\nHow many days from 2018-1-1 through 2018-a-b are Takahashi?\n\nConstraints\n\na is an integer between 1 and 12 (inclusive).\n\nb is an integer between 1 and 31 (inclusive).\n\n2018-a-b is a valid date in Gregorian calendar.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the number of days from 2018-1-1 through 2018-a-b that are Takahashi.\n\nSample Input 1\n\n5 5\n\nSample Output 1\n\n5\n\nThere are five days that are Takahashi: 1-1, 2-2, 3-3, 4-4 and 5-5.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\n1\n\nThere is only one day that is Takahashi: 1-1.\n\nSample Input 3\n\n11 30\n\nSample Output 3\n\n11\n\nThere are eleven days that are Takahashi: 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10 and 11-11.", "sample_input": "5 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03359", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder Kingdom, Gregorian calendar is used, and dates are written in the \"year-month-day\" order, or the \"month-day\" order without the year.\n\nFor example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.\n\nIn this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi.\n\nHow many days from 2018-1-1 through 2018-a-b are Takahashi?\n\nConstraints\n\na is an integer between 1 and 12 (inclusive).\n\nb is an integer between 1 and 31 (inclusive).\n\n2018-a-b is a valid date in Gregorian calendar.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the number of days from 2018-1-1 through 2018-a-b that are Takahashi.\n\nSample Input 1\n\n5 5\n\nSample Output 1\n\n5\n\nThere are five days that are Takahashi: 1-1, 2-2, 3-3, 4-4 and 5-5.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\n1\n\nThere is only one day that is Takahashi: 1-1.\n\nSample Input 3\n\n11 30\n\nSample Output 3\n\n11\n\nThere are eleven days that are Takahashi: 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10 and 11-11.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 74, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s751039765", "group_id": "codeNet:p03359", "input_text": "", "language": "PHP", "metadata": {"date": 1525826890, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03359.html", "problem_id": "p03359", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03359/input.txt", "sample_output_relpath": "derived/input_output/data/p03359/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03359/PHP/s751039765.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s751039765", "user_id": "u846552659"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder Kingdom, Gregorian calendar is used, and dates are written in the \"year-month-day\" order, or the \"month-day\" order without the year.\n\nFor example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.\n\nIn this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi.\n\nHow many days from 2018-1-1 through 2018-a-b are Takahashi?\n\nConstraints\n\na is an integer between 1 and 12 (inclusive).\n\nb is an integer between 1 and 31 (inclusive).\n\n2018-a-b is a valid date in Gregorian calendar.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the number of days from 2018-1-1 through 2018-a-b that are Takahashi.\n\nSample Input 1\n\n5 5\n\nSample Output 1\n\n5\n\nThere are five days that are Takahashi: 1-1, 2-2, 3-3, 4-4 and 5-5.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\n1\n\nThere is only one day that is Takahashi: 1-1.\n\nSample Input 3\n\n11 30\n\nSample Output 3\n\n11\n\nThere are eleven days that are Takahashi: 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10 and 11-11.", "sample_input": "5 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03359", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder Kingdom, Gregorian calendar is used, and dates are written in the \"year-month-day\" order, or the \"month-day\" order without the year.\n\nFor example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.\n\nIn this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi.\n\nHow many days from 2018-1-1 through 2018-a-b are Takahashi?\n\nConstraints\n\na is an integer between 1 and 12 (inclusive).\n\nb is an integer between 1 and 31 (inclusive).\n\n2018-a-b is a valid date in Gregorian calendar.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the number of days from 2018-1-1 through 2018-a-b that are Takahashi.\n\nSample Input 1\n\n5 5\n\nSample Output 1\n\n5\n\nThere are five days that are Takahashi: 1-1, 2-2, 3-3, 4-4 and 5-5.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\n1\n\nThere is only one day that is Takahashi: 1-1.\n\nSample Input 3\n\n11 30\n\nSample Output 3\n\n11\n\nThere are eleven days that are Takahashi: 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10 and 11-11.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 123, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s193455262", "group_id": "codeNet:p03369", "input_text": "0){\n $rest -= $min_cost_donut;\n $count++;\n}\n\necho $count;\n", "language": "PHP", "metadata": {"date": 1524409053, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03369.html", "problem_id": "p03369", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03369/input.txt", "sample_output_relpath": "derived/input_output/data/p03369/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03369/PHP/s839173411.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s839173411", "user_id": "u848208379"}, "prompt_components": {"gold_output": "900\n", "input_to_evaluate": "0){\n $rest -= $min_cost_donut;\n $count++;\n}\n\necho $count;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn \"Takahashi-ya\", a ramen restaurant, a bowl of ramen costs 700 yen (the currency of Japan), plus 100 yen for each kind of topping (boiled egg, sliced pork, green onions).\n\nA customer ordered a bowl of ramen and told which toppings to put on his ramen to a clerk. The clerk took a memo of the order as a string S. S is three characters long, and if the first character in S is o, it means the ramen should be topped with boiled egg; if that character is x, it means the ramen should not be topped with boiled egg. Similarly, the second and third characters in S mean the presence or absence of sliced pork and green onions on top of the ramen.\n\nWrite a program that, when S is given, prints the price of the corresponding bowl of ramen.\n\nConstraints\n\nS is a string of length 3.\n\nEach character in S is o or x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the price of the bowl of ramen corresponding to S.\n\nSample Input 1\n\noxo\n\nSample Output 1\n\n900\n\nThe price of a ramen topped with two kinds of toppings, boiled egg and green onions, is 700 + 100 \\times 2 = 900 yen.\n\nSample Input 2\n\nooo\n\nSample Output 2\n\n1000\n\nThe price of a ramen topped with all three kinds of toppings is 700 + 100 \\times 3 = 1000 yen.\n\nSample Input 3\n\nxxx\n\nSample Output 3\n\n700\n\nThe price of a ramen without any toppings is 700 yen.", "sample_input": "oxo\n"}, "reference_outputs": ["900\n"], "source_document_id": "p03369", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn \"Takahashi-ya\", a ramen restaurant, a bowl of ramen costs 700 yen (the currency of Japan), plus 100 yen for each kind of topping (boiled egg, sliced pork, green onions).\n\nA customer ordered a bowl of ramen and told which toppings to put on his ramen to a clerk. The clerk took a memo of the order as a string S. S is three characters long, and if the first character in S is o, it means the ramen should be topped with boiled egg; if that character is x, it means the ramen should not be topped with boiled egg. Similarly, the second and third characters in S mean the presence or absence of sliced pork and green onions on top of the ramen.\n\nWrite a program that, when S is given, prints the price of the corresponding bowl of ramen.\n\nConstraints\n\nS is a string of length 3.\n\nEach character in S is o or x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the price of the bowl of ramen corresponding to S.\n\nSample Input 1\n\noxo\n\nSample Output 1\n\n900\n\nThe price of a ramen topped with two kinds of toppings, boiled egg and green onions, is 700 + 100 \\times 2 = 900 yen.\n\nSample Input 2\n\nooo\n\nSample Output 2\n\n1000\n\nThe price of a ramen topped with all three kinds of toppings is 700 + 100 \\times 3 = 1000 yen.\n\nSample Input 3\n\nxxx\n\nSample Output 3\n\n700\n\nThe price of a ramen without any toppings is 700 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 303, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s697078045", "group_id": "codeNet:p03369", "input_text": "\";\n\t\tif($x>=$v){\n\t\t\t$x-=$v;\n\t\t\t$count++;\n\t\t}\n\t}\n\n\tif($count==count($m)){\n\t\twhile($x>0){\n\t\t\tif($x>=$m[0]){\n\t\t\t\t$count++;\n\t\t\t\t$x-=$m[0];\n\t\t\t}else\n\t\t\t\tbreak;\n\t\t}\n\t}\n\techo $count;\n}\n// solve(1000,3,[120,100,140]);\nsolve($x,$n,$m);", "language": "PHP", "metadata": {"date": 1524465556, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03370.html", "problem_id": "p03370", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03370/input.txt", "sample_output_relpath": "derived/input_output/data/p03370/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03370/PHP/s705256271.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s705256271", "user_id": "u535342861"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "\";\n\t\tif($x>=$v){\n\t\t\t$x-=$v;\n\t\t\t$count++;\n\t\t}\n\t}\n\n\tif($count==count($m)){\n\t\twhile($x>0){\n\t\t\tif($x>=$m[0]){\n\t\t\t\t$count++;\n\t\t\t\t$x-=$m[0];\n\t\t\t}else\n\t\t\t\tbreak;\n\t\t}\n\t}\n\techo $count;\n}\n// solve(1000,3,[120,100,140]);\nsolve($x,$n,$m);", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAkaki, a patissier, can make N kinds of doughnut using only a certain powder called \"Okashi no Moto\" (literally \"material of pastry\", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Doughnut 2, ..., Doughnut N. In order to make one Doughnut i (1 ≤ i ≤ N), she needs to consume m_i grams of Moto. She cannot make a non-integer number of doughnuts, such as 0.5 doughnuts.\n\nNow, she has X grams of Moto. She decides to make as many doughnuts as possible for a party tonight. However, since the tastes of the guests differ, she will obey the following condition:\n\nFor each of the N kinds of doughnuts, make at least one doughnut of that kind.\n\nAt most how many doughnuts can be made here? She does not necessarily need to consume all of her Moto. Also, under the constraints of this problem, it is always possible to obey the condition.\n\nConstraints\n\n2 ≤ N ≤ 100\n\n1 ≤ m_i ≤ 1000\n\nm_1 + m_2 + ... + m_N ≤ X ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nm_1\nm_2\n:\nm_N\n\nOutput\n\nPrint the maximum number of doughnuts that can be made under the condition.\n\nSample Input 1\n\n3 1000\n120\n100\n140\n\nSample Output 1\n\n9\n\nShe has 1000 grams of Moto and can make three kinds of doughnuts. If she makes one doughnut for each of the three kinds, she consumes 120 + 100 + 140 = 360 grams of Moto. From the 640 grams of Moto that remains here, she can make additional six Doughnuts 2. This is how she can made a total of nine doughnuts, which is the maximum.\n\nSample Input 2\n\n4 360\n90\n90\n90\n90\n\nSample Output 2\n\n4\n\nMaking one doughnut for each of the four kinds consumes all of her Moto.\n\nSample Input 3\n\n5 3000\n150\n130\n150\n130\n110\n\nSample Output 3\n\n26", "sample_input": "3 1000\n120\n100\n140\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03370", "source_text": "Score : 200 points\n\nProblem Statement\n\nAkaki, a patissier, can make N kinds of doughnut using only a certain powder called \"Okashi no Moto\" (literally \"material of pastry\", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Doughnut 2, ..., Doughnut N. In order to make one Doughnut i (1 ≤ i ≤ N), she needs to consume m_i grams of Moto. She cannot make a non-integer number of doughnuts, such as 0.5 doughnuts.\n\nNow, she has X grams of Moto. She decides to make as many doughnuts as possible for a party tonight. However, since the tastes of the guests differ, she will obey the following condition:\n\nFor each of the N kinds of doughnuts, make at least one doughnut of that kind.\n\nAt most how many doughnuts can be made here? She does not necessarily need to consume all of her Moto. Also, under the constraints of this problem, it is always possible to obey the condition.\n\nConstraints\n\n2 ≤ N ≤ 100\n\n1 ≤ m_i ≤ 1000\n\nm_1 + m_2 + ... + m_N ≤ X ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nm_1\nm_2\n:\nm_N\n\nOutput\n\nPrint the maximum number of doughnuts that can be made under the condition.\n\nSample Input 1\n\n3 1000\n120\n100\n140\n\nSample Output 1\n\n9\n\nShe has 1000 grams of Moto and can make three kinds of doughnuts. If she makes one doughnut for each of the three kinds, she consumes 120 + 100 + 140 = 360 grams of Moto. From the 640 grams of Moto that remains here, she can make additional six Doughnuts 2. This is how she can made a total of nine doughnuts, which is the maximum.\n\nSample Input 2\n\n4 360\n90\n90\n90\n90\n\nSample Output 2\n\n4\n\nMaking one doughnut for each of the four kinds consumes all of her Moto.\n\nSample Input 3\n\n5 3000\n150\n130\n150\n130\n110\n\nSample Output 3\n\n26", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 428, "cpu_time_ms": 28, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s640825634", "group_id": "codeNet:p03371", "input_text": " $c){\n $cost += $c*min($x,$y)*2;\n $n = abs($x-$y);\n $n_c = $c*$n*2;\n if($x>$y){\n $n_ab = $n*$a;\n }else{\n $n_ab = $n*$b;\n }\n $cost += min($n_c,$n_ab);\n }else{\n $cost += $a*$x;\n $cost += $b*$y;\n }\n echo $cost.\"\\n\";\n ", "language": "PHP", "metadata": {"date": 1588379959, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03371.html", "problem_id": "p03371", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03371/input.txt", "sample_output_relpath": "derived/input_output/data/p03371/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03371/PHP/s640825634.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s640825634", "user_id": "u769447691"}, "prompt_components": {"gold_output": "7900\n", "input_to_evaluate": " $c){\n $cost += $c*min($x,$y)*2;\n $n = abs($x-$y);\n $n_c = $c*$n*2;\n if($x>$y){\n $n_ab = $n*$a;\n }else{\n $n_ab = $n*$b;\n }\n $cost += min($n_c,$n_ab);\n }else{\n $cost += $a*$x;\n $cost += $b*$y;\n }\n echo $cost.\"\\n\";\n ", "problem_context": "Score : 300 points\n\nProblem Statement\n\n\"Pizza At\", a fast food chain, offers three kinds of pizza: \"A-pizza\", \"B-pizza\" and \"AB-pizza\". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.\n\nNakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.\n\nConstraints\n\n1 ≤ A, B, C ≤ 5000\n\n1 ≤ X, Y ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C X Y\n\nOutput\n\nPrint the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.\n\nSample Input 1\n\n1500 2000 1600 3 2\n\nSample Output 1\n\n7900\n\nIt is optimal to buy four AB-pizzas and rearrange them into two A-pizzas and two B-pizzas, then buy additional one A-pizza.\n\nSample Input 2\n\n1500 2000 1900 3 2\n\nSample Output 2\n\n8500\n\nIt is optimal to directly buy three A-pizzas and two B-pizzas.\n\nSample Input 3\n\n1500 2000 500 90000 100000\n\nSample Output 3\n\n100000000\n\nIt is optimal to buy 200000 AB-pizzas and rearrange them into 100000 A-pizzas and 100000 B-pizzas. We will have 10000 more A-pizzas than necessary, but that is fine.", "sample_input": "1500 2000 1600 3 2\n"}, "reference_outputs": ["7900\n"], "source_document_id": "p03371", "source_text": "Score : 300 points\n\nProblem Statement\n\n\"Pizza At\", a fast food chain, offers three kinds of pizza: \"A-pizza\", \"B-pizza\" and \"AB-pizza\". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.\n\nNakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.\n\nConstraints\n\n1 ≤ A, B, C ≤ 5000\n\n1 ≤ X, Y ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C X Y\n\nOutput\n\nPrint the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.\n\nSample Input 1\n\n1500 2000 1600 3 2\n\nSample Output 1\n\n7900\n\nIt is optimal to buy four AB-pizzas and rearrange them into two A-pizzas and two B-pizzas, then buy additional one A-pizza.\n\nSample Input 2\n\n1500 2000 1900 3 2\n\nSample Output 2\n\n8500\n\nIt is optimal to directly buy three A-pizzas and two B-pizzas.\n\nSample Input 3\n\n1500 2000 500 90000 100000\n\nSample Output 3\n\n100000000\n\nIt is optimal to buy 200000 AB-pizzas and rearrange them into 100000 A-pizzas and 100000 B-pizzas. We will have 10000 more A-pizzas than necessary, but that is fine.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 339, "cpu_time_ms": 9, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s531979116", "group_id": "codeNet:p03378", "input_text": "0){\n\tforeach($A as $value){\n if($value ==$x){\t\n $fee++; \n }\n}\n$x--;\n}\n\nif($FEE<$fee){\necho $FEE;\n}else{\necho $fee;\n}", "language": "PHP", "metadata": {"date": 1545198400, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03378.html", "problem_id": "p03378", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03378/input.txt", "sample_output_relpath": "derived/input_output/data/p03378/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03378/PHP/s948489246.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s948489246", "user_id": "u148933463"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "0){\n\tforeach($A as $value){\n if($value ==$x){\t\n $fee++; \n }\n}\n$x--;\n}\n\nif($FEE<$fee){\necho $FEE;\n}else{\necho $fee;\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N + 1 squares arranged in a row, numbered 0, 1, ..., N from left to right.\n\nInitially, you are in Square X.\nYou can freely travel between adjacent squares. Your goal is to reach Square 0 or Square N.\nHowever, for each i = 1, 2, ..., M, there is a toll gate in Square A_i, and traveling to Square A_i incurs a cost of 1.\nIt is guaranteed that there is no toll gate in Square 0, Square X and Square N.\n\nFind the minimum cost incurred before reaching the goal.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq M \\leq 100\n\n1 \\leq X \\leq N - 1\n\n1 \\leq A_1 < A_2 < ... < A_M \\leq N\n\nA_i \\neq X\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nA_1 A_2 ... A_M\n\nOutput\n\nPrint the minimum cost incurred before reaching the goal.\n\nSample Input 1\n\n5 3 3\n1 2 4\n\nSample Output 1\n\n1\n\nThe optimal solution is as follows:\n\nFirst, travel from Square 3 to Square 4. Here, there is a toll gate in Square 4, so the cost of 1 is incurred.\n\nThen, travel from Square 4 to Square 5. This time, no cost is incurred.\n\nNow, we are in Square 5 and we have reached the goal.\n\nIn this case, the total cost incurred is 1.\n\nSample Input 2\n\n7 3 2\n4 5 6\n\nSample Output 2\n\n0\n\nWe may be able to reach the goal at no cost.\n\nSample Input 3\n\n10 7 5\n1 2 3 4 6 8 9\n\nSample Output 3\n\n3", "sample_input": "5 3 3\n1 2 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03378", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N + 1 squares arranged in a row, numbered 0, 1, ..., N from left to right.\n\nInitially, you are in Square X.\nYou can freely travel between adjacent squares. Your goal is to reach Square 0 or Square N.\nHowever, for each i = 1, 2, ..., M, there is a toll gate in Square A_i, and traveling to Square A_i incurs a cost of 1.\nIt is guaranteed that there is no toll gate in Square 0, Square X and Square N.\n\nFind the minimum cost incurred before reaching the goal.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq M \\leq 100\n\n1 \\leq X \\leq N - 1\n\n1 \\leq A_1 < A_2 < ... < A_M \\leq N\n\nA_i \\neq X\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nA_1 A_2 ... A_M\n\nOutput\n\nPrint the minimum cost incurred before reaching the goal.\n\nSample Input 1\n\n5 3 3\n1 2 4\n\nSample Output 1\n\n1\n\nThe optimal solution is as follows:\n\nFirst, travel from Square 3 to Square 4. Here, there is a toll gate in Square 4, so the cost of 1 is incurred.\n\nThen, travel from Square 4 to Square 5. This time, no cost is incurred.\n\nNow, we are in Square 5 and we have reached the goal.\n\nIn this case, the total cost incurred is 1.\n\nSample Input 2\n\n7 3 2\n4 5 6\n\nSample Output 2\n\n0\n\nWe may be able to reach the goal at no cost.\n\nSample Input 3\n\n10 7 5\n1 2 3 4 6 8 9\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 345, "cpu_time_ms": 10, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s782566423", "group_id": "codeNet:p03385", "input_text": "= 2*$k){\n for ($tmp = $a; $tmp < $a+$k; $tmp++){\n array_push($factors, $tmp);\n }\n for ($tmp = $b-$k+1; $tmp <= $b; $tmp++){\n array_push($factors, $tmp);\n }\n} else {\n for ($tmp = $a; $tmp <= $b; $tmp++){\n array_push($factors, $tmp);\n }\n}\nsort($factors);\nfor ($tmp = 0; $tmp < count($factors); $tmp++){\n print(\"{$factors[$tmp]}\\n\");\n}\n?>", "language": "PHP", "metadata": {"date": 1523416841, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03386.html", "problem_id": "p03386", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03386/input.txt", "sample_output_relpath": "derived/input_output/data/p03386/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03386/PHP/s897718089.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s897718089", "user_id": "u846552659"}, "prompt_components": {"gold_output": "3\n4\n7\n8\n", "input_to_evaluate": "= 2*$k){\n for ($tmp = $a; $tmp < $a+$k; $tmp++){\n array_push($factors, $tmp);\n }\n for ($tmp = $b-$k+1; $tmp <= $b; $tmp++){\n array_push($factors, $tmp);\n }\n} else {\n for ($tmp = $a; $tmp <= $b; $tmp++){\n array_push($factors, $tmp);\n }\n}\nsort($factors);\nfor ($tmp = 0; $tmp < count($factors); $tmp++){\n print(\"{$factors[$tmp]}\\n\");\n}\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nPrint all the integers that satisfies the following in ascending order:\n\nAmong the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint all the integers that satisfies the condition above in ascending order.\n\nSample Input 1\n\n3 8 2\n\nSample Output 1\n\n3\n4\n7\n8\n\n3 is the first smallest integer among the integers between 3 and 8.\n\n4 is the second smallest integer among the integers between 3 and 8.\n\n7 is the second largest integer among the integers between 3 and 8.\n\n8 is the first largest integer among the integers between 3 and 8.\n\nSample Input 2\n\n4 8 3\n\nSample Output 2\n\n4\n5\n6\n7\n8\n\nSample Input 3\n\n2 9 100\n\nSample Output 3\n\n2\n3\n4\n5\n6\n7\n8\n9", "sample_input": "3 8 2\n"}, "reference_outputs": ["3\n4\n7\n8\n"], "source_document_id": "p03386", "source_text": "Score : 200 points\n\nProblem Statement\n\nPrint all the integers that satisfies the following in ascending order:\n\nAmong the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint all the integers that satisfies the condition above in ascending order.\n\nSample Input 1\n\n3 8 2\n\nSample Output 1\n\n3\n4\n7\n8\n\n3 is the first smallest integer among the integers between 3 and 8.\n\n4 is the second smallest integer among the integers between 3 and 8.\n\n7 is the second largest integer among the integers between 3 and 8.\n\n8 is the first largest integer among the integers between 3 and 8.\n\nSample Input 2\n\n4 8 3\n\nSample Output 2\n\n4\n5\n6\n7\n8\n\nSample Input 3\n\n2 9 100\n\nSample Output 3\n\n2\n3\n4\n5\n6\n7\n8\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 448, "cpu_time_ms": 13, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s914253796", "group_id": "codeNet:p03387", "input_text": "", "language": "PHP", "metadata": {"date": 1523157688, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03387.html", "problem_id": "p03387", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03387/input.txt", "sample_output_relpath": "derived/input_output/data/p03387/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03387/PHP/s914253796.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s914253796", "user_id": "u847243301"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "sample_input": "2 5 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03387", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 357, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s928696073", "group_id": "codeNet:p03387", "input_text": "$arr = explode(' ', trim(fgets(STDIN)));\nfor ($i = 0; $i < 3; $i++) {\n $arr[$i] = (int)$arr[$i];\n}\nrsort($arr);\n\n$k = intval(($arr[0] - $arr[1]) / 2) + ($arr[0] - $arr[1]) % 2;\n\n$arr[2] += ($arr[0] - $arr[1]) % 2;\n\nif (($arr[0] - $arr[2]) % 2 === 0) {\n $k += ($arr[0] - $arr[2]) / 2;\n} else {\n $k += intval(($arr[0] - $arr[2]) / 2) + 2;\n}\n\necho $k . PHP_EOL;", "language": "PHP", "metadata": {"date": 1523152636, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03387.html", "problem_id": "p03387", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03387/input.txt", "sample_output_relpath": "derived/input_output/data/p03387/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03387/PHP/s928696073.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s928696073", "user_id": "u004208081"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$arr = explode(' ', trim(fgets(STDIN)));\nfor ($i = 0; $i < 3; $i++) {\n $arr[$i] = (int)$arr[$i];\n}\nrsort($arr);\n\n$k = intval(($arr[0] - $arr[1]) / 2) + ($arr[0] - $arr[1]) % 2;\n\n$arr[2] += ($arr[0] - $arr[1]) % 2;\n\nif (($arr[0] - $arr[2]) % 2 === 0) {\n $k += ($arr[0] - $arr[2]) / 2;\n} else {\n $k += intval(($arr[0] - $arr[2]) / 2) + 2;\n}\n\necho $k . PHP_EOL;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "sample_input": "2 5 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03387", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 367, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s319197522", "group_id": "codeNet:p03389", "input_text": "\n", "language": "PHP", "metadata": {"date": 1588375340, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03400.html", "problem_id": "p03400", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03400/input.txt", "sample_output_relpath": "derived/input_output/data/p03400/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03400/PHP/s708818937.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s708818937", "user_id": "u094155508"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSome number of chocolate pieces were prepared for a training camp.\nThe camp had N participants and lasted for D days.\nThe i-th participant (1 \\leq i \\leq N) ate one chocolate piece on each of the following days in the camp: the 1-st day, the (A_i + 1)-th day, the (2A_i + 1)-th day, and so on.\nAs a result, there were X chocolate pieces remaining at the end of the camp. During the camp, nobody except the participants ate chocolate pieces.\n\nFind the number of chocolate pieces prepared at the beginning of the camp.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq D \\leq 100\n\n1 \\leq X \\leq 100\n\n1 \\leq A_i \\leq 100 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD X\nA_1\nA_2\n:\nA_N\n\nOutput\n\nFind the number of chocolate pieces prepared at the beginning of the camp.\n\nSample Input 1\n\n3\n7 1\n2\n5\n10\n\nSample Output 1\n\n8\n\nThe camp has 3 participants and lasts for 7 days.\nEach participant eats chocolate pieces as follows:\n\nThe first participant eats one chocolate piece on Day 1, 3, 5 and 7, for a total of four.\n\nThe second participant eats one chocolate piece on Day 1 and 6, for a total of two.\n\nThe third participant eats one chocolate piece only on Day 1, for a total of one.\n\nSince the number of pieces remaining at the end of the camp is one, the number of pieces prepared at the beginning of the camp is 1 + 4 + 2 + 1 = 8.\n\nSample Input 2\n\n2\n8 20\n1\n10\n\nSample Output 2\n\n29\n\nSample Input 3\n\n5\n30 44\n26\n18\n81\n18\n6\n\nSample Output 3\n\n56", "sample_input": "3\n7 1\n2\n5\n10\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03400", "source_text": "Score : 200 points\n\nProblem Statement\n\nSome number of chocolate pieces were prepared for a training camp.\nThe camp had N participants and lasted for D days.\nThe i-th participant (1 \\leq i \\leq N) ate one chocolate piece on each of the following days in the camp: the 1-st day, the (A_i + 1)-th day, the (2A_i + 1)-th day, and so on.\nAs a result, there were X chocolate pieces remaining at the end of the camp. During the camp, nobody except the participants ate chocolate pieces.\n\nFind the number of chocolate pieces prepared at the beginning of the camp.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq D \\leq 100\n\n1 \\leq X \\leq 100\n\n1 \\leq A_i \\leq 100 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD X\nA_1\nA_2\n:\nA_N\n\nOutput\n\nFind the number of chocolate pieces prepared at the beginning of the camp.\n\nSample Input 1\n\n3\n7 1\n2\n5\n10\n\nSample Output 1\n\n8\n\nThe camp has 3 participants and lasts for 7 days.\nEach participant eats chocolate pieces as follows:\n\nThe first participant eats one chocolate piece on Day 1, 3, 5 and 7, for a total of four.\n\nThe second participant eats one chocolate piece on Day 1 and 6, for a total of two.\n\nThe third participant eats one chocolate piece only on Day 1, for a total of one.\n\nSince the number of pieces remaining at the end of the camp is one, the number of pieces prepared at the beginning of the camp is 1 + 4 + 2 + 1 = 8.\n\nSample Input 2\n\n2\n8 20\n1\n10\n\nSample Output 2\n\n29\n\nSample Input 3\n\n5\n30 44\n26\n18\n81\n18\n6\n\nSample Output 3\n\n56", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 196, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s426045283", "group_id": "codeNet:p03400", "input_text": "nextInt();\n$A = [];\nfor($i = 0; $i < $N; $i++) {\n $A[] = $sc->nextInt();\n $cost[$i] = 0;\n}\n\n$dp = [];\n$dp2 = [];\nfor($i = 0; $i < $N; $i++) {\n $p = 0;\n for($j = 0; $j < $N; $j++) { \n if ($i == $j) {\n continue;\n }\n if ($j == 0) {\n if (isset($dp[$i - 1])) {\n $cost[$i] = $dp[$i - 1];\n $j = $i - 2;\n $p = $A[$j];\n continue;\n }\n }\n $cost[$i] += $dp2[$p][$j] ?? $dp2[$p][$j] = abs($p - $A[$j]);\n if ($i - 1 == $j) {\n $dp[$i] = $cost[$i];\n }\n $p = $A[$j];\n }\n $cost[$i] += abs($p);\n $out->println($cost[$i]);\n}\n\nclass Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\nclass Out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}", "language": "PHP", "metadata": {"date": 1522029952, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03401.html", "problem_id": "p03401", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03401/input.txt", "sample_output_relpath": "derived/input_output/data/p03401/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03401/PHP/s442453910.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s442453910", "user_id": "u975773137"}, "prompt_components": {"gold_output": "12\n8\n10\n", "input_to_evaluate": "nextInt();\n$A = [];\nfor($i = 0; $i < $N; $i++) {\n $A[] = $sc->nextInt();\n $cost[$i] = 0;\n}\n\n$dp = [];\n$dp2 = [];\nfor($i = 0; $i < $N; $i++) {\n $p = 0;\n for($j = 0; $j < $N; $j++) { \n if ($i == $j) {\n continue;\n }\n if ($j == 0) {\n if (isset($dp[$i - 1])) {\n $cost[$i] = $dp[$i - 1];\n $j = $i - 2;\n $p = $A[$j];\n continue;\n }\n }\n $cost[$i] += $dp2[$p][$j] ?? $dp2[$p][$j] = abs($p - $A[$j]);\n if ($i - 1 == $j) {\n $dp[$i] = $cost[$i];\n }\n $p = $A[$j];\n }\n $cost[$i] += abs($p);\n $out->println($cost[$i]);\n}\n\nclass Scanner {\n private $arr = [];\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\nclass Out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "sample_input": "3\n3 5 -1\n"}, "reference_outputs": ["12\n8\n10\n"], "source_document_id": "p03401", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1515, "cpu_time_ms": 2104, "memory_kb": 26224}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s069267190", "group_id": "codeNet:p03403", "input_text": "= $a[$i] && $a[$i] >= $a[$i-1]) {\n // echo \"A \";\n $tmp = $ans;\n } elseif ($a[$i+1] <= $a[$i] && $a[$i] <= $a[$i-1]) {\n // echo \"B \";\n $tmp = $ans;\n } else {\n // echo \"C \";\n $x = abs($a[$i+1] - $a[$i]);\n $y = abs($a[$i] - $a[$i-1]);\n $z = abs($a[$i+1] - $a[$i-1]);\n \n $tmp = $ans - $x - $y + $z;\n // echo \"{$ans} - {$x} - {$y} + {$z}\\n\";\n }\n echo $tmp . \"\\n\";\n}\n", "language": "PHP", "metadata": {"date": 1522027056, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03403.html", "problem_id": "p03403", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03403/input.txt", "sample_output_relpath": "derived/input_output/data/p03403/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03403/PHP/s069267190.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s069267190", "user_id": "u195912432"}, "prompt_components": {"gold_output": "12\n8\n10\n", "input_to_evaluate": "= $a[$i] && $a[$i] >= $a[$i-1]) {\n // echo \"A \";\n $tmp = $ans;\n } elseif ($a[$i+1] <= $a[$i] && $a[$i] <= $a[$i-1]) {\n // echo \"B \";\n $tmp = $ans;\n } else {\n // echo \"C \";\n $x = abs($a[$i+1] - $a[$i]);\n $y = abs($a[$i] - $a[$i-1]);\n $z = abs($a[$i+1] - $a[$i-1]);\n \n $tmp = $ans - $x - $y + $z;\n // echo \"{$ans} - {$x} - {$y} + {$z}\\n\";\n }\n echo $tmp . \"\\n\";\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "sample_input": "3\n3 5 -1\n"}, "reference_outputs": ["12\n8\n10\n"], "source_document_id": "p03403", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 754, "cpu_time_ms": 283, "memory_kb": 17140}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s537468702", "group_id": "codeNet:p03404", "input_text": " $ab[$j][0] && $cd[$i][1] > $ab[$j][1]\n && ($cd[$i][0] - $ab[$j][0]) + ($cd[$i][1] - $ab[$j][1]) < $min\n ) {\n $pos = $j;\n $min = ($cd[$i][0] - $ab[$j][0]) + ($cd[$i][1] - $ab[$j][1]);\n }\n\n }\n\n if ($pos >= 0) {\n $pair++;\n $ab[$pos][0] = $n * 3;\n $ab[$pos][1] = $n * 3;\n }\n}\n\necho $pair . PHP_EOL;", "language": "PHP", "metadata": {"date": 1521338026, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03409.html", "problem_id": "p03409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03409/input.txt", "sample_output_relpath": "derived/input_output/data/p03409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03409/PHP/s199195329.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s199195329", "user_id": "u004208081"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $ab[$j][0] && $cd[$i][1] > $ab[$j][1]\n && ($cd[$i][0] - $ab[$j][0]) + ($cd[$i][1] - $ab[$j][1]) < $min\n ) {\n $pos = $j;\n $min = ($cd[$i][0] - $ab[$j][0]) + ($cd[$i][1] - $ab[$j][1]);\n }\n\n }\n\n if ($pos >= 0) {\n $pair++;\n $ab[$pos][0] = $n * 3;\n $ab[$pos][1] = $n * 3;\n }\n}\n\necho $pair . PHP_EOL;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOn a two-dimensional plane, there are N red points and N blue points.\nThe coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i).\n\nA red point and a blue point can form a friendly pair when, the x-coordinate of the red point is smaller than that of the blue point, and the y-coordinate of the red point is also smaller than that of the blue point.\n\nAt most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq a_i, b_i, c_i, d_i < 2N\n\na_1, a_2, ..., a_N, c_1, c_2, ..., c_N are all different.\n\nb_1, b_2, ..., b_N, d_1, d_2, ..., d_N are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_N b_N\nc_1 d_1\nc_2 d_2\n:\nc_N d_N\n\nOutput\n\nPrint the maximum number of friendly pairs.\n\nSample Input 1\n\n3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n\nSample Output 1\n\n2\n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\nSample Input 2\n\n3\n0 0\n1 1\n5 2\n2 3\n3 4\n4 5\n\nSample Output 2\n\n2\n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\nSample Input 3\n\n2\n2 2\n3 3\n0 0\n1 1\n\nSample Output 3\n\n0\n\nIt is possible that no pair can be formed.\n\nSample Input 4\n\n5\n0 0\n7 3\n2 2\n4 8\n1 6\n8 5\n6 9\n5 4\n9 1\n3 7\n\nSample Output 4\n\n5\n\nSample Input 5\n\n5\n0 0\n1 1\n5 5\n6 6\n7 7\n2 2\n3 3\n4 4\n8 8\n9 9\n\nSample Output 5\n\n4", "sample_input": "3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03409", "source_text": "Score : 400 points\n\nProblem Statement\n\nOn a two-dimensional plane, there are N red points and N blue points.\nThe coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i).\n\nA red point and a blue point can form a friendly pair when, the x-coordinate of the red point is smaller than that of the blue point, and the y-coordinate of the red point is also smaller than that of the blue point.\n\nAt most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq a_i, b_i, c_i, d_i < 2N\n\na_1, a_2, ..., a_N, c_1, c_2, ..., c_N are all different.\n\nb_1, b_2, ..., b_N, d_1, d_2, ..., d_N are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_N b_N\nc_1 d_1\nc_2 d_2\n:\nc_N d_N\n\nOutput\n\nPrint the maximum number of friendly pairs.\n\nSample Input 1\n\n3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n\nSample Output 1\n\n2\n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\nSample Input 2\n\n3\n0 0\n1 1\n5 2\n2 3\n3 4\n4 5\n\nSample Output 2\n\n2\n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\nSample Input 3\n\n2\n2 2\n3 3\n0 0\n1 1\n\nSample Output 3\n\n0\n\nIt is possible that no pair can be formed.\n\nSample Input 4\n\n5\n0 0\n7 3\n2 2\n4 8\n1 6\n8 5\n6 9\n5 4\n9 1\n3 7\n\nSample Output 4\n\n5\n\nSample Input 5\n\n5\n0 0\n1 1\n5 5\n6 6\n7 7\n2 2\n3 3\n4 4\n8 8\n9 9\n\nSample Output 5\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 715, "cpu_time_ms": 11, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s105017639", "group_id": "codeNet:p03417", "input_text": " 1 && $m > 1) {\n\t$x = ($n - 2) * ($m - 2);\n} elseif ($n * $m == 1) {\n\t$x = 1;\n} else {\n\t$x = max($n, $m) - 2;\n}\necho $x;", "language": "PHP", "metadata": {"date": 1537888637, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03417.html", "problem_id": "p03417", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03417/input.txt", "sample_output_relpath": "derived/input_output/data/p03417/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03417/PHP/s105017639.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s105017639", "user_id": "u705304778"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": " 1 && $m > 1) {\n\t$x = ($n - 2) * ($m - 2);\n} elseif ($n * $m == 1) {\n\t$x = 1;\n} else {\n\t$x = max($n, $m) - 2;\n}\necho $x;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "sample_input": "2 2\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03417", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 166, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s864719367", "group_id": "codeNet:p03417", "input_text": "2 and $input[1]>2) {\n echo( ($input[0]-2) * ($input[1]-2) );\n exit();\n}elseif ($input[0]==2 or $input[1]==2) {\n exit(\"0\");\n}elseif ($input[0]==1 and $input[1]>2) {\n echo($input[1]-2);\n exit();\n}elseif ($input[0]>2 and $input[1]==1) {\n echo($input[0]-2);\n exit();\n}\n?>", "language": "PHP", "metadata": {"date": 1520822874, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03417.html", "problem_id": "p03417", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03417/input.txt", "sample_output_relpath": "derived/input_output/data/p03417/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03417/PHP/s864719367.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s864719367", "user_id": "u271445511"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "2 and $input[1]>2) {\n echo( ($input[0]-2) * ($input[1]-2) );\n exit();\n}elseif ($input[0]==2 or $input[1]==2) {\n exit(\"0\");\n}elseif ($input[0]==1 and $input[1]>2) {\n echo($input[1]-2);\n exit();\n}elseif ($input[0]>2 and $input[1]==1) {\n echo($input[0]-2);\n exit();\n}\n?>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "sample_input": "2 2\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03417", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 387, "cpu_time_ms": 10, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s852916155", "group_id": "codeNet:p03423", "input_text": "0){\n --$n;\n if($a[$n]=='Y'){\n echo 'Four';\n exit;\n }\n}\necho 'Three';", "language": "PHP", "metadata": {"date": 1547786211, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03424.html", "problem_id": "p03424", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03424/input.txt", "sample_output_relpath": "derived/input_output/data/p03424/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03424/PHP/s771202217.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s771202217", "user_id": "u281500237"}, "prompt_components": {"gold_output": "Four\n", "input_to_evaluate": "0){\n --$n;\n if($a[$n]=='Y'){\n echo 'Four';\n exit;\n }\n}\necho 'Three';", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn Japan, people make offerings called hina arare, colorful crackers, on March 3.\n\nWe have a bag that contains N hina arare. (From here, we call them arare.)\n\nIt is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.\n\nWe have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: P, white: W, green: G, yellow: Y.\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS_i is P, W, G or Y.\n\nThere always exist i, j and k such that S_i=P, S_j=W and S_k=G.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_N\n\nOutput\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nSample Input 1\n\n6\nG W Y P Y W\n\nSample Output 1\n\nFour\n\nThe bag contained arare in four colors, so you should print Four.\n\nSample Input 2\n\n9\nG W W G P W P G G\n\nSample Output 2\n\nThree\n\nThe bag contained arare in three colors, so you should print Three.\n\nSample Input 3\n\n8\nP Y W G Y W Y Y\n\nSample Output 3\n\nFour", "sample_input": "6\nG W Y P Y W\n"}, "reference_outputs": ["Four\n"], "source_document_id": "p03424", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn Japan, people make offerings called hina arare, colorful crackers, on March 3.\n\nWe have a bag that contains N hina arare. (From here, we call them arare.)\n\nIt is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.\n\nWe have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: P, white: W, green: G, yellow: Y.\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS_i is P, W, G or Y.\n\nThere always exist i, j and k such that S_i=P, S_j=W and S_k=G.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_N\n\nOutput\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nSample Input 1\n\n6\nG W Y P Y W\n\nSample Output 1\n\nFour\n\nThe bag contained arare in four colors, so you should print Four.\n\nSample Input 2\n\n9\nG W W G P W P G G\n\nSample Output 2\n\nThree\n\nThe bag contained arare in three colors, so you should print Three.\n\nSample Input 3\n\n8\nP Y W G Y W Y Y\n\nSample Output 3\n\nFour", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 145, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s867302286", "group_id": "codeNet:p03425", "input_text": " 0, 'A' => 0, 'R' => 0, 'C' => 0, 'H' => 0];\n$c_size = 0;\n$mltpl = 1;\n$nd = 0;\n$dup = 0;\n$ans = 0;\nfscanf(STDIN, \"%d\", $n);\nfor($i = 0; $i < $n; $i++){\n $ini = substr(fgets(STDIN), 0, 1);\n if(array_key_exists($ini, $cnt)) $cnt[$ini]++;\n}\nforeach($cnt as $v){\n if($v > 0){\n $c_size++;\n $mltpl *= $v;\n }\n if($v == 1) $nd++;\n}\n$base = ($c_size * ($c_size - 1) * ($c_size - 2)) / 6;\n$dup = ($nd * ($nd - 1) * ($nd -2)) / 6;\n$ans = $mltpl * $base - $dup;\n\necho $ans;", "language": "PHP", "metadata": {"date": 1580562148, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03425.html", "problem_id": "p03425", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03425/input.txt", "sample_output_relpath": "derived/input_output/data/p03425/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03425/PHP/s867302286.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s867302286", "user_id": "u289444421"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " 0, 'A' => 0, 'R' => 0, 'C' => 0, 'H' => 0];\n$c_size = 0;\n$mltpl = 1;\n$nd = 0;\n$dup = 0;\n$ans = 0;\nfscanf(STDIN, \"%d\", $n);\nfor($i = 0; $i < $n; $i++){\n $ini = substr(fgets(STDIN), 0, 1);\n if(array_key_exists($ini, $cnt)) $cnt[$ini]++;\n}\nforeach($cnt as $v){\n if($v > 0){\n $c_size++;\n $mltpl *= $v;\n }\n if($v == 1) $nd++;\n}\n$base = ($c_size * ($c_size - 1) * ($c_size - 2)) / 6;\n$dup = ($nd * ($nd - 1) * ($nd -2)) / 6;\n$ans = $mltpl * $base - $dup;\n\necho $ans;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people. The name of the i-th person is S_i.\n\nWe would like to choose three people so that the following conditions are met:\n\nThe name of every chosen person begins with M, A, R, C or H.\n\nThere are no multiple people whose names begin with the same letter.\n\nHow many such ways are there to choose three people, disregarding order?\n\nNote that the answer may not fit into a 32-bit integer type.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i consists of uppercase English letters.\n\n1 \\leq |S_i| \\leq 10\n\nS_i \\neq S_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf there are x ways to choose three people so that the given conditions are met, print x.\n\nSample Input 1\n\n5\nMASHIKE\nRUMOI\nOBIRA\nHABORO\nHOROKANAI\n\nSample Output 1\n\n2\n\nWe can choose three people with the following names:\n\nMASHIKE, RUMOI, HABORO\n\nMASHIKE, RUMOI, HOROKANAI\n\nThus, we have two ways.\n\nSample Input 2\n\n4\nZZ\nZZZ\nZ\nZZZZZZZZZZ\n\nSample Output 2\n\n0\n\nNote that there may be no ways to choose three people so that the given conditions are met.\n\nSample Input 3\n\n5\nCHOKUDAI\nRNG\nMAKOTO\nAOKI\nRINGO\n\nSample Output 3\n\n7", "sample_input": "5\nMASHIKE\nRUMOI\nOBIRA\nHABORO\nHOROKANAI\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03425", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people. The name of the i-th person is S_i.\n\nWe would like to choose three people so that the following conditions are met:\n\nThe name of every chosen person begins with M, A, R, C or H.\n\nThere are no multiple people whose names begin with the same letter.\n\nHow many such ways are there to choose three people, disregarding order?\n\nNote that the answer may not fit into a 32-bit integer type.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i consists of uppercase English letters.\n\n1 \\leq |S_i| \\leq 10\n\nS_i \\neq S_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf there are x ways to choose three people so that the given conditions are met, print x.\n\nSample Input 1\n\n5\nMASHIKE\nRUMOI\nOBIRA\nHABORO\nHOROKANAI\n\nSample Output 1\n\n2\n\nWe can choose three people with the following names:\n\nMASHIKE, RUMOI, HABORO\n\nMASHIKE, RUMOI, HOROKANAI\n\nThus, we have two ways.\n\nSample Input 2\n\n4\nZZ\nZZZ\nZ\nZZZZZZZZZZ\n\nSample Output 2\n\n0\n\nNote that there may be no ways to choose three people so that the given conditions are met.\n\nSample Input 3\n\n5\nCHOKUDAI\nRNG\nMAKOTO\nAOKI\nRINGO\n\nSample Output 3\n\n7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 510, "cpu_time_ms": 40, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s281964974", "group_id": "codeNet:p03427", "input_text": "", "language": "PHP", "metadata": {"date": 1591810159, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03433.html", "problem_id": "p03433", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03433/input.txt", "sample_output_relpath": "derived/input_output/data/p03433/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03433/PHP/s518407521.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s518407521", "user_id": "u861406994"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using only these coins.\n\nConstraints\n\nN is an integer between 1 and 10000 (inclusive).\n\nA is an integer between 0 and 1000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutput\n\nIf E869120 can pay exactly N yen using only his 1-yen and 500-yen coins, print Yes; otherwise, print No.\n\nSample Input 1\n\n2018\n218\n\nSample Output 1\n\nYes\n\nWe can pay 2018 yen with four 500-yen coins and 18 1-yen coins, so the answer is Yes.\n\nSample Input 2\n\n2763\n0\n\nSample Output 2\n\nNo\n\nWhen we have no 1-yen coins, we can only pay a multiple of 500 yen using only 500-yen coins. Since 2763 is not a multiple of 500, we cannot pay this amount.\n\nSample Input 3\n\n37\n514\n\nSample Output 3\n\nYes", "sample_input": "2018\n218\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03433", "source_text": "Score: 100 points\n\nProblem Statement\n\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using only these coins.\n\nConstraints\n\nN is an integer between 1 and 10000 (inclusive).\n\nA is an integer between 0 and 1000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutput\n\nIf E869120 can pay exactly N yen using only his 1-yen and 500-yen coins, print Yes; otherwise, print No.\n\nSample Input 1\n\n2018\n218\n\nSample Output 1\n\nYes\n\nWe can pay 2018 yen with four 500-yen coins and 18 1-yen coins, so the answer is Yes.\n\nSample Input 2\n\n2763\n0\n\nSample Output 2\n\nNo\n\nWhen we have no 1-yen coins, we can only pay a multiple of 500 yen using only 500-yen coins. Since 2763 is not a multiple of 500, we cannot pay this amount.\n\nSample Input 3\n\n37\n514\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 11, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s851324455", "group_id": "codeNet:p03433", "input_text": "", "language": "PHP", "metadata": {"date": 1582373682, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03433.html", "problem_id": "p03433", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03433/input.txt", "sample_output_relpath": "derived/input_output/data/p03433/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03433/PHP/s851324455.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s851324455", "user_id": "u255302563"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score: 100 points\n\nProblem Statement\n\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using only these coins.\n\nConstraints\n\nN is an integer between 1 and 10000 (inclusive).\n\nA is an integer between 0 and 1000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutput\n\nIf E869120 can pay exactly N yen using only his 1-yen and 500-yen coins, print Yes; otherwise, print No.\n\nSample Input 1\n\n2018\n218\n\nSample Output 1\n\nYes\n\nWe can pay 2018 yen with four 500-yen coins and 18 1-yen coins, so the answer is Yes.\n\nSample Input 2\n\n2763\n0\n\nSample Output 2\n\nNo\n\nWhen we have no 1-yen coins, we can only pay a multiple of 500 yen using only 500-yen coins. Since 2763 is not a multiple of 500, we cannot pay this amount.\n\nSample Input 3\n\n37\n514\n\nSample Output 3\n\nYes", "sample_input": "2018\n218\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03433", "source_text": "Score: 100 points\n\nProblem Statement\n\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using only these coins.\n\nConstraints\n\nN is an integer between 1 and 10000 (inclusive).\n\nA is an integer between 0 and 1000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutput\n\nIf E869120 can pay exactly N yen using only his 1-yen and 500-yen coins, print Yes; otherwise, print No.\n\nSample Input 1\n\n2018\n218\n\nSample Output 1\n\nYes\n\nWe can pay 2018 yen with four 500-yen coins and 18 1-yen coins, so the answer is Yes.\n\nSample Input 2\n\n2763\n0\n\nSample Output 2\n\nNo\n\nWhen we have no 1-yen coins, we can only pay a multiple of 500 yen using only 500-yen coins. Since 2763 is not a multiple of 500, we cannot pay this amount.\n\nSample Input 3\n\n37\n514\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 189, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s327345778", "group_id": "codeNet:p03434", "input_text": "enqueue(0); // キューに0を追加\n\nwhile (!$q->isEmpty()) {\n $v = $q->dequeue();\n\n foreach ($g[$v] as $next_v) {\n if ($dist[$next_v] !== -1) continue; // 発見済み\n\n $dist[$next_v] = $dist[$v] + 1;\n $q->enqueue($next_v);\n }\n}\nif ($dist[$h * $w - 1] === -1) exit('-1');\necho $cnt_w - 2 - ($dist[$h * $w - 1] - 1);\n", "language": "PHP", "metadata": {"date": 1591642829, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03436.html", "problem_id": "p03436", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03436/input.txt", "sample_output_relpath": "derived/input_output/data/p03436/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03436/PHP/s783939544.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s783939544", "user_id": "u055687468"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "enqueue(0); // キューに0を追加\n\nwhile (!$q->isEmpty()) {\n $v = $q->dequeue();\n\n foreach ($g[$v] as $next_v) {\n if ($dist[$next_v] !== -1) continue; // 発見済み\n\n $dist[$next_v] = $dist[$v] + 1;\n $q->enqueue($next_v);\n }\n}\nif ($dist[$h * $w - 1] === -1) exit('-1');\necho $cnt_w - 2 - ($dist[$h * $w - 1] - 1);\n", "problem_context": "Score: 400 points\n\nProblem statement\n\nWe have an H \\times W grid whose squares are painted black or white. The square at the i-th row from the top and the j-th column from the left is denoted as (i, j).\n\nSnuke would like to play the following game on this grid. At the beginning of the game, there is a character called Kenus at square (1, 1). The player repeatedly moves Kenus up, down, left or right by one square. The game is completed when Kenus reaches square (H, W) passing only white squares.\n\nBefore Snuke starts the game, he can change the color of some of the white squares to black. However, he cannot change the color of square (1, 1) and (H, W). Also, changes of color must all be carried out before the beginning of the game.\n\nWhen the game is completed, Snuke's score will be the number of times he changed the color of a square before the beginning of the game. Find the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed, that is, Kenus can never reach square (H, W) regardless of how Snuke changes the color of the squares.\n\nThe color of the squares are given to you as characters s_{i, j}. If square (i, j) is initially painted by white, s_{i, j} is .; if square (i, j) is initially painted by black, s_{i, j} is #.\n\nConstraints\n\nH is an integer between 2 and 50 (inclusive).\n\nW is an integer between 2 and 50 (inclusive).\n\ns_{i, j} is . or # (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\ns_{1, 1} and s_{H, W} are ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1}s_{1, 2}s_{1, 3} ... s_{1, W}\ns_{2, 1}s_{2, 2}s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1}s_{H, 2}s_{H, 3} ... s_{H, W}\n\nOutput\n\nPrint the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed.\n\nSample Input 1\n\n3 3\n..#\n#..\n...\n\nSample Output 1\n\n2\n\nThe score 2 can be achieved by changing the color of squares as follows:\n\nSample Input 2\n\n10 37\n.....................................\n...#...####...####..###...###...###..\n..#.#..#...#.##....#...#.#...#.#...#.\n..#.#..#...#.#.....#...#.#...#.#...#.\n.#...#.#..##.#.....#...#.#.###.#.###.\n.#####.####..#.....#...#..##....##...\n.#...#.#...#.#.....#...#.#...#.#...#.\n.#...#.#...#.##....#...#.#...#.#...#.\n.#...#.####...####..###...###...###..\n.....................................\n\nSample Output 2\n\n209", "sample_input": "3 3\n..#\n#..\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03436", "source_text": "Score: 400 points\n\nProblem statement\n\nWe have an H \\times W grid whose squares are painted black or white. The square at the i-th row from the top and the j-th column from the left is denoted as (i, j).\n\nSnuke would like to play the following game on this grid. At the beginning of the game, there is a character called Kenus at square (1, 1). The player repeatedly moves Kenus up, down, left or right by one square. The game is completed when Kenus reaches square (H, W) passing only white squares.\n\nBefore Snuke starts the game, he can change the color of some of the white squares to black. However, he cannot change the color of square (1, 1) and (H, W). Also, changes of color must all be carried out before the beginning of the game.\n\nWhen the game is completed, Snuke's score will be the number of times he changed the color of a square before the beginning of the game. Find the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed, that is, Kenus can never reach square (H, W) regardless of how Snuke changes the color of the squares.\n\nThe color of the squares are given to you as characters s_{i, j}. If square (i, j) is initially painted by white, s_{i, j} is .; if square (i, j) is initially painted by black, s_{i, j} is #.\n\nConstraints\n\nH is an integer between 2 and 50 (inclusive).\n\nW is an integer between 2 and 50 (inclusive).\n\ns_{i, j} is . or # (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\ns_{1, 1} and s_{H, W} are ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1}s_{1, 2}s_{1, 3} ... s_{1, W}\ns_{2, 1}s_{2, 2}s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1}s_{H, 2}s_{H, 3} ... s_{H, W}\n\nOutput\n\nPrint the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed.\n\nSample Input 1\n\n3 3\n..#\n#..\n...\n\nSample Output 1\n\n2\n\nThe score 2 can be achieved by changing the color of squares as follows:\n\nSample Input 2\n\n10 37\n.....................................\n...#...####...####..###...###...###..\n..#.#..#...#.##....#...#.#...#.#...#.\n..#.#..#...#.#.....#...#.#...#.#...#.\n.#...#.#..##.#.....#...#.#.###.#.###.\n.#####.####..#.....#...#..##....##...\n.#...#.#...#.#.....#...#.#...#.#...#.\n.#...#.#...#.##....#...#.#...#.#...#.\n.#...#.####...####..###...###...###..\n.....................................\n\nSample Output 2\n\n209", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1271, "cpu_time_ms": 14, "memory_kb": 5240}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s912330621", "group_id": "codeNet:p03436", "input_text": " $map[0][0], 'x' => 0, 'y' => 0, 'cnt' => 1));\n while(true) {\n $next = array_shift($openlist);\n\n if($next == NULL) {\n return -1;\n }\n\n if($next['x'] == $goalx && $next['y'] == $goaly) {\n return $next['cnt'];\n }\n\n $x = $next['x'];\n $y = $next['y'];\n // はじっこはだめだぞ\n if(($hm[1] - 1) > $x &&\n $map[$y][$x + 1] != '#' &&\n !isset($visited[$y][$x + 1])) {\n array_push($openlist,\n array(\n 'v' => $map[$y][$x + 1],\n 'x' => $x + 1,\n 'y' => $y,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y][$x + 1] = true;\n }\n if(($hm[0] - 1) > $y &&\n $map[$y + 1][$x] != '#' &&\n !isset($visited[$y + 1][$x])) {\n array_push($openlist,\n array(\n 'v' => $map[$y + 1][$x],\n 'x' => $x,\n 'y' => $y + 1,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y + 1][$x] = true;\n }\n if(0 < $x &&\n $map[$y][$x - 1] != '#' &&\n !isset($visited[$y][$x - 1])) {\n array_push($openlist,\n array(\n 'v' => $map[$y][$x - 1],\n 'x' => $x - 1,\n 'y' => $y,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y][$x - 1] = true;\n }\n if(0 < $y &&\n $map[$y - 1][$x] != '#' &&\n !isset($visited[$y - 1][$x])) {\n array_push($openlist,\n array(\n 'v' => $map[$y - 1][$x],\n 'x' => $x,\n 'y' => $y - 1,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y - 1][$x] = true;\n }\n }\n}\n\n$dist = shortest_dist($map, $hm[1] - 1, $hm[0] - 1);\nif($dist == -1) {\n echo \"-1\\n\";\n return;\n}\n\n$black = 0;\nforeach($map as $line) {\n foreach($line as $cell) {\n if ($cell == '#') {\n $black++;\n }\n }\n}\n\n$result = $hm[0] * $hm[1] - $black - $dist;\necho \"$result\\n\";\n", "language": "PHP", "metadata": {"date": 1519078752, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03436.html", "problem_id": "p03436", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03436/input.txt", "sample_output_relpath": "derived/input_output/data/p03436/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03436/PHP/s912330621.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s912330621", "user_id": "u887924592"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $map[0][0], 'x' => 0, 'y' => 0, 'cnt' => 1));\n while(true) {\n $next = array_shift($openlist);\n\n if($next == NULL) {\n return -1;\n }\n\n if($next['x'] == $goalx && $next['y'] == $goaly) {\n return $next['cnt'];\n }\n\n $x = $next['x'];\n $y = $next['y'];\n // はじっこはだめだぞ\n if(($hm[1] - 1) > $x &&\n $map[$y][$x + 1] != '#' &&\n !isset($visited[$y][$x + 1])) {\n array_push($openlist,\n array(\n 'v' => $map[$y][$x + 1],\n 'x' => $x + 1,\n 'y' => $y,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y][$x + 1] = true;\n }\n if(($hm[0] - 1) > $y &&\n $map[$y + 1][$x] != '#' &&\n !isset($visited[$y + 1][$x])) {\n array_push($openlist,\n array(\n 'v' => $map[$y + 1][$x],\n 'x' => $x,\n 'y' => $y + 1,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y + 1][$x] = true;\n }\n if(0 < $x &&\n $map[$y][$x - 1] != '#' &&\n !isset($visited[$y][$x - 1])) {\n array_push($openlist,\n array(\n 'v' => $map[$y][$x - 1],\n 'x' => $x - 1,\n 'y' => $y,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y][$x - 1] = true;\n }\n if(0 < $y &&\n $map[$y - 1][$x] != '#' &&\n !isset($visited[$y - 1][$x])) {\n array_push($openlist,\n array(\n 'v' => $map[$y - 1][$x],\n 'x' => $x,\n 'y' => $y - 1,\n 'cnt' => $next['cnt'] + 1\n )\n );\n $visited[$y - 1][$x] = true;\n }\n }\n}\n\n$dist = shortest_dist($map, $hm[1] - 1, $hm[0] - 1);\nif($dist == -1) {\n echo \"-1\\n\";\n return;\n}\n\n$black = 0;\nforeach($map as $line) {\n foreach($line as $cell) {\n if ($cell == '#') {\n $black++;\n }\n }\n}\n\n$result = $hm[0] * $hm[1] - $black - $dist;\necho \"$result\\n\";\n", "problem_context": "Score: 400 points\n\nProblem statement\n\nWe have an H \\times W grid whose squares are painted black or white. The square at the i-th row from the top and the j-th column from the left is denoted as (i, j).\n\nSnuke would like to play the following game on this grid. At the beginning of the game, there is a character called Kenus at square (1, 1). The player repeatedly moves Kenus up, down, left or right by one square. The game is completed when Kenus reaches square (H, W) passing only white squares.\n\nBefore Snuke starts the game, he can change the color of some of the white squares to black. However, he cannot change the color of square (1, 1) and (H, W). Also, changes of color must all be carried out before the beginning of the game.\n\nWhen the game is completed, Snuke's score will be the number of times he changed the color of a square before the beginning of the game. Find the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed, that is, Kenus can never reach square (H, W) regardless of how Snuke changes the color of the squares.\n\nThe color of the squares are given to you as characters s_{i, j}. If square (i, j) is initially painted by white, s_{i, j} is .; if square (i, j) is initially painted by black, s_{i, j} is #.\n\nConstraints\n\nH is an integer between 2 and 50 (inclusive).\n\nW is an integer between 2 and 50 (inclusive).\n\ns_{i, j} is . or # (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\ns_{1, 1} and s_{H, W} are ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1}s_{1, 2}s_{1, 3} ... s_{1, W}\ns_{2, 1}s_{2, 2}s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1}s_{H, 2}s_{H, 3} ... s_{H, W}\n\nOutput\n\nPrint the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed.\n\nSample Input 1\n\n3 3\n..#\n#..\n...\n\nSample Output 1\n\n2\n\nThe score 2 can be achieved by changing the color of squares as follows:\n\nSample Input 2\n\n10 37\n.....................................\n...#...####...####..###...###...###..\n..#.#..#...#.##....#...#.#...#.#...#.\n..#.#..#...#.#.....#...#.#...#.#...#.\n.#...#.#..##.#.....#...#.#.###.#.###.\n.#####.####..#.....#...#..##....##...\n.#...#.#...#.#.....#...#.#...#.#...#.\n.#...#.#...#.##....#...#.#...#.#...#.\n.#...#.####...####..###...###...###..\n.....................................\n\nSample Output 2\n\n209", "sample_input": "3 3\n..#\n#..\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03436", "source_text": "Score: 400 points\n\nProblem statement\n\nWe have an H \\times W grid whose squares are painted black or white. The square at the i-th row from the top and the j-th column from the left is denoted as (i, j).\n\nSnuke would like to play the following game on this grid. At the beginning of the game, there is a character called Kenus at square (1, 1). The player repeatedly moves Kenus up, down, left or right by one square. The game is completed when Kenus reaches square (H, W) passing only white squares.\n\nBefore Snuke starts the game, he can change the color of some of the white squares to black. However, he cannot change the color of square (1, 1) and (H, W). Also, changes of color must all be carried out before the beginning of the game.\n\nWhen the game is completed, Snuke's score will be the number of times he changed the color of a square before the beginning of the game. Find the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed, that is, Kenus can never reach square (H, W) regardless of how Snuke changes the color of the squares.\n\nThe color of the squares are given to you as characters s_{i, j}. If square (i, j) is initially painted by white, s_{i, j} is .; if square (i, j) is initially painted by black, s_{i, j} is #.\n\nConstraints\n\nH is an integer between 2 and 50 (inclusive).\n\nW is an integer between 2 and 50 (inclusive).\n\ns_{i, j} is . or # (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\ns_{1, 1} and s_{H, W} are ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1}s_{1, 2}s_{1, 3} ... s_{1, W}\ns_{2, 1}s_{2, 2}s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1}s_{H, 2}s_{H, 3} ... s_{H, W}\n\nOutput\n\nPrint the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed.\n\nSample Input 1\n\n3 3\n..#\n#..\n...\n\nSample Output 1\n\n2\n\nThe score 2 can be achieved by changing the color of squares as follows:\n\nSample Input 2\n\n10 37\n.....................................\n...#...####...####..###...###...###..\n..#.#..#...#.##....#...#.#...#.#...#.\n..#.#..#...#.#.....#...#.#...#.#...#.\n.#...#.#..##.#.....#...#.#.###.#.###.\n.#####.####..#.....#...#..##....##...\n.#...#.#...#.#.....#...#.#...#.#...#.\n.#...#.#...#.##....#...#.#...#.#...#.\n.#...#.####...####..###...###...###..\n.....................................\n\nSample Output 2\n\n209", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2774, "cpu_time_ms": 18, "memory_kb": 5240}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s809371759", "group_id": "codeNet:p03437", "input_text": "$b[$i]) {\n printf(\"No\\n\");\n exit;\n }\n}\nprintf(\"Yes\\n\");\n", "language": "PHP", "metadata": {"date": 1517764500, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03438.html", "problem_id": "p03438", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03438/input.txt", "sample_output_relpath": "derived/input_output/data/p03438/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03438/PHP/s149648568.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s149648568", "user_id": "u278278558"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$b[$i]) {\n printf(\"No\\n\");\n exit;\n }\n}\nprintf(\"Yes\\n\");\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two integer sequences of length N: a_1,a_2,..,a_N and b_1,b_2,..,b_N.\nDetermine if we can repeat the following operation zero or more times so that the sequences a and b become equal.\n\nOperation: Choose two integers i and j (possibly the same) between 1 and N (inclusive), then perform the following two actions simultaneously:\n\nAdd 2 to a_i.\n\nAdd 1 to b_j.\n\nConstraints\n\n1 ≤ N ≤ 10 000\n\n0 ≤ a_i,b_i ≤ 10^9 (1 ≤ i ≤ N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 .. a_N\nb_1 b_2 .. b_N\n\nOutput\n\nIf we can repeat the operation zero or more times so that the sequences a and b become equal, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 2 3\n5 2 2\n\nSample Output 1\n\nYes\n\nFor example, we can perform three operations as follows to do our job:\n\nFirst operation: i=1 and j=2. Now we have a = \\{3,2,3\\}, b = \\{5,3,2\\}.\n\nSecond operation: i=1 and j=2. Now we have a = \\{5,2,3\\}, b = \\{5,4,2\\}.\n\nThird operation: i=2 and j=3. Now we have a = \\{5,4,3\\}, b = \\{5,4,3\\}.\n\nSample Input 2\n\n5\n3 1 4 1 5\n2 7 1 8 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n2 7 1 8 2\n3 1 4 1 5\n\nSample Output 3\n\nNo", "sample_input": "3\n1 2 3\n5 2 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03438", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two integer sequences of length N: a_1,a_2,..,a_N and b_1,b_2,..,b_N.\nDetermine if we can repeat the following operation zero or more times so that the sequences a and b become equal.\n\nOperation: Choose two integers i and j (possibly the same) between 1 and N (inclusive), then perform the following two actions simultaneously:\n\nAdd 2 to a_i.\n\nAdd 1 to b_j.\n\nConstraints\n\n1 ≤ N ≤ 10 000\n\n0 ≤ a_i,b_i ≤ 10^9 (1 ≤ i ≤ N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 .. a_N\nb_1 b_2 .. b_N\n\nOutput\n\nIf we can repeat the operation zero or more times so that the sequences a and b become equal, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 2 3\n5 2 2\n\nSample Output 1\n\nYes\n\nFor example, we can perform three operations as follows to do our job:\n\nFirst operation: i=1 and j=2. Now we have a = \\{3,2,3\\}, b = \\{5,3,2\\}.\n\nSecond operation: i=1 and j=2. Now we have a = \\{5,2,3\\}, b = \\{5,4,2\\}.\n\nThird operation: i=2 and j=3. Now we have a = \\{5,4,3\\}, b = \\{5,4,3\\}.\n\nSample Input 2\n\n5\n3 1 4 1 5\n2 7 1 8 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n2 7 1 8 2\n3 1 4 1 5\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 336, "cpu_time_ms": 63, "memory_kb": 7300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s271409476", "group_id": "codeNet:p03447", "input_text": "", "language": "PHP", "metadata": {"date": 1575916858, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03447.html", "problem_id": "p03447", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03447/input.txt", "sample_output_relpath": "derived/input_output/data/p03447/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03447/PHP/s271409476.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s271409476", "user_id": "u397596606"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "sample_input": "1234\n150\n100\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03447", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 87, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s790356927", "group_id": "codeNet:p03447", "input_text": "\n", "language": "PHP", "metadata": {"date": 1517191699, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03447.html", "problem_id": "p03447", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03447/input.txt", "sample_output_relpath": "derived/input_output/data/p03447/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03447/PHP/s790356927.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s790356927", "user_id": "u097920019"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "sample_input": "1234\n150\n100\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03447", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 137, "cpu_time_ms": 10, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s713304443", "group_id": "codeNet:p03456", "input_text": "\n\ncurrent();\n $gen->next();\n return $value;\n}\n$gen = genInputs();\n\n$N = (int)getNext($gen);\n$K = (int)getNext($gen);\n$sq = [];\nfor ($i = 0; $i < $N; $i++) {\n $x = (int)getNext($gen);\n $y = (int)getNext($gen);\n $c = (string)getNext($gen);\n\n $x = $x % 6;\n $y = $y % 6;\n if ($x < 0) { $x += 6; }\n if ($y < 0) { $y += 6; }\n for ($j = 0; $j < 18; $j++) {\n $a = (int)($j / 3);\n $b = $j % 3;\n $diff_x = $x - $a;\n $diff_y = $y - $b;\n $is_ok = false;\n if ($diff_x >= 0) {\n if ($diff_y >= 0) {\n if ($diff_x < 3 && $diff_y < 3) {\n $is_ok = true;\n } elseif ($diff_x >= 3 && $diff_y >= 3) {\n $is_ok = true;\n }\n } else {\n if ($diff_x < 3 && $diff_y < -3) {\n $is_ok = true;\n } elseif ($diff_x >= 3 && $diff_y >= -3) {\n $is_ok = true;\n }\n }\n } else {\n if ($diff_y >= 0) {\n if ($diff_x >= -3 && $diff_y >= 3) {\n $is_ok = true;\n } elseif ($diff_x < -3 && $diff_y < 3) {\n $is_ok = true;\n }\n } else {\n if ($diff_x >= -3 && $diff_y >= -3) {\n $is_ok = true;\n } elseif ($diff_x < -3 && $diff_y < -3) {\n $is_ok = true;\n }\n }\n }\n if (($is_ok && $c == WHITE) || (!$is_ok && $c == BLACK)) {\n if (!isset($sq[$j])) {\n $sq[$j] = 0;\n }\n $sq[$j]++;\n }\n }\n}\necho max($sq).PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1556594392, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03458.html", "problem_id": "p03458", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03458/input.txt", "sample_output_relpath": "derived/input_output/data/p03458/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03458/PHP/s942312314.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s942312314", "user_id": "u392919553"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "#!/usr/bin/env php\ncurrent();\n $gen->next();\n return $value;\n}\n$gen = genInputs();\n\n$N = (int)getNext($gen);\n$K = (int)getNext($gen);\n$sq = [];\nfor ($i = 0; $i < $N; $i++) {\n $x = (int)getNext($gen);\n $y = (int)getNext($gen);\n $c = (string)getNext($gen);\n\n $x = $x % 6;\n $y = $y % 6;\n if ($x < 0) { $x += 6; }\n if ($y < 0) { $y += 6; }\n for ($j = 0; $j < 18; $j++) {\n $a = (int)($j / 3);\n $b = $j % 3;\n $diff_x = $x - $a;\n $diff_y = $y - $b;\n $is_ok = false;\n if ($diff_x >= 0) {\n if ($diff_y >= 0) {\n if ($diff_x < 3 && $diff_y < 3) {\n $is_ok = true;\n } elseif ($diff_x >= 3 && $diff_y >= 3) {\n $is_ok = true;\n }\n } else {\n if ($diff_x < 3 && $diff_y < -3) {\n $is_ok = true;\n } elseif ($diff_x >= 3 && $diff_y >= -3) {\n $is_ok = true;\n }\n }\n } else {\n if ($diff_y >= 0) {\n if ($diff_x >= -3 && $diff_y >= 3) {\n $is_ok = true;\n } elseif ($diff_x < -3 && $diff_y < 3) {\n $is_ok = true;\n }\n } else {\n if ($diff_x >= -3 && $diff_y >= -3) {\n $is_ok = true;\n } elseif ($diff_x < -3 && $diff_y < -3) {\n $is_ok = true;\n }\n }\n }\n if (($is_ok && $c == WHITE) || (!$is_ok && $c == BLACK)) {\n if (!isset($sq[$j])) {\n $sq[$j] = 0;\n }\n $sq[$j]++;\n }\n }\n}\necho max($sq).PHP_EOL;\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nAtCoDeer is thinking of painting an infinite two-dimensional grid in a checked pattern of side K.\nHere, a checked pattern of side K is a pattern where each square is painted black or white so that each connected component of each color is a K × K square.\nBelow is an example of a checked pattern of side 3:\n\nAtCoDeer has N desires.\nThe i-th desire is represented by x_i, y_i and c_i.\nIf c_i is B, it means that he wants to paint the square (x_i,y_i) black; if c_i is W, he wants to paint the square (x_i,y_i) white.\nAt most how many desires can he satisfy at the same time?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 1000\n\n0 ≤ x_i ≤ 10^9\n\n0 ≤ y_i ≤ 10^9\n\nIf i ≠ j, then (x_i,y_i) ≠ (x_j,y_j).\n\nc_i is B or W.\n\nN, K, x_i and y_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 y_1 c_1\nx_2 y_2 c_2\n:\nx_N y_N c_N\n\nOutput\n\nPrint the maximum number of desires that can be satisfied at the same time.\n\nSample Input 1\n\n4 3\n0 1 W\n1 2 W\n5 3 B\n5 4 B\n\nSample Output 1\n\n4\n\nHe can satisfy all his desires by painting as shown in the example above.\n\nSample Input 2\n\n2 1000\n0 0 B\n0 1 W\n\nSample Output 2\n\n2\n\nSample Input 3\n\n6 2\n1 2 B\n2 1 W\n2 2 B\n1 0 B\n0 6 W\n4 5 W\n\nSample Output 3\n\n4", "sample_input": "4 3\n0 1 W\n1 2 W\n5 3 B\n5 4 B\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03458", "source_text": "Score : 500 points\n\nProblem Statement\n\nAtCoDeer is thinking of painting an infinite two-dimensional grid in a checked pattern of side K.\nHere, a checked pattern of side K is a pattern where each square is painted black or white so that each connected component of each color is a K × K square.\nBelow is an example of a checked pattern of side 3:\n\nAtCoDeer has N desires.\nThe i-th desire is represented by x_i, y_i and c_i.\nIf c_i is B, it means that he wants to paint the square (x_i,y_i) black; if c_i is W, he wants to paint the square (x_i,y_i) white.\nAt most how many desires can he satisfy at the same time?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 1000\n\n0 ≤ x_i ≤ 10^9\n\n0 ≤ y_i ≤ 10^9\n\nIf i ≠ j, then (x_i,y_i) ≠ (x_j,y_j).\n\nc_i is B or W.\n\nN, K, x_i and y_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 y_1 c_1\nx_2 y_2 c_2\n:\nx_N y_N c_N\n\nOutput\n\nPrint the maximum number of desires that can be satisfied at the same time.\n\nSample Input 1\n\n4 3\n0 1 W\n1 2 W\n5 3 B\n5 4 B\n\nSample Output 1\n\n4\n\nHe can satisfy all his desires by painting as shown in the example above.\n\nSample Input 2\n\n2 1000\n0 0 B\n0 1 W\n\nSample Output 2\n\n2\n\nSample Input 3\n\n6 2\n1 2 B\n2 1 W\n2 2 B\n1 0 B\n0 6 W\n4 5 W\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1976, "cpu_time_ms": 648, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s157677788", "group_id": "codeNet:p03469", "input_text": "validation($sheets, $balance)){\n return '-1 -1 -1';\n }\n for($x = 0; $x <= $sheets; $x++){\n for($y = 0; $y <= $sheets; $y++){\n $z = $sheets - $x - $y;\n if($sum = $x * 10000 + $y * 5000 + $z * 1000){\n return printf('%d %d %d', $x, $y, $z);\n }\n }\n }\n return '-1 -1 -1';\n }\n\n\n private function validation($n, $y)\n {\n if(!is_integer($n)){\n return false;\n }\n\n if(!is_integer($y)){\n return false;\n }\n if($n < 1 || 2000 < $n){\n // 制約に違反\n return false;\n }\n\n if($y < self::yen1000){\n // 制約に違反(1000 <= Y\n return false;\n }\n \n if((2 * pow(10, 7) < $y)){\n // 制約に違反(Y <= 2 * 10の7乗\n return false;\n } \n \n if(($y % self::yen1000) !== 0){\n // 制約に違反(Yは1000の倍数である\n return false;\n }\n return true;\n }\n}\n\n\n\n$input = fgets(STDIN);\nlist($sheets, $balance) = explode(' ', $input);\n\n\n$test = new Test();\necho $test->calc($sheets, $balance);\n", "language": "PHP", "metadata": {"date": 1591991784, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03469.html", "problem_id": "p03469", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03469/input.txt", "sample_output_relpath": "derived/input_output/data/p03469/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03469/PHP/s157677788.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s157677788", "user_id": "u166635180"}, "prompt_components": {"gold_output": "2018/01/07\n", "input_to_evaluate": "validation($sheets, $balance)){\n return '-1 -1 -1';\n }\n for($x = 0; $x <= $sheets; $x++){\n for($y = 0; $y <= $sheets; $y++){\n $z = $sheets - $x - $y;\n if($sum = $x * 10000 + $y * 5000 + $z * 1000){\n return printf('%d %d %d', $x, $y, $z);\n }\n }\n }\n return '-1 -1 -1';\n }\n\n\n private function validation($n, $y)\n {\n if(!is_integer($n)){\n return false;\n }\n\n if(!is_integer($y)){\n return false;\n }\n if($n < 1 || 2000 < $n){\n // 制約に違反\n return false;\n }\n\n if($y < self::yen1000){\n // 制約に違反(1000 <= Y\n return false;\n }\n \n if((2 * pow(10, 7) < $y)){\n // 制約に違反(Y <= 2 * 10の7乗\n return false;\n } \n \n if(($y % self::yen1000) !== 0){\n // 制約に違反(Yは1000の倍数である\n return false;\n }\n return true;\n }\n}\n\n\n\n$input = fgets(STDIN);\nlist($sheets, $balance) = explode(' ', $input);\n\n\n$test = new Test();\necho $test->calc($sheets, $balance);\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "sample_input": "2017/01/07\n"}, "reference_outputs": ["2018/01/07\n"], "source_document_id": "p03469", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1409, "cpu_time_ms": 13, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s479659717", "group_id": "codeNet:p03469", "input_text": "", "language": "PHP", "metadata": {"date": 1582426198, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03469.html", "problem_id": "p03469", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03469/input.txt", "sample_output_relpath": "derived/input_output/data/p03469/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03469/PHP/s299669208.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s299669208", "user_id": "u789760907"}, "prompt_components": {"gold_output": "2018/01/07\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "sample_input": "2017/01/07\n"}, "reference_outputs": ["2018/01/07\n"], "source_document_id": "p03469", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 90, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s288696937", "group_id": "codeNet:p03469", "input_text": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$str = $sc->next();\n$str[3] = '8';\nout::println($str);\n", "language": "PHP", "metadata": {"date": 1515794227, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03469.html", "problem_id": "p03469", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03469/input.txt", "sample_output_relpath": "derived/input_output/data/p03469/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03469/PHP/s222124420.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s222124420", "user_id": "u692814396"}, "prompt_components": {"gold_output": "2018/01/07\n", "input_to_evaluate": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$str = $sc->next();\n$str[3] = '8';\nout::println($str);\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "sample_input": "2017/01/07\n"}, "reference_outputs": ["2018/01/07\n"], "source_document_id": "p03469", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 857, "cpu_time_ms": 15, "memory_kb": 3956}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s240018724", "group_id": "codeNet:p03470", "input_text": "\n", "language": "PHP", "metadata": {"date": 1573847536, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03470.html", "problem_id": "p03470", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03470/input.txt", "sample_output_relpath": "derived/input_output/data/p03470/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03470/PHP/s240018724.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s240018724", "user_id": "u134455692"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "sample_input": "4\n10\n8\n8\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03470", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 135, "cpu_time_ms": 10, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s148570509", "group_id": "codeNet:p03470", "input_text": "", "language": "PHP", "metadata": {"date": 1555366669, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03470.html", "problem_id": "p03470", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03470/input.txt", "sample_output_relpath": "derived/input_output/data/p03470/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03470/PHP/s148570509.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s148570509", "user_id": "u437779158"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "sample_input": "4\n10\n8\n8\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03470", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 324, "cpu_time_ms": 10, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s051638968", "group_id": "codeNet:p03470", "input_text": "nextInt();\n $d = array();\n for ($i = 0; $i < $n; $i++) {\n $d[] = $sc->nextInt();\n }\n\n\n\n} else {\n //----------------------------------------------------------------------------------\n // Input for test\n //----------------------------------------------------------------------------------\n error_reporting(E_ERROR | E_WARNING | E_PARSE);\n\n $n = 7;\n $d = array(50,30,50,100,50,80,30);\n\n\n\n}\n//----------------------------------------------------------------------------------\n// Main\n//----------------------------------------------------------------------------------\n\n$ans = 0;\n\n$dd = array_unique($d);\n$ans = count($dd);\n\n\n\n//----------------------------------------------------------------------------------\n// Output\n//----------------------------------------------------------------------------------\nout::println($ans);\n\n\n\n//----------------------------------------------------------------------------------\n// Ref: https://qiita.com/yoshikyoto/items/6924478283dbdd549e4b\n//----------------------------------------------------------------------------------\nclass Scanner {\n private $arr = array();\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n?>\n", "language": "PHP", "metadata": {"date": 1553836881, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03470.html", "problem_id": "p03470", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03470/input.txt", "sample_output_relpath": "derived/input_output/data/p03470/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03470/PHP/s051638968.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s051638968", "user_id": "u383939040"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "nextInt();\n $d = array();\n for ($i = 0; $i < $n; $i++) {\n $d[] = $sc->nextInt();\n }\n\n\n\n} else {\n //----------------------------------------------------------------------------------\n // Input for test\n //----------------------------------------------------------------------------------\n error_reporting(E_ERROR | E_WARNING | E_PARSE);\n\n $n = 7;\n $d = array(50,30,50,100,50,80,30);\n\n\n\n}\n//----------------------------------------------------------------------------------\n// Main\n//----------------------------------------------------------------------------------\n\n$ans = 0;\n\n$dd = array_unique($d);\n$ans = count($dd);\n\n\n\n//----------------------------------------------------------------------------------\n// Output\n//----------------------------------------------------------------------------------\nout::println($ans);\n\n\n\n//----------------------------------------------------------------------------------\n// Ref: https://qiita.com/yoshikyoto/items/6924478283dbdd549e4b\n//----------------------------------------------------------------------------------\nclass Scanner {\n private $arr = array();\n private $count = 0;\n private $pointer = 0;\n public function next() {\n if($this->pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n?>\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "sample_input": "4\n10\n8\n8\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03470", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2041, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s648715409", "group_id": "codeNet:p03473", "input_text": " $C + $D) {\n echo 'Left';\n} elseif ($A + $B < $C + $D) {\n echo 'Right';\n} else {\n echo 'Balanced';\n}\n\n\necho PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1598738230, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03477.html", "problem_id": "p03477", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03477/input.txt", "sample_output_relpath": "derived/input_output/data/p03477/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03477/PHP/s188807631.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s188807631", "user_id": "u825925638"}, "prompt_components": {"gold_output": "Left\n", "input_to_evaluate": " $C + $D) {\n echo 'Left';\n} elseif ($A + $B < $C + $D) {\n echo 'Right';\n} else {\n echo 'Balanced';\n}\n\n\necho PHP_EOL;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "sample_input": "3 8 7 1\n"}, "reference_outputs": ["Left\n"], "source_document_id": "p03477", "source_text": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 193, "cpu_time_ms": 22, "memory_kb": 16148}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s618386336", "group_id": "codeNet:p03477", "input_text": " $c + $d) exit('Left');\nif ($a + $b === $c + $d) exit('Balanced');\necho 'Right';\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "language": "PHP", "metadata": {"date": 1591823132, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03477.html", "problem_id": "p03477", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03477/input.txt", "sample_output_relpath": "derived/input_output/data/p03477/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03477/PHP/s618386336.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s618386336", "user_id": "u055687468"}, "prompt_components": {"gold_output": "Left\n", "input_to_evaluate": " $c + $d) exit('Left');\nif ($a + $b === $c + $d) exit('Balanced');\necho 'Right';\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "sample_input": "3 8 7 1\n"}, "reference_outputs": ["Left\n"], "source_document_id": "p03477", "source_text": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 217, "cpu_time_ms": 12, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s802344119", "group_id": "codeNet:p03477", "input_text": " $rightWeight:\n echo 'Left';\n break;\n\n case $leftWeight < $rightWeight:\n echo 'Right';\n break;\n\n case $leftWeight === $rightWeight:\n echo 'Balanced';\n break;\n }\n \n ?>", "language": "PHP", "metadata": {"date": 1576071687, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03477.html", "problem_id": "p03477", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03477/input.txt", "sample_output_relpath": "derived/input_output/data/p03477/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03477/PHP/s802344119.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s802344119", "user_id": "u723414064"}, "prompt_components": {"gold_output": "Left\n", "input_to_evaluate": " $rightWeight:\n echo 'Left';\n break;\n\n case $leftWeight < $rightWeight:\n echo 'Right';\n break;\n\n case $leftWeight === $rightWeight:\n echo 'Balanced';\n break;\n }\n \n ?>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "sample_input": "3 8 7 1\n"}, "reference_outputs": ["Left\n"], "source_document_id": "p03477", "source_text": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 366, "cpu_time_ms": 12, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s971180589", "group_id": "codeNet:p03477", "input_text": " $right )\n{\n echo \"Left\".\"\\n\";\n}\nelseif ( $left < $right )\n{\n echo \"Right\".\"\\n\";\n}\nelse\n{\n echo \"Balanced\".\"\\n\";\n}\n?>\n", "language": "PHP", "metadata": {"date": 1514081623, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03477.html", "problem_id": "p03477", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03477/input.txt", "sample_output_relpath": "derived/input_output/data/p03477/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03477/PHP/s971180589.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s971180589", "user_id": "u271445511"}, "prompt_components": {"gold_output": "Left\n", "input_to_evaluate": " $right )\n{\n echo \"Left\".\"\\n\";\n}\nelseif ( $left < $right )\n{\n echo \"Right\".\"\\n\";\n}\nelse\n{\n echo \"Balanced\".\"\\n\";\n}\n?>\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "sample_input": "3 8 7 1\n"}, "reference_outputs": ["Left\n"], "source_document_id": "p03477", "source_text": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 11, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s141359649", "group_id": "codeNet:p03479", "input_text": "", "language": "PHP", "metadata": {"date": 1589583847, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03479.html", "problem_id": "p03479", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03479/input.txt", "sample_output_relpath": "derived/input_output/data/p03479/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03479/PHP/s141359649.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s141359649", "user_id": "u094155508"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence.\nThe sequence A needs to satisfy the conditions below:\n\nA consists of integers between X and Y (inclusive).\n\nFor each 1\\leq i \\leq |A|-1, A_{i+1} is a multiple of A_i and strictly greater than A_i.\n\nFind the maximum possible length of the sequence.\n\nConstraints\n\n1 \\leq X \\leq Y \\leq 10^{18}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the maximum possible length of the sequence.\n\nSample Input 1\n\n3 20\n\nSample Output 1\n\n3\n\nThe sequence 3,6,18 satisfies the conditions.\n\nSample Input 2\n\n25 100\n\nSample Output 2\n\n3\n\nSample Input 3\n\n314159265 358979323846264338\n\nSample Output 3\n\n31", "sample_input": "3 20\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03479", "source_text": "Score : 300 points\n\nProblem Statement\n\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence.\nThe sequence A needs to satisfy the conditions below:\n\nA consists of integers between X and Y (inclusive).\n\nFor each 1\\leq i \\leq |A|-1, A_{i+1} is a multiple of A_i and strictly greater than A_i.\n\nFind the maximum possible length of the sequence.\n\nConstraints\n\n1 \\leq X \\leq Y \\leq 10^{18}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the maximum possible length of the sequence.\n\nSample Input 1\n\n3 20\n\nSample Output 1\n\n3\n\nThe sequence 3,6,18 satisfies the conditions.\n\nSample Input 2\n\n25 100\n\nSample Output 2\n\n3\n\nSample Input 3\n\n314159265 358979323846264338\n\nSample Output 3\n\n31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 126, "cpu_time_ms": 9, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s460316334", "group_id": "codeNet:p03481", "input_text": "", "language": "PHP", "metadata": {"date": 1582853112, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03485.html", "problem_id": "p03485", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03485/input.txt", "sample_output_relpath": "derived/input_output/data/p03485/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03485/PHP/s511621220.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s511621220", "user_id": "u371132735"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two positive integers a and b.\nLet x be the average of a and b.\nPrint x rounded up to the nearest integer.\n\nConstraints\n\na and b are integers.\n\n1 \\leq a, b \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint x rounded up to the nearest integer.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n2\n\nThe average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.\n\nSample Input 2\n\n7 4\n\nSample Output 2\n\n6\n\nThe average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n5", "sample_input": "1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03485", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two positive integers a and b.\nLet x be the average of a and b.\nPrint x rounded up to the nearest integer.\n\nConstraints\n\na and b are integers.\n\n1 \\leq a, b \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint x rounded up to the nearest integer.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n2\n\nThe average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.\n\nSample Input 2\n\n7 4\n\nSample Output 2\n\n6\n\nThe average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 99, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s341852092", "group_id": "codeNet:p03486", "input_text": " end($stringParts2)) {\n echo('No');\n exit();\n} elseif ($stringParts1[0] === end($stringParts2)) {\n if ($count_post1 === 1 && $count_post2 === 1 && $count_pre1 < $count_pre2) {\n echo('Yes');\n } else {\n echo('No');\n }\n exit();\n} else {\n echo('Yes');\n}", "language": "PHP", "metadata": {"date": 1561164953, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03486.html", "problem_id": "p03486", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03486/input.txt", "sample_output_relpath": "derived/input_output/data/p03486/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03486/PHP/s506005684.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s506005684", "user_id": "u753079666"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " end($stringParts2)) {\n echo('No');\n exit();\n} elseif ($stringParts1[0] === end($stringParts2)) {\n if ($count_post1 === 1 && $count_post2 === 1 && $count_pre1 < $count_pre2) {\n echo('Yes');\n } else {\n echo('No');\n }\n exit();\n} else {\n echo('Yes');\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given strings s and t, consisting of lowercase English letters.\nYou will create a string s' by freely rearranging the characters in s.\nYou will also create a string t' by freely rearranging the characters in t.\nDetermine whether it is possible to satisfy s' < t' for the lexicographic order.\n\nNotes\n\nFor a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:\n\nN < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.\n\nThere exists i (1 \\leq i \\leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.\n\nFor example, xy < xya and atcoder < atlas.\n\nConstraints\n\nThe lengths of s and t are between 1 and 100 (inclusive).\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf it is possible to satisfy s' < t', print Yes; if it is not, print No.\n\nSample Input 1\n\nyx\naxy\n\nSample Output 1\n\nYes\n\nWe can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.\n\nSample Input 2\n\nratcode\natlas\n\nSample Output 2\n\nYes\n\nWe can, for example, rearrange ratcode into acdeort and atlas into tslaa. Then, acdeort < tslaa.\n\nSample Input 3\n\ncd\nabc\n\nSample Output 3\n\nNo\n\nNo matter how we rearrange cd and abc, we cannot achieve our objective.\n\nSample Input 4\n\nw\nww\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nzzz\nzzz\n\nSample Output 5\n\nNo", "sample_input": "yx\naxy\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03486", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given strings s and t, consisting of lowercase English letters.\nYou will create a string s' by freely rearranging the characters in s.\nYou will also create a string t' by freely rearranging the characters in t.\nDetermine whether it is possible to satisfy s' < t' for the lexicographic order.\n\nNotes\n\nFor a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:\n\nN < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.\n\nThere exists i (1 \\leq i \\leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.\n\nFor example, xy < xya and atcoder < atlas.\n\nConstraints\n\nThe lengths of s and t are between 1 and 100 (inclusive).\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf it is possible to satisfy s' < t', print Yes; if it is not, print No.\n\nSample Input 1\n\nyx\naxy\n\nSample Output 1\n\nYes\n\nWe can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.\n\nSample Input 2\n\nratcode\natlas\n\nSample Output 2\n\nYes\n\nWe can, for example, rearrange ratcode into acdeort and atlas into tslaa. Then, acdeort < tslaa.\n\nSample Input 3\n\ncd\nabc\n\nSample Output 3\n\nNo\n\nNo matter how we rearrange cd and abc, we cannot achieve our objective.\n\nSample Input 4\n\nw\nww\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nzzz\nzzz\n\nSample Output 5\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 822, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s404090119", "group_id": "codeNet:p03486", "input_text": " $v) {\n\tif ($k == $v) continue;\n\tif ($k < $v) {\n\t\t$x += $v - $k;\n\t} else {\n\t\t$x += $v;\n\t}\n}\necho $x;", "language": "PHP", "metadata": {"date": 1517177130, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03487.html", "problem_id": "p03487", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03487/input.txt", "sample_output_relpath": "derived/input_output/data/p03487/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03487/PHP/s579610525.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s579610525", "user_id": "u705304778"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $v) {\n\tif ($k == $v) continue;\n\tif ($k < $v) {\n\t\t$x += $v - $k;\n\t} else {\n\t\t$x += $v;\n\t}\n}\necho $x;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of positive integers of length N, a = (a_1, a_2, ..., a_N).\nYour objective is to remove some of the elements in a so that a will be a good sequence.\n\nHere, an sequence b is a good sequence when the following condition holds true:\n\nFor each element x in b, the value x occurs exactly x times in b.\n\nFor example, (3, 3, 3), (4, 2, 4, 1, 4, 2, 4) and () (an empty sequence) are good sequences, while (3, 3, 3, 3) and (2, 4, 1, 4, 2) are not.\n\nFind the minimum number of elements that needs to be removed so that a will be a good sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\na_i is an integer.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of elements that needs to be removed so that a will be a good sequence.\n\nSample Input 1\n\n4\n3 3 3 3\n\nSample Output 1\n\n1\n\nWe can, for example, remove one occurrence of 3. Then, (3, 3, 3) is a good sequence.\n\nSample Input 2\n\n5\n2 4 1 4 2\n\nSample Output 2\n\n2\n\nWe can, for example, remove two occurrences of 4. Then, (2, 1, 2) is a good sequence.\n\nSample Input 3\n\n6\n1 2 2 3 3 3\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\n1\n\nRemove one occurrence of 10^9. Then, () is a good sequence.\n\nSample Input 5\n\n8\n2 7 1 8 2 8 1 8\n\nSample Output 5\n\n5", "sample_input": "4\n3 3 3 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03487", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of positive integers of length N, a = (a_1, a_2, ..., a_N).\nYour objective is to remove some of the elements in a so that a will be a good sequence.\n\nHere, an sequence b is a good sequence when the following condition holds true:\n\nFor each element x in b, the value x occurs exactly x times in b.\n\nFor example, (3, 3, 3), (4, 2, 4, 1, 4, 2, 4) and () (an empty sequence) are good sequences, while (3, 3, 3, 3) and (2, 4, 1, 4, 2) are not.\n\nFind the minimum number of elements that needs to be removed so that a will be a good sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\na_i is an integer.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of elements that needs to be removed so that a will be a good sequence.\n\nSample Input 1\n\n4\n3 3 3 3\n\nSample Output 1\n\n1\n\nWe can, for example, remove one occurrence of 3. Then, (3, 3, 3) is a good sequence.\n\nSample Input 2\n\n5\n2 4 1 4 2\n\nSample Output 2\n\n2\n\nWe can, for example, remove two occurrences of 4. Then, (2, 1, 2) is a good sequence.\n\nSample Input 3\n\n6\n1 2 2 3 3 3\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\n1\n\nRemove one occurrence of 10^9. Then, () is a good sequence.\n\nSample Input 5\n\n8\n2 7 1 8 2 8 1 8\n\nSample Output 5\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 227, "cpu_time_ms": 25, "memory_kb": 19188}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s360670440", "group_id": "codeNet:p03488", "input_text": "x = 0;\n$pos->y = 0;\n$dir = 1;\n\n$ret = move(0,1,$pos);\nif ($ret==1) {\n printf(\"Yes\\n\");\n}\nelse {\n printf(\"No\\n\");\n}\nfunction move($cmdpos,$dir,$pos) {\n global $s,$len,$x,$y;\n //if (abs($pos->x) > 100 || abs($pos->y)>100) exit;\n if ($cmdpos == $len) {\n if ($x==$pos->x && $y == $pos->y) {\n return 1;\n }\n else {\n return 0;\n }\n }\n //printf(\"%d %s dir %s pos %d %d\\n\",$cmdpos,$s[$cmdpos],getdirStr($dir),$pos->x,$pos->y);\n if ($s[$cmdpos] == 'F') {\n $pos = updatepos($dir,$pos);\n $cmdpos++;\n $ret = move($cmdpos,$dir,$pos);\n }\n else {\n $cmdpos++;\n switch($dir) {\n case 1:\n $ret = max(move($cmdpos,4,$pos),move($cmdpos,2,$pos));\n break;\n case 2:\n $ret = max(move($cmdpos,1,$pos),move($cmdpos,3,$pos));\n break;\n case 3:\n $ret = max(move($cmdpos,2,$pos),move($cmdpos,4,$pos));\n break;\n case 4:\n $ret = max(move($cmdpos,3,$pos),move($cmdpos,1,$pos));\n break;\n }\n }\n return $ret;\n}\n\nfunction updatepos($dir,$p) {\n $pos = clone($p);\n switch($dir) {\n case 1:\n $pos->x += 1;\n break;\n case 2:\n $pos->y -= 1;\n break;\n case 3:\n $pos->x -= 1;\n break;\n case 4:\n $pos->y += 1;\n break;\n }\n return $pos;\n}\nfunction getdirStr($dir) {\n switch($dir) {\n case 1:return 'L';break;\n case 2:return 'D';break;\n case 3:return 'R';break;\n case 4:return 'U';break;\n }\n}\n", "language": "PHP", "metadata": {"date": 1513528470, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03488.html", "problem_id": "p03488", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03488/input.txt", "sample_output_relpath": "derived/input_output/data/p03488/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03488/PHP/s360670440.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s360670440", "user_id": "u278278558"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "x = 0;\n$pos->y = 0;\n$dir = 1;\n\n$ret = move(0,1,$pos);\nif ($ret==1) {\n printf(\"Yes\\n\");\n}\nelse {\n printf(\"No\\n\");\n}\nfunction move($cmdpos,$dir,$pos) {\n global $s,$len,$x,$y;\n //if (abs($pos->x) > 100 || abs($pos->y)>100) exit;\n if ($cmdpos == $len) {\n if ($x==$pos->x && $y == $pos->y) {\n return 1;\n }\n else {\n return 0;\n }\n }\n //printf(\"%d %s dir %s pos %d %d\\n\",$cmdpos,$s[$cmdpos],getdirStr($dir),$pos->x,$pos->y);\n if ($s[$cmdpos] == 'F') {\n $pos = updatepos($dir,$pos);\n $cmdpos++;\n $ret = move($cmdpos,$dir,$pos);\n }\n else {\n $cmdpos++;\n switch($dir) {\n case 1:\n $ret = max(move($cmdpos,4,$pos),move($cmdpos,2,$pos));\n break;\n case 2:\n $ret = max(move($cmdpos,1,$pos),move($cmdpos,3,$pos));\n break;\n case 3:\n $ret = max(move($cmdpos,2,$pos),move($cmdpos,4,$pos));\n break;\n case 4:\n $ret = max(move($cmdpos,3,$pos),move($cmdpos,1,$pos));\n break;\n }\n }\n return $ret;\n}\n\nfunction updatepos($dir,$p) {\n $pos = clone($p);\n switch($dir) {\n case 1:\n $pos->x += 1;\n break;\n case 2:\n $pos->y -= 1;\n break;\n case 3:\n $pos->x -= 1;\n break;\n case 4:\n $pos->y += 1;\n break;\n }\n return $pos;\n}\nfunction getdirStr($dir) {\n switch($dir) {\n case 1:return 'L';break;\n case 2:return 'D';break;\n case 3:return 'R';break;\n case 4:return 'U';break;\n }\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "sample_input": "FTFFTFFF\n4 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03488", "source_text": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1566, "cpu_time_ms": 2105, "memory_kb": 24084}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s574237040", "group_id": "codeNet:p03490", "input_text": " 0) {\n if($is_dir_x) {\n $group_x[] = $count;\n } else {\n $group_y[] = $count;\n }\n $count = 0;\n }\n $is_dir_x = !$is_dir_x;\n } else {\n $count++;\n }\n}\nif($count > 0) {\n if($is_dir_x) {\n $group_x[] = $count;\n } else {\n $group_y[] = $count;\n }\n $count = 0;\n}\n\n$set_x = array();\n$set_x[$initial_x] = TRUE;\nforeach($group_x as $gx) {\n foreach($set_x as $key => $value) {\n if(!isset($set_x[$key + $gx])) {\n $set_x[$key + $gx] = TRUE;\n }\n if(!isset($set_x[$key - $gx])) {\n $set_x[$key - $gx] = TRUE;\n }\n }\n}\n\n$set_y = array();\n$set_y[0] = TRUE;\nforeach($group_y as $gy) {\n foreach($set_y as $key => $value) {\n if(!isset($set_y[$key + $gy])) {\n $set_y[$key + $gy] = TRUE;\n }\n if(!isset($set_y[$key - $gy])) {\n $set_y[$key - $gy] = TRUE;\n }\n }\n}\n\nif(isset($set_x[$x]) && isset($set_y[$y])) {\n echo 'Yes'.PHP_EOL;\n} else {\n echo 'No'.PHP_EOL;\n}\n\n?>", "language": "PHP", "metadata": {"date": 1513479731, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03490.html", "problem_id": "p03490", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03490/input.txt", "sample_output_relpath": "derived/input_output/data/p03490/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03490/PHP/s574237040.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s574237040", "user_id": "u617888512"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " 0) {\n if($is_dir_x) {\n $group_x[] = $count;\n } else {\n $group_y[] = $count;\n }\n $count = 0;\n }\n $is_dir_x = !$is_dir_x;\n } else {\n $count++;\n }\n}\nif($count > 0) {\n if($is_dir_x) {\n $group_x[] = $count;\n } else {\n $group_y[] = $count;\n }\n $count = 0;\n}\n\n$set_x = array();\n$set_x[$initial_x] = TRUE;\nforeach($group_x as $gx) {\n foreach($set_x as $key => $value) {\n if(!isset($set_x[$key + $gx])) {\n $set_x[$key + $gx] = TRUE;\n }\n if(!isset($set_x[$key - $gx])) {\n $set_x[$key - $gx] = TRUE;\n }\n }\n}\n\n$set_y = array();\n$set_y[0] = TRUE;\nforeach($group_y as $gy) {\n foreach($set_y as $key => $value) {\n if(!isset($set_y[$key + $gy])) {\n $set_y[$key + $gy] = TRUE;\n }\n if(!isset($set_y[$key - $gy])) {\n $set_y[$key - $gy] = TRUE;\n }\n }\n}\n\nif(isset($set_x[$x]) && isset($set_y[$y])) {\n echo 'Yes'.PHP_EOL;\n} else {\n echo 'No'.PHP_EOL;\n}\n\n?>", "problem_context": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "sample_input": "FTFFTFFF\n4 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03490", "source_text": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1261, "cpu_time_ms": 1379, "memory_kb": 7012}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s011832560", "group_id": "codeNet:p03494", "input_text": "$ary[$i+1]) return false;\n }\n return true;\n}\nfunction herasu($A,$N,$low,$lowkey) {\n global $sousa;\n $i=0;\n while(1) {\n if ($A[$i]>$A[$i+1]) {\n $sousa[]=sprintf(\"%d %d\",$lowkey+1 , $i + 1);\n $A[$i]+=$low;\n if ($A[$i]<$low) {\n $low = $A[$i];\n $lowkey = $i;\n }\n }\n else {\n $i++;\n }\n if ($i==$N-1) break;\n }\n return $A;\n}\nfunction fuyasu($A,$N,$high,$highkey) {\n global $sousa;\n$i=0;\nwhile(1) {\n if ($A[$i]>$A[$i+1]) {\n $sousa[]=sprintf(\"%d %d\",$highkey+1 , $i + 2);\n $A[$i+1]+=$high;\n if ($A[$i+1]>$high) {\n $high = $A[$i+1];\n $highkey = $i+1;\n }\n }\n else {\n $i++;\n }\n if ($i==$N-1) break;\n}\nreturn $A;\n}\n", "language": "PHP", "metadata": {"date": 1512962326, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03496.html", "problem_id": "p03496", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03496/input.txt", "sample_output_relpath": "derived/input_output/data/p03496/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03496/PHP/s674633435.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s674633435", "user_id": "u278278558"}, "prompt_components": {"gold_output": "2\n2 3\n3 3\n", "input_to_evaluate": "$ary[$i+1]) return false;\n }\n return true;\n}\nfunction herasu($A,$N,$low,$lowkey) {\n global $sousa;\n $i=0;\n while(1) {\n if ($A[$i]>$A[$i+1]) {\n $sousa[]=sprintf(\"%d %d\",$lowkey+1 , $i + 1);\n $A[$i]+=$low;\n if ($A[$i]<$low) {\n $low = $A[$i];\n $lowkey = $i;\n }\n }\n else {\n $i++;\n }\n if ($i==$N-1) break;\n }\n return $A;\n}\nfunction fuyasu($A,$N,$high,$highkey) {\n global $sousa;\n$i=0;\nwhile(1) {\n if ($A[$i]>$A[$i+1]) {\n $sousa[]=sprintf(\"%d %d\",$highkey+1 , $i + 2);\n $A[$i+1]+=$high;\n if ($A[$i+1]>$high) {\n $high = $A[$i+1];\n $highkey = $i+1;\n }\n }\n else {\n $i++;\n }\n if ($i==$N-1) break;\n}\nreturn $A;\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke has an integer sequence, a, of length N. The i-th element of a (1-indexed) is a_{i}.\n\nHe can perform the following operation any number of times:\n\nOperation: Choose integers x and y between 1 and N (inclusive), and add a_x to a_y.\n\nHe would like to perform this operation between 0 and 2N times (inclusive) so that a satisfies the condition below. Show one such sequence of operations.\nIt can be proved that such a sequence of operations always exists under the constraints in this problem.\n\nCondition: a_1 \\leq a_2 \\leq ... \\leq a_{N}\n\nConstraints\n\n2 \\leq N \\leq 50\n\n-10^{6} \\leq a_i \\leq 10^{6}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nLet m be the number of operations in your solution. In the first line, print m.\nIn the i-th of the subsequent m lines, print the numbers x and y chosen in the i-th operation, with a space in between.\nThe output will be considered correct if m is between 0 and 2N (inclusive) and a satisfies the condition after the m operations.\n\nSample Input 1\n\n3\n-2 5 -1\n\nSample Output 1\n\n2\n2 3\n3 3\n\nAfter the first operation, a = (-2,5,4).\n\nAfter the second operation, a = (-2,5,8), and the condition is now satisfied.\n\nSample Input 2\n\n2\n-1 -3\n\nSample Output 2\n\n1\n2 1\n\nAfter the first operation, a = (-4,-3) and the condition is now satisfied.\n\nSample Input 3\n\n5\n0 0 0 0 0\n\nSample Output 3\n\n0\n\nThe condition is satisfied already in the beginning.", "sample_input": "3\n-2 5 -1\n"}, "reference_outputs": ["2\n2 3\n3 3\n"], "source_document_id": "p03496", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke has an integer sequence, a, of length N. The i-th element of a (1-indexed) is a_{i}.\n\nHe can perform the following operation any number of times:\n\nOperation: Choose integers x and y between 1 and N (inclusive), and add a_x to a_y.\n\nHe would like to perform this operation between 0 and 2N times (inclusive) so that a satisfies the condition below. Show one such sequence of operations.\nIt can be proved that such a sequence of operations always exists under the constraints in this problem.\n\nCondition: a_1 \\leq a_2 \\leq ... \\leq a_{N}\n\nConstraints\n\n2 \\leq N \\leq 50\n\n-10^{6} \\leq a_i \\leq 10^{6}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nLet m be the number of operations in your solution. In the first line, print m.\nIn the i-th of the subsequent m lines, print the numbers x and y chosen in the i-th operation, with a space in between.\nThe output will be considered correct if m is between 0 and 2N (inclusive) and a satisfies the condition after the m operations.\n\nSample Input 1\n\n3\n-2 5 -1\n\nSample Output 1\n\n2\n2 3\n3 3\n\nAfter the first operation, a = (-2,5,4).\n\nAfter the second operation, a = (-2,5,8), and the condition is now satisfied.\n\nSample Input 2\n\n2\n-1 -3\n\nSample Output 2\n\n1\n2 1\n\nAfter the first operation, a = (-4,-3) and the condition is now satisfied.\n\nSample Input 3\n\n5\n0 0 0 0 0\n\nSample Output 3\n\n0\n\nThe condition is satisfied already in the beginning.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1363, "cpu_time_ms": 2165, "memory_kb": 990196}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s213758429", "group_id": "codeNet:p03497", "input_text": "\n", "language": "PHP", "metadata": {"date": 1512353992, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03502.html", "problem_id": "p03502", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03502/input.txt", "sample_output_relpath": "derived/input_output/data/p03502/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03502/PHP/s747661900.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s747661900", "user_id": "u905324530"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\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.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03502", "source_text": "Score : 200 points\n\nProblem Statement\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.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 174, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s300900475", "group_id": "codeNet:p03503", "input_text": "= 2){\n echo 'Yes';\n }else{\n echo 'No';\n }\n ?>", "language": "PHP", "metadata": {"date": 1576078679, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03543.html", "problem_id": "p03543", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03543/input.txt", "sample_output_relpath": "derived/input_output/data/p03543/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03543/PHP/s011684857.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s011684857", "user_id": "u723414064"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "= 2){\n echo 'Yes';\n }else{\n echo 'No';\n }\n ?>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe call a 4-digit integer with three or more consecutive same digits, such as 1118, good.\n\nYou are given a 4-digit integer N. Answer the question: Is N good?\n\nConstraints\n\n1000 ≤ N ≤ 9999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is good, print Yes; otherwise, print No.\n\nSample Input 1\n\n1118\n\nSample Output 1\n\nYes\n\nN is good, since it contains three consecutive 1.\n\nSample Input 2\n\n7777\n\nSample Output 2\n\nYes\n\nAn integer is also good when all the digits are the same.\n\nSample Input 3\n\n1234\n\nSample Output 3\n\nNo", "sample_input": "1118\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03543", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe call a 4-digit integer with three or more consecutive same digits, such as 1118, good.\n\nYou are given a 4-digit integer N. Answer the question: Is N good?\n\nConstraints\n\n1000 ≤ N ≤ 9999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is good, print Yes; otherwise, print No.\n\nSample Input 1\n\n1118\n\nSample Output 1\n\nYes\n\nN is good, since it contains three consecutive 1.\n\nSample Input 2\n\n7777\n\nSample Output 2\n\nYes\n\nAn integer is also good when all the digits are the same.\n\nSample Input 3\n\n1234\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 293, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s541571546", "group_id": "codeNet:p03543", "input_text": "", "language": "PHP", "metadata": {"date": 1576076441, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03543.html", "problem_id": "p03543", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03543/input.txt", "sample_output_relpath": "derived/input_output/data/p03543/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03543/PHP/s541571546.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s541571546", "user_id": "u723414064"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe call a 4-digit integer with three or more consecutive same digits, such as 1118, good.\n\nYou are given a 4-digit integer N. Answer the question: Is N good?\n\nConstraints\n\n1000 ≤ N ≤ 9999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is good, print Yes; otherwise, print No.\n\nSample Input 1\n\n1118\n\nSample Output 1\n\nYes\n\nN is good, since it contains three consecutive 1.\n\nSample Input 2\n\n7777\n\nSample Output 2\n\nYes\n\nAn integer is also good when all the digits are the same.\n\nSample Input 3\n\n1234\n\nSample Output 3\n\nNo", "sample_input": "1118\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03543", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe call a 4-digit integer with three or more consecutive same digits, such as 1118, good.\n\nYou are given a 4-digit integer N. Answer the question: Is N good?\n\nConstraints\n\n1000 ≤ N ≤ 9999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is good, print Yes; otherwise, print No.\n\nSample Input 1\n\n1118\n\nSample Output 1\n\nYes\n\nN is good, since it contains three consecutive 1.\n\nSample Input 2\n\n7777\n\nSample Output 2\n\nYes\n\nAn integer is also good when all the digits are the same.\n\nSample Input 3\n\n1234\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 238, "cpu_time_ms": 9, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s369131469", "group_id": "codeNet:p03544", "input_text": "", "language": "PHP", "metadata": {"date": 1573073435, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03544.html", "problem_id": "p03544", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03544/input.txt", "sample_output_relpath": "derived/input_output/data/p03544/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03544/PHP/s369131469.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s369131469", "user_id": "u000638779"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.\n\nYou are given an integer N. Find the N-th Lucas number.\n\nHere, the i-th Lucas number L_i is defined as follows:\n\nL_0=2\n\nL_1=1\n\nL_i=L_{i-1}+L_{i-2} (i≥2)\n\nConstraints\n\n1≤N≤86\n\nIt is guaranteed that the answer is less than 10^{18}.\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the N-th Lucas number.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n11\n\nL_0=2\n\nL_1=1\n\nL_2=L_0+L_1=3\n\nL_3=L_1+L_2=4\n\nL_4=L_2+L_3=7\n\nL_5=L_3+L_4=11\n\nThus, the 5-th Lucas number is 11.\n\nSample Input 2\n\n86\n\nSample Output 2\n\n939587134549734843", "sample_input": "5\n"}, "reference_outputs": ["11\n"], "source_document_id": "p03544", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.\n\nYou are given an integer N. Find the N-th Lucas number.\n\nHere, the i-th Lucas number L_i is defined as follows:\n\nL_0=2\n\nL_1=1\n\nL_i=L_{i-1}+L_{i-2} (i≥2)\n\nConstraints\n\n1≤N≤86\n\nIt is guaranteed that the answer is less than 10^{18}.\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the N-th Lucas number.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n11\n\nL_0=2\n\nL_1=1\n\nL_2=L_0+L_1=3\n\nL_3=L_1+L_2=4\n\nL_4=L_2+L_3=7\n\nL_5=L_3+L_4=11\n\nThus, the 5-th Lucas number is 11.\n\nSample Input 2\n\n86\n\nSample Output 2\n\n939587134549734843", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 221, "cpu_time_ms": 12, "memory_kb": 4984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s509892444", "group_id": "codeNet:p03545", "input_text": "", "language": "PHP", "metadata": {"date": 1574221689, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03545.html", "problem_id": "p03545", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03545/input.txt", "sample_output_relpath": "derived/input_output/data/p03545/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03545/PHP/s509892444.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s509892444", "user_id": "u445624660"}, "prompt_components": {"gold_output": "1+2+2+2=7\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "sample_input": "1222\n"}, "reference_outputs": ["1+2+2+2=7\n"], "source_document_id": "p03545", "source_text": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1182, "cpu_time_ms": 20, "memory_kb": 4468}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s521888047", "group_id": "codeNet:p03545", "input_text": "= 0; $j --) {\n // 左シフトした値と比べる\n if (($i & (1 << $j)) === (1 << $j)) {\n $result += $array[$signCount - $j];\n $resultStr .= \"+\" . $array[$signCount - $j];\n } else {\n $result -= $array[$signCount - $j];\n $resultStr .= \"-\" . $array[$signCount - $j];\n }\n }\n if ($result === $sum) {\n echo $resultStr . \"=\" . $sum;\n exit(0);\n }\n}\n", "language": "PHP", "metadata": {"date": 1574084164, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03545.html", "problem_id": "p03545", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03545/input.txt", "sample_output_relpath": "derived/input_output/data/p03545/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03545/PHP/s521888047.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s521888047", "user_id": "u819330049"}, "prompt_components": {"gold_output": "1+2+2+2=7\n", "input_to_evaluate": "= 0; $j --) {\n // 左シフトした値と比べる\n if (($i & (1 << $j)) === (1 << $j)) {\n $result += $array[$signCount - $j];\n $resultStr .= \"+\" . $array[$signCount - $j];\n } else {\n $result -= $array[$signCount - $j];\n $resultStr .= \"-\" . $array[$signCount - $j];\n }\n }\n if ($result === $sum) {\n echo $resultStr . \"=\" . $sum;\n exit(0);\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "sample_input": "1222\n"}, "reference_outputs": ["1+2+2+2=7\n"], "source_document_id": "p03545", "source_text": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1124, "cpu_time_ms": 16, "memory_kb": 4340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s144657333", "group_id": "codeNet:p03545", "input_text": " $k) {\n $num += $k;\n } else {\n $num += $num;\n }\n}\n\necho $num;\n\n?>", "language": "PHP", "metadata": {"date": 1576021285, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03564.html", "problem_id": "p03564", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03564/input.txt", "sample_output_relpath": "derived/input_output/data/p03564/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03564/PHP/s231915271.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s231915271", "user_id": "u397596606"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": " $k) {\n $num += $k;\n } else {\n $num += $num;\n }\n}\n\necho $num;\n\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSquare1001 has seen an electric bulletin board displaying the integer 1.\nHe can perform the following operations A and B to change this value:\n\nOperation A: The displayed value is doubled.\n\nOperation B: The displayed value increases by K.\n\nSquare1001 needs to perform these operations N times in total.\nFind the minimum possible value displayed in the board after N operations.\n\nConstraints\n\n1 \\leq N, K \\leq 10\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the minimum possible value displayed in the board after N operations.\n\nSample Input 1\n\n4\n3\n\nSample Output 1\n\n10\n\nThe value will be minimized when the operations are performed in the following order: A, A, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 7 → 10.\n\nSample Input 2\n\n10\n10\n\nSample Output 2\n\n76\n\nThe value will be minimized when the operations are performed in the following order: A, A, A, A, B, B, B, B, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 8 → 16 → 26 → 36 → 46 → 56 → 66 → 76.\n\nBy the way, this contest is AtCoder Beginner Contest 076.", "sample_input": "4\n3\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03564", "source_text": "Score : 200 points\n\nProblem Statement\n\nSquare1001 has seen an electric bulletin board displaying the integer 1.\nHe can perform the following operations A and B to change this value:\n\nOperation A: The displayed value is doubled.\n\nOperation B: The displayed value increases by K.\n\nSquare1001 needs to perform these operations N times in total.\nFind the minimum possible value displayed in the board after N operations.\n\nConstraints\n\n1 \\leq N, K \\leq 10\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the minimum possible value displayed in the board after N operations.\n\nSample Input 1\n\n4\n3\n\nSample Output 1\n\n10\n\nThe value will be minimized when the operations are performed in the following order: A, A, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 7 → 10.\n\nSample Input 2\n\n10\n10\n\nSample Output 2\n\n76\n\nThe value will be minimized when the operations are performed in the following order: A, A, A, A, B, B, B, B, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 8 → 16 → 26 → 36 → 46 → 56 → 66 → 76.\n\nBy the way, this contest is AtCoder Beginner Contest 076.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 178, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s305495362", "group_id": "codeNet:p03564", "input_text": " $K + $n) {\n $n+=$K;\n }\n else {\n $n=$n*2;\n }\n}\nprintf(\"%d\\n\",$n);\n", "language": "PHP", "metadata": {"date": 1509239849, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03564.html", "problem_id": "p03564", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03564/input.txt", "sample_output_relpath": "derived/input_output/data/p03564/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03564/PHP/s305495362.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s305495362", "user_id": "u278278558"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": " $K + $n) {\n $n+=$K;\n }\n else {\n $n=$n*2;\n }\n}\nprintf(\"%d\\n\",$n);\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSquare1001 has seen an electric bulletin board displaying the integer 1.\nHe can perform the following operations A and B to change this value:\n\nOperation A: The displayed value is doubled.\n\nOperation B: The displayed value increases by K.\n\nSquare1001 needs to perform these operations N times in total.\nFind the minimum possible value displayed in the board after N operations.\n\nConstraints\n\n1 \\leq N, K \\leq 10\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the minimum possible value displayed in the board after N operations.\n\nSample Input 1\n\n4\n3\n\nSample Output 1\n\n10\n\nThe value will be minimized when the operations are performed in the following order: A, A, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 7 → 10.\n\nSample Input 2\n\n10\n10\n\nSample Output 2\n\n76\n\nThe value will be minimized when the operations are performed in the following order: A, A, A, A, B, B, B, B, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 8 → 16 → 26 → 36 → 46 → 56 → 66 → 76.\n\nBy the way, this contest is AtCoder Beginner Contest 076.", "sample_input": "4\n3\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03564", "source_text": "Score : 200 points\n\nProblem Statement\n\nSquare1001 has seen an electric bulletin board displaying the integer 1.\nHe can perform the following operations A and B to change this value:\n\nOperation A: The displayed value is doubled.\n\nOperation B: The displayed value increases by K.\n\nSquare1001 needs to perform these operations N times in total.\nFind the minimum possible value displayed in the board after N operations.\n\nConstraints\n\n1 \\leq N, K \\leq 10\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the minimum possible value displayed in the board after N operations.\n\nSample Input 1\n\n4\n3\n\nSample Output 1\n\n10\n\nThe value will be minimized when the operations are performed in the following order: A, A, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 7 → 10.\n\nSample Input 2\n\n10\n10\n\nSample Output 2\n\n76\n\nThe value will be minimized when the operations are performed in the following order: A, A, A, A, B, B, B, B, B, B.\n\nIn this case, the value will change as follows: 1 → 2 → 4 → 8 → 16 → 26 → 36 → 46 → 56 → 66 → 76.\n\nBy the way, this contest is AtCoder Beginner Contest 076.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 297, "cpu_time_ms": 10, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s591478119", "group_id": "codeNet:p03573", "input_text": " ", "language": "PHP", "metadata": {"date": 1592642865, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03573.html", "problem_id": "p03573", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03573/input.txt", "sample_output_relpath": "derived/input_output/data/p03573/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03573/PHP/s591478119.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s591478119", "user_id": "u878654696"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": " ", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers, A, B and C.\n\nAmong them, two are the same, but the remaining one is different from the rest.\n\nFor example, when A=5,B=7,C=5, A and C are the same, but B is different.\n\nFind the one that is different from the rest among the given three integers.\n\nConstraints\n\n-100 \\leq A,B,C \\leq 100\n\nA, B and C are integers.\n\nThe input satisfies the condition in the statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nAmong A, B and C, print the integer that is different from the rest.\n\nSample Input 1\n\n5 7 5\n\nSample Output 1\n\n7\n\nThis is the same case as the one in the statement.\n\nSample Input 2\n\n1 1 7\n\nSample Output 2\n\n7\n\nIn this case, C is the one we seek.\n\nSample Input 3\n\n-100 100 100\n\nSample Output 3\n\n-100", "sample_input": "5 7 5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03573", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers, A, B and C.\n\nAmong them, two are the same, but the remaining one is different from the rest.\n\nFor example, when A=5,B=7,C=5, A and C are the same, but B is different.\n\nFind the one that is different from the rest among the given three integers.\n\nConstraints\n\n-100 \\leq A,B,C \\leq 100\n\nA, B and C are integers.\n\nThe input satisfies the condition in the statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nAmong A, B and C, print the integer that is different from the rest.\n\nSample Input 1\n\n5 7 5\n\nSample Output 1\n\n7\n\nThis is the same case as the one in the statement.\n\nSample Input 2\n\n1 1 7\n\nSample Output 2\n\n7\n\nIn this case, C is the one we seek.\n\nSample Input 3\n\n-100 100 100\n\nSample Output 3\n\n-100", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 141, "cpu_time_ms": 24, "memory_kb": 16156}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s826176727", "group_id": "codeNet:p03583", "input_text": " 0) {\n echo \"{$h} {$n} {$w}\\n\";\n exit;\n }\n }\n}\n", "language": "PHP", "metadata": {"date": 1506879843, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03583.html", "problem_id": "p03583", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03583/input.txt", "sample_output_relpath": "derived/input_output/data/p03583/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03583/PHP/s826176727.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s826176727", "user_id": "u195912432"}, "prompt_components": {"gold_output": "1 2 2\n", "input_to_evaluate": " 0) {\n echo \"{$h} {$n} {$w}\\n\";\n exit;\n }\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFind a triple of positive integers h, n and w such that 4/N = 1/h + 1/n + 1/w.\n\nIf there are multiple solutions, any of them will be accepted.\n\nConstraints\n\nIt is guaranteed that, for the given integer N, there exists a solution such that h,n,w \\leq 3500.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutputs\n\nPrint a triple of positive integers h, n and w that satisfies the condition, in the following format:\n\nh n w\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1 2 2\n\n4/2 = 1/1 + 1/2 + 1/2.\n\nSample Input 2\n\n3485\n\nSample Output 2\n\n872 1012974 1539173474040\n\nIt is allowed to use an integer exceeding 3500 in a solution.\n\nSample Input 3\n\n4664\n\nSample Output 3\n\n3498 3498 3498", "sample_input": "2\n"}, "reference_outputs": ["1 2 2\n"], "source_document_id": "p03583", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFind a triple of positive integers h, n and w such that 4/N = 1/h + 1/n + 1/w.\n\nIf there are multiple solutions, any of them will be accepted.\n\nConstraints\n\nIt is guaranteed that, for the given integer N, there exists a solution such that h,n,w \\leq 3500.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutputs\n\nPrint a triple of positive integers h, n and w that satisfies the condition, in the following format:\n\nh n w\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1 2 2\n\n4/2 = 1/1 + 1/2 + 1/2.\n\nSample Input 2\n\n3485\n\nSample Output 2\n\n872 1012974 1539173474040\n\nIt is allowed to use an integer exceeding 3500 in a solution.\n\nSample Input 3\n\n4664\n\nSample Output 3\n\n3498 3498 3498", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 421, "cpu_time_ms": 1084, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s424059701", "group_id": "codeNet:p03591", "input_text": " $count){\n if ($count%4 === 1 || $count%4 === 3){\n $chars[$char]--;\n break;\n }\n}\n\n//O(N*group2)\nfor($i=0;$i<$group2;$i++){\n foreach ($chars as $char => $count){\n if ($count%4 === 2){\n $chars[$char] -=2;\n break;\n }\n }\n}\n\n//O(N*group3)\nfor($i=0;$i<$group3;$i++){\n foreach ($chars as $char => $count){\n if ($count%4 === 0){\n $chars[$char]-=4;\n break;\n\n }\n }\n}\n\n$sum = 0;\nforeach($chars as $count){\n $sum += $count;\n}\n\nif ($sum === 0){\n echo 'Yes';\n} else {\n echo 'No';\n}\n\n", "language": "PHP", "metadata": {"date": 1506794762, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03593.html", "problem_id": "p03593", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03593/input.txt", "sample_output_relpath": "derived/input_output/data/p03593/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03593/PHP/s382821182.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s382821182", "user_id": "u208462243"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " $count){\n if ($count%4 === 1 || $count%4 === 3){\n $chars[$char]--;\n break;\n }\n}\n\n//O(N*group2)\nfor($i=0;$i<$group2;$i++){\n foreach ($chars as $char => $count){\n if ($count%4 === 2){\n $chars[$char] -=2;\n break;\n }\n }\n}\n\n//O(N*group3)\nfor($i=0;$i<$group3;$i++){\n foreach ($chars as $char => $count){\n if ($count%4 === 0){\n $chars[$char]-=4;\n break;\n\n }\n }\n}\n\n$sum = 0;\nforeach($chars as $count){\n $sum += $count;\n}\n\nif ($sum === 0){\n echo 'Yes';\n} else {\n echo 'No';\n}\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have an H-by-W matrix.\nLet a_{ij} be the element at the i-th row from the top and j-th column from the left.\nIn this matrix, each a_{ij} is a lowercase English letter.\n\nSnuke is creating another H-by-W matrix, A', by freely rearranging the elements in A.\nHere, he wants to satisfy the following condition:\n\nEvery row and column in A' can be read as a palindrome.\n\nDetermine whether he can create a matrix satisfying the condition.\n\nNote\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are all palindromes, while ab, abab and abcda are not.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\na_{ij} is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11}a_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf Snuke can create a matrix satisfying the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 4\naabb\naabb\naacc\n\nSample Output 1\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nabba\nacca\nabba\n\nSample Input 2\n\n2 2\naa\nbb\n\nSample Output 2\n\nNo\n\nIt is not possible to create a matrix satisfying the condition, no matter how we rearrange the elements in A.\n\nSample Input 3\n\n5 1\nt\nw\ne\ne\nt\n\nSample Output 3\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nt\ne\nw\ne\nt\n\nSample Input 4\n\n2 5\nabxba\nabyba\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n1 1\nz\n\nSample Output 5\n\nYes", "sample_input": "3 4\naabb\naabb\naacc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03593", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have an H-by-W matrix.\nLet a_{ij} be the element at the i-th row from the top and j-th column from the left.\nIn this matrix, each a_{ij} is a lowercase English letter.\n\nSnuke is creating another H-by-W matrix, A', by freely rearranging the elements in A.\nHere, he wants to satisfy the following condition:\n\nEvery row and column in A' can be read as a palindrome.\n\nDetermine whether he can create a matrix satisfying the condition.\n\nNote\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are all palindromes, while ab, abab and abcda are not.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\na_{ij} is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11}a_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf Snuke can create a matrix satisfying the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 4\naabb\naabb\naacc\n\nSample Output 1\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nabba\nacca\nabba\n\nSample Input 2\n\n2 2\naa\nbb\n\nSample Output 2\n\nNo\n\nIt is not possible to create a matrix satisfying the condition, no matter how we rearrange the elements in A.\n\nSample Input 3\n\n5 1\nt\nw\ne\ne\nt\n\nSample Output 3\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nt\ne\nw\ne\nt\n\nSample Input 4\n\n2 5\nabxba\nabyba\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n1 1\nz\n\nSample Output 5\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1010, "cpu_time_ms": 15, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s434379894", "group_id": "codeNet:p03597", "input_text": "\n", "language": "PHP", "metadata": {"date": 1505612503, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03597.html", "problem_id": "p03597", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03597/input.txt", "sample_output_relpath": "derived/input_output/data/p03597/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03597/PHP/s434379894.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s434379894", "user_id": "u956744683"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have an N \\times N square grid.\n\nWe will paint each square in the grid either black or white.\n\nIf we paint exactly A squares white, how many squares will be painted black?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq A \\leq N^2\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutputs\n\nPrint the number of squares that will be painted black.\n\nSample Input 1\n\n3\n4\n\nSample Output 1\n\n5\n\nThere are nine squares in a 3 \\times 3 square grid.\nFour of them will be painted white, so the remaining five squares will be painted black.\n\nSample Input 2\n\n19\n100\n\nSample Output 2\n\n261\n\nSample Input 3\n\n10\n0\n\nSample Output 3\n\n100\n\nAs zero squares will be painted white, all the squares will be painted black.", "sample_input": "3\n4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03597", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have an N \\times N square grid.\n\nWe will paint each square in the grid either black or white.\n\nIf we paint exactly A squares white, how many squares will be painted black?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq A \\leq N^2\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutputs\n\nPrint the number of squares that will be painted black.\n\nSample Input 1\n\n3\n4\n\nSample Output 1\n\n5\n\nThere are nine squares in a 3 \\times 3 square grid.\nFour of them will be painted white, so the remaining five squares will be painted black.\n\nSample Input 2\n\n19\n100\n\nSample Output 2\n\n261\n\nSample Input 3\n\n10\n0\n\nSample Output 3\n\n100\n\nAs zero squares will be painted white, all the squares will be painted black.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 97, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s518149801", "group_id": "codeNet:p03605", "input_text": " $v) {\n if($v) $x++;\n }\n\n echo $x;", "language": "PHP", "metadata": {"date": 1594773501, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03607.html", "problem_id": "p03607", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03607/input.txt", "sample_output_relpath": "derived/input_output/data/p03607/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03607/PHP/s293572072.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s293572072", "user_id": "u800169017"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $v) {\n if($v) $x++;\n }\n\n echo $x;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are playing the following game with Joisino.\n\nInitially, you have a blank sheet of paper.\n\nJoisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.\n\nThen, you are asked a question: How many numbers are written on the sheet now?\n\nThe numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?\n\nConstraints\n\n1≤N≤100000\n\n1≤A_i≤1000000000(=10^9)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint how many numbers will be written on the sheet at the end of the game.\n\nSample Input 1\n\n3\n6\n2\n6\n\nSample Output 1\n\n1\n\nThe game proceeds as follows:\n\n6 is not written on the sheet, so write 6.\n\n2 is not written on the sheet, so write 2.\n\n6 is written on the sheet, so erase 6.\n\nThus, the sheet contains only 2 in the end. The answer is 1.\n\nSample Input 2\n\n4\n2\n5\n5\n2\n\nSample Output 2\n\n0\n\nIt is possible that no number is written on the sheet in the end.\n\nSample Input 3\n\n6\n12\n22\n16\n22\n18\n12\n\nSample Output 3\n\n2", "sample_input": "3\n6\n2\n6\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03607", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are playing the following game with Joisino.\n\nInitially, you have a blank sheet of paper.\n\nJoisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.\n\nThen, you are asked a question: How many numbers are written on the sheet now?\n\nThe numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?\n\nConstraints\n\n1≤N≤100000\n\n1≤A_i≤1000000000(=10^9)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint how many numbers will be written on the sheet at the end of the game.\n\nSample Input 1\n\n3\n6\n2\n6\n\nSample Output 1\n\n1\n\nThe game proceeds as follows:\n\n6 is not written on the sheet, so write 6.\n\n2 is not written on the sheet, so write 2.\n\n6 is written on the sheet, so erase 6.\n\nThus, the sheet contains only 2 in the end. The answer is 1.\n\nSample Input 2\n\n4\n2\n5\n5\n2\n\nSample Output 2\n\n0\n\nIt is possible that no number is written on the sheet in the end.\n\nSample Input 3\n\n6\n12\n22\n16\n22\n18\n12\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 355, "cpu_time_ms": 65, "memory_kb": 23116}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s070750561", "group_id": "codeNet:p03607", "input_text": " $value) {\n if ($value % 2 == 0) { unset($times[$key]); }\n }\n echo count($times) . \"\\n\";\n?>\n", "language": "PHP", "metadata": {"date": 1505118199, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03607.html", "problem_id": "p03607", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03607/input.txt", "sample_output_relpath": "derived/input_output/data/p03607/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03607/PHP/s070750561.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s070750561", "user_id": "u956744683"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $value) {\n if ($value % 2 == 0) { unset($times[$key]); }\n }\n echo count($times) . \"\\n\";\n?>\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are playing the following game with Joisino.\n\nInitially, you have a blank sheet of paper.\n\nJoisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.\n\nThen, you are asked a question: How many numbers are written on the sheet now?\n\nThe numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?\n\nConstraints\n\n1≤N≤100000\n\n1≤A_i≤1000000000(=10^9)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint how many numbers will be written on the sheet at the end of the game.\n\nSample Input 1\n\n3\n6\n2\n6\n\nSample Output 1\n\n1\n\nThe game proceeds as follows:\n\n6 is not written on the sheet, so write 6.\n\n2 is not written on the sheet, so write 2.\n\n6 is written on the sheet, so erase 6.\n\nThus, the sheet contains only 2 in the end. The answer is 1.\n\nSample Input 2\n\n4\n2\n5\n5\n2\n\nSample Output 2\n\n0\n\nIt is possible that no number is written on the sheet in the end.\n\nSample Input 3\n\n6\n12\n22\n16\n22\n18\n12\n\nSample Output 3\n\n2", "sample_input": "3\n6\n2\n6\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03607", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are playing the following game with Joisino.\n\nInitially, you have a blank sheet of paper.\n\nJoisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.\n\nThen, you are asked a question: How many numbers are written on the sheet now?\n\nThe numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?\n\nConstraints\n\n1≤N≤100000\n\n1≤A_i≤1000000000(=10^9)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint how many numbers will be written on the sheet at the end of the game.\n\nSample Input 1\n\n3\n6\n2\n6\n\nSample Output 1\n\n1\n\nThe game proceeds as follows:\n\n6 is not written on the sheet, so write 6.\n\n2 is not written on the sheet, so write 2.\n\n6 is written on the sheet, so erase 6.\n\nThus, the sheet contains only 2 in the end. The answer is 1.\n\nSample Input 2\n\n4\n2\n5\n5\n2\n\nSample Output 2\n\n0\n\nIt is possible that no number is written on the sheet in the end.\n\nSample Input 3\n\n6\n12\n22\n16\n22\n18\n12\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 336, "cpu_time_ms": 132, "memory_kb": 42356}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s979340196", "group_id": "codeNet:p03608", "input_text": " 99999) {\n $valMax = 99999;\n }\n $valMin = $val - 1;\n if ($valMin < 0) {\n $valMin = 0;\n }\n $box[$valMax] = true;\n $box[$valMin] = true;\n \n foreach (array_keys($box) as $value) {\n if (!isset($intRank[$value])) {\n $intRank[$value] = 0;\n }\n $intRank[$value] ++;\n }\n}\n\narsort($intRank);\n$intRank = array_keys($intRank);\n$x = $intRank[0];\n$cnt = 0;\nforeach ($a as $val) {\n $val = intval($val);\n $valMax = $val + 1;\n if ($valMax > 99999) {\n $valMax = 99999;\n }\n $valMin = $val - 1;\n if ($valMin < 0) {\n $valMin = 0;\n }\n if ($val === $x || $valMin === $x || $valMax === $x) {\n $cnt ++;\n }\n}\n\necho $cnt;\n?>\n", "language": "PHP", "metadata": {"date": 1507841759, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03611.html", "problem_id": "p03611", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03611/input.txt", "sample_output_relpath": "derived/input_output/data/p03611/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03611/PHP/s820097340.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s820097340", "user_id": "u225839380"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": " 99999) {\n $valMax = 99999;\n }\n $valMin = $val - 1;\n if ($valMin < 0) {\n $valMin = 0;\n }\n $box[$valMax] = true;\n $box[$valMin] = true;\n \n foreach (array_keys($box) as $value) {\n if (!isset($intRank[$value])) {\n $intRank[$value] = 0;\n }\n $intRank[$value] ++;\n }\n}\n\narsort($intRank);\n$intRank = array_keys($intRank);\n$x = $intRank[0];\n$cnt = 0;\nforeach ($a as $val) {\n $val = intval($val);\n $valMax = $val + 1;\n if ($valMax > 99999) {\n $valMax = 99999;\n }\n $valMin = $val - 1;\n if ($valMin < 0) {\n $valMin = 0;\n }\n if ($val === $x || $valMin === $x || $valMax === $x) {\n $cnt ++;\n }\n}\n\necho $cnt;\n?>\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N, a_1,a_2,...,a_N.\n\nFor each 1≤i≤N, you have three choices: add 1 to a_i, subtract 1 from a_i or do nothing.\n\nAfter these operations, you select an integer X and count the number of i such that a_i=X.\n\nMaximize this count by making optimal choices.\n\nConstraints\n\n1≤N≤10^5\n\n0≤a_i<10^5 (1≤i≤N)\n\na_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 .. a_N\n\nOutput\n\nPrint the maximum possible number of i such that a_i=X.\n\nSample Input 1\n\n7\n3 1 4 1 5 9 2\n\nSample Output 1\n\n4\n\nFor example, turn the sequence into 2,2,3,2,6,9,2 and select X=2 to obtain 4, the maximum possible count.\n\nSample Input 2\n\n10\n0 1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n3\n\nSample Input 3\n\n1\n99999\n\nSample Output 3\n\n1", "sample_input": "7\n3 1 4 1 5 9 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03611", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N, a_1,a_2,...,a_N.\n\nFor each 1≤i≤N, you have three choices: add 1 to a_i, subtract 1 from a_i or do nothing.\n\nAfter these operations, you select an integer X and count the number of i such that a_i=X.\n\nMaximize this count by making optimal choices.\n\nConstraints\n\n1≤N≤10^5\n\n0≤a_i<10^5 (1≤i≤N)\n\na_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 .. a_N\n\nOutput\n\nPrint the maximum possible number of i such that a_i=X.\n\nSample Input 1\n\n7\n3 1 4 1 5 9 2\n\nSample Output 1\n\n4\n\nFor example, turn the sequence into 2,2,3,2,6,9,2 and select X=2 to obtain 4, the maximum possible count.\n\nSample Input 2\n\n10\n0 1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n3\n\nSample Input 3\n\n1\n99999\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 923, "cpu_time_ms": 107, "memory_kb": 20980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s380346166", "group_id": "codeNet:p03612", "input_text": " 1){\n $cnt--;\n $ans += $cnt;\n } else {\n $ans += $cnt;\n }\n }\n }else{\n if($cnt > 1){\n $cnt--;\n $ans += $cnt;\n } else {\n $ans += $cnt;\n }\n $cnt=0;\n }\n }\n echo $ans;", "language": "PHP", "metadata": {"date": 1593039743, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03612.html", "problem_id": "p03612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03612/input.txt", "sample_output_relpath": "derived/input_output/data/p03612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03612/PHP/s380346166.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s380346166", "user_id": "u769447691"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " 1){\n $cnt--;\n $ans += $cnt;\n } else {\n $ans += $cnt;\n }\n }\n }else{\n if($cnt > 1){\n $cnt--;\n $ans += $cnt;\n } else {\n $ans += $cnt;\n }\n $cnt=0;\n }\n }\n echo $ans;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given a permutation p_1,p_2,...,p_N consisting of 1,2,..,N.\nYou can perform the following operation any number of times (possibly zero):\n\nOperation: Swap two adjacent elements in the permutation.\n\nYou want to have p_i ≠ i for all 1≤i≤N.\nFind the minimum required number of operations to achieve this.\n\nConstraints\n\n2≤N≤10^5\n\np_1,p_2,..,p_N is a permutation of 1,2,..,N.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\np_1 p_2 .. p_N\n\nOutput\n\nPrint the minimum required number of operations\n\nSample Input 1\n\n5\n1 4 3 5 2\n\nSample Output 1\n\n2\n\nSwap 1 and 4, then swap 1 and 3. p is now 4,3,1,5,2 and satisfies the condition.\nThis is the minimum possible number, so the answer is 2.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n\nSwapping 1 and 2 satisfies the condition.\n\nSample Input 3\n\n2\n2 1\n\nSample Output 3\n\n0\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n9\n1 2 4 9 5 8 7 3 6\n\nSample Output 4\n\n3", "sample_input": "5\n1 4 3 5 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03612", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given a permutation p_1,p_2,...,p_N consisting of 1,2,..,N.\nYou can perform the following operation any number of times (possibly zero):\n\nOperation: Swap two adjacent elements in the permutation.\n\nYou want to have p_i ≠ i for all 1≤i≤N.\nFind the minimum required number of operations to achieve this.\n\nConstraints\n\n2≤N≤10^5\n\np_1,p_2,..,p_N is a permutation of 1,2,..,N.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\np_1 p_2 .. p_N\n\nOutput\n\nPrint the minimum required number of operations\n\nSample Input 1\n\n5\n1 4 3 5 2\n\nSample Output 1\n\n2\n\nSwap 1 and 4, then swap 1 and 3. p is now 4,3,1,5,2 and satisfies the condition.\nThis is the minimum possible number, so the answer is 2.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n\nSwapping 1 and 2 satisfies the condition.\n\nSample Input 3\n\n2\n2 1\n\nSample Output 3\n\n0\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n9\n1 2 4 9 5 8 7 3 6\n\nSample Output 4\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 562, "cpu_time_ms": 45, "memory_kb": 22428}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s561238980", "group_id": "codeNet:p03612", "input_text": "$c){\n if($c>=4){\n echo $k*$k;\n exit;\n }elseif($c>=2){\n if($x!='' && $y!=''){\n \tbreak;\n }elseif($x==''){\n\t $x = $k;\n }else{\n $y = $k;\n }\n }\n}\n\necho $x*$y;", "language": "PHP", "metadata": {"date": 1591316068, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03625.html", "problem_id": "p03625", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03625/input.txt", "sample_output_relpath": "derived/input_output/data/p03625/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03625/PHP/s282063512.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s282063512", "user_id": "u553494195"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$c){\n if($c>=4){\n echo $k*$k;\n exit;\n }elseif($c>=2){\n if($x!='' && $y!=''){\n \tbreak;\n }elseif($x==''){\n\t $x = $k;\n }else{\n $y = $k;\n }\n }\n}\n\necho $x*$y;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N sticks with negligible thickness.\nThe length of the i-th stick is A_i.\n\nSnuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides.\nFind the maximum possible area of the rectangle.\n\nConstraints\n\n4 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible area of the rectangle.\nIf no rectangle can be formed, print 0.\n\nSample Input 1\n\n6\n3 1 2 4 2 1\n\nSample Output 1\n\n2\n\n1 \\times 2 rectangle can be formed.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n\nNo rectangle can be formed.\n\nSample Input 3\n\n10\n3 3 3 3 4 4 4 5 5 5\n\nSample Output 3\n\n20", "sample_input": "6\n3 1 2 4 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03625", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N sticks with negligible thickness.\nThe length of the i-th stick is A_i.\n\nSnuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides.\nFind the maximum possible area of the rectangle.\n\nConstraints\n\n4 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible area of the rectangle.\nIf no rectangle can be formed, print 0.\n\nSample Input 1\n\n6\n3 1 2 4 2 1\n\nSample Output 1\n\n2\n\n1 \\times 2 rectangle can be formed.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n\nNo rectangle can be formed.\n\nSample Input 3\n\n10\n3 3 3 3 4 4 4 5 5 5\n\nSample Output 3\n\n20", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 395, "cpu_time_ms": 139, "memory_kb": 19188}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s652795115", "group_id": "codeNet:p03626", "input_text": "", "language": "PHP", "metadata": {"date": 1527198069, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03631.html", "problem_id": "p03631", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03631/input.txt", "sample_output_relpath": "derived/input_output/data/p03631/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03631/PHP/s052350049.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s052350049", "user_id": "u661866574"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "sample_input": "575\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03631", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 403, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s663556685", "group_id": "codeNet:p03632", "input_text": "", "language": "PHP", "metadata": {"date": 1527195291, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03632.html", "problem_id": "p03632", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03632/input.txt", "sample_output_relpath": "derived/input_output/data/p03632/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03632/PHP/s663556685.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s663556685", "user_id": "u221744047"}, "prompt_components": {"gold_output": "50\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAlice and Bob are controlling a robot. They each have one switch that controls the robot.\n\nAlice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.\n\nBob started holding down his button C second after the start-up, and released his button D second after the start-up.\n\nFor how many seconds both Alice and Bob were holding down their buttons?\n\nConstraints\n\n0≤A0){\n $k = lcm($ans, $t);\n $ans = $k;\n }else{\n $ans = $t;\n }\n }\n \n echo $ans%1000000000000000007;\n \n function gcd($m, $n){\n if($n > $m) list($m, $n) = array($n, $m);\n \n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n }\n \n//最小公倍数\nfunction lcm($m, $n){\n return $m * $n / gcd($m, $n);\n}", "language": "PHP", "metadata": {"date": 1592347375, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03633.html", "problem_id": "p03633", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03633/input.txt", "sample_output_relpath": "derived/input_output/data/p03633/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03633/PHP/s109792628.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s109792628", "user_id": "u769447691"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "0){\n $k = lcm($ans, $t);\n $ans = $k;\n }else{\n $ans = $t;\n }\n }\n \n echo $ans%1000000000000000007;\n \n function gcd($m, $n){\n if($n > $m) list($m, $n) = array($n, $m);\n \n while($n !== 0){\n $tmp_n = $n;\n $n = $m % $n;\n $m = $tmp_n;\n }\n return $m;\n }\n \n//最小公倍数\nfunction lcm($m, $n){\n return $m * $n / gcd($m, $n);\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds.\n\nInitially, the hand of every clock stands still, pointing directly upward.\n\nNow, Dolphin starts all the clocks simultaneously.\n\nIn how many seconds will the hand of every clock point directly upward again?\n\nConstraints\n\n1≤N≤100\n\n1≤T_i≤10^{18}\n\nAll input values are integers.\n\nThe correct answer is at most 10^{18} seconds.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT_1\n:\nT_N\n\nOutput\n\nPrint the number of seconds after which the hand of every clock point directly upward again.\n\nSample Input 1\n\n2\n2\n3\n\nSample Output 1\n\n6\n\nWe have two clocks. The time when the hand of each clock points upward is as follows:\n\nClock 1: 2, 4, 6, ... seconds after the beginning\n\nClock 2: 3, 6, 9, ... seconds after the beginning\n\nTherefore, it takes 6 seconds until the hands of both clocks point directly upward.\n\nSample Input 2\n\n5\n2\n5\n10\n1000000000000000000\n1000000000000000000\n\nSample Output 2\n\n1000000000000000000", "sample_input": "2\n2\n3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03633", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds.\n\nInitially, the hand of every clock stands still, pointing directly upward.\n\nNow, Dolphin starts all the clocks simultaneously.\n\nIn how many seconds will the hand of every clock point directly upward again?\n\nConstraints\n\n1≤N≤100\n\n1≤T_i≤10^{18}\n\nAll input values are integers.\n\nThe correct answer is at most 10^{18} seconds.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT_1\n:\nT_N\n\nOutput\n\nPrint the number of seconds after which the hand of every clock point directly upward again.\n\nSample Input 1\n\n2\n2\n3\n\nSample Output 1\n\n6\n\nWe have two clocks. The time when the hand of each clock points upward is as follows:\n\nClock 1: 2, 4, 6, ... seconds after the beginning\n\nClock 2: 3, 6, 9, ... seconds after the beginning\n\nTherefore, it takes 6 seconds until the hands of both clocks point directly upward.\n\nSample Input 2\n\n5\n2\n5\n10\n1000000000000000000\n1000000000000000000\n\nSample Output 2\n\n1000000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 505, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s225672170", "group_id": "codeNet:p03633", "input_text": " 0) $ans = (int) lcm($ans, $t);\n else $ans = $t;\n\n if ($ans === 10 ** 18) break;\n}\necho $ans;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n\n// 最大公約数(2つ)\nfunction gcd($m, $n)\n{\n if (!$n) return $m;\n return gcd($n, $m % $n);\n}\n\n// 最大公約数(3つ以上)\nfunction gcdAll($arr)\n{\n $gcd = array_pop($arr);\n foreach ($arr as $a) {\n $gcd = gcd($gcd, $a);\n }\n return $gcd;\n}\n\n// 最小公倍数(2つ)\nfunction lcm($m, $n)\n{\n return $m * $n / gcd($m, $n);\n}\n\n// 最小公倍数(3つ以上)\nfunction lcmAll($arr)\n{\n $lcm = array_pop($arr);\n foreach ($arr as $a) {\n $lcm = lcm($lcm, $a);\n }\n return $lcm;\n}\n", "language": "PHP", "metadata": {"date": 1592240067, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03633.html", "problem_id": "p03633", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03633/input.txt", "sample_output_relpath": "derived/input_output/data/p03633/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03633/PHP/s225672170.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s225672170", "user_id": "u055687468"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": " 0) $ans = (int) lcm($ans, $t);\n else $ans = $t;\n\n if ($ans === 10 ** 18) break;\n}\necho $ans;\nfunction ints()\n{\n return array_map('intval', explode(' ', trim(fgets(STDIN))));\n}\n\n// 最大公約数(2つ)\nfunction gcd($m, $n)\n{\n if (!$n) return $m;\n return gcd($n, $m % $n);\n}\n\n// 最大公約数(3つ以上)\nfunction gcdAll($arr)\n{\n $gcd = array_pop($arr);\n foreach ($arr as $a) {\n $gcd = gcd($gcd, $a);\n }\n return $gcd;\n}\n\n// 最小公倍数(2つ)\nfunction lcm($m, $n)\n{\n return $m * $n / gcd($m, $n);\n}\n\n// 最小公倍数(3つ以上)\nfunction lcmAll($arr)\n{\n $lcm = array_pop($arr);\n foreach ($arr as $a) {\n $lcm = lcm($lcm, $a);\n }\n return $lcm;\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds.\n\nInitially, the hand of every clock stands still, pointing directly upward.\n\nNow, Dolphin starts all the clocks simultaneously.\n\nIn how many seconds will the hand of every clock point directly upward again?\n\nConstraints\n\n1≤N≤100\n\n1≤T_i≤10^{18}\n\nAll input values are integers.\n\nThe correct answer is at most 10^{18} seconds.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT_1\n:\nT_N\n\nOutput\n\nPrint the number of seconds after which the hand of every clock point directly upward again.\n\nSample Input 1\n\n2\n2\n3\n\nSample Output 1\n\n6\n\nWe have two clocks. The time when the hand of each clock points upward is as follows:\n\nClock 1: 2, 4, 6, ... seconds after the beginning\n\nClock 2: 3, 6, 9, ... seconds after the beginning\n\nTherefore, it takes 6 seconds until the hands of both clocks point directly upward.\n\nSample Input 2\n\n5\n2\n5\n10\n1000000000000000000\n1000000000000000000\n\nSample Output 2\n\n1000000000000000000", "sample_input": "2\n2\n3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03633", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds.\n\nInitially, the hand of every clock stands still, pointing directly upward.\n\nNow, Dolphin starts all the clocks simultaneously.\n\nIn how many seconds will the hand of every clock point directly upward again?\n\nConstraints\n\n1≤N≤100\n\n1≤T_i≤10^{18}\n\nAll input values are integers.\n\nThe correct answer is at most 10^{18} seconds.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT_1\n:\nT_N\n\nOutput\n\nPrint the number of seconds after which the hand of every clock point directly upward again.\n\nSample Input 1\n\n2\n2\n3\n\nSample Output 1\n\n6\n\nWe have two clocks. The time when the hand of each clock points upward is as follows:\n\nClock 1: 2, 4, 6, ... seconds after the beginning\n\nClock 2: 3, 6, 9, ... seconds after the beginning\n\nTherefore, it takes 6 seconds until the hands of both clocks point directly upward.\n\nSample Input 2\n\n5\n2\n5\n10\n1000000000000000000\n1000000000000000000\n\nSample Output 2\n\n1000000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 813, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s464982452", "group_id": "codeNet:p03633", "input_text": "A = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$x = $key->A[0];\n$y = $key->A[1];\n\nprintf(\"%d\\n\",($x-1)*($y-1));\n", "language": "PHP", "metadata": {"date": 1502068884, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03635.html", "problem_id": "p03635", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03635/input.txt", "sample_output_relpath": "derived/input_output/data/p03635/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03635/PHP/s137731783.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s137731783", "user_id": "u278278558"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "A = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$x = $key->A[0];\n$y = $key->A[1];\n\nprintf(\"%d\\n\",($x-1)*($y-1));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn K-city, there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?\n\nConstraints\n\n2 ≤ n, m ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m\n\nOutput\n\nPrint the number of blocks in K-city.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\n6\n\nThere are six blocks, as shown below:\n\nSample Input 2\n\n2 2\n\nSample Output 2\n\n1\n\nThere are one block, as shown below:", "sample_input": "3 4\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03635", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn K-city, there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?\n\nConstraints\n\n2 ≤ n, m ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m\n\nOutput\n\nPrint the number of blocks in K-city.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\n6\n\nThere are six blocks, as shown below:\n\nSample Input 2\n\n2 2\n\nSample Output 2\n\n1\n\nThere are one block, as shown below:", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 437, "cpu_time_ms": 11, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s546243461", "group_id": "codeNet:p03636", "input_text": "$s = trim(fgets(STDIN));\n\n$start = substr($s, 0, 1);\n$last = substr($s, -1);\n$other = strlen($s) - 2;\n\necho $start.$other.$last;", "language": "PHP", "metadata": {"date": 1502073487, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03636.html", "problem_id": "p03636", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03636/input.txt", "sample_output_relpath": "derived/input_output/data/p03636/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03636/PHP/s546243461.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s546243461", "user_id": "u733362293"}, "prompt_components": {"gold_output": "i18n\n", "input_to_evaluate": "$s = trim(fgets(STDIN));\n\n$start = substr($s, 0, 1);\n$last = substr($s, -1);\n$other = strlen($s) - 2;\n\necho $start.$other.$last;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe word internationalization is sometimes abbreviated to i18n.\nThis comes from the fact that there are 18 letters between the first i and the last n.\n\nYou are given a string s of length at least 3 consisting of lowercase English letters.\nAbbreviate s in the same way.\n\nConstraints\n\n3 ≤ |s| ≤ 100 (|s| denotes the length of s.)\n\ns consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the abbreviation of s.\n\nSample Input 1\n\ninternationalization\n\nSample Output 1\n\ni18n\n\nSample Input 2\n\nsmiles\n\nSample Output 2\n\ns4s\n\nSample Input 3\n\nxyz\n\nSample Output 3\n\nx1z", "sample_input": "internationalization\n"}, "reference_outputs": ["i18n\n"], "source_document_id": "p03636", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe word internationalization is sometimes abbreviated to i18n.\nThis comes from the fact that there are 18 letters between the first i and the last n.\n\nYou are given a string s of length at least 3 consisting of lowercase English letters.\nAbbreviate s in the same way.\n\nConstraints\n\n3 ≤ |s| ≤ 100 (|s| denotes the length of s.)\n\ns consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the abbreviation of s.\n\nSample Input 1\n\ninternationalization\n\nSample Output 1\n\ni18n\n\nSample Input 2\n\nsmiles\n\nSample Output 2\n\ns4s\n\nSample Input 3\n\nxyz\n\nSample Output 3\n\nx1z", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 128, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s589357126", "group_id": "codeNet:p03637", "input_text": " 0) $two--;\n if($n-$two == 1){\n echo \"Yes\";\n exit;\n }\n echo $count >= (int)(($n-$two)/2) ? \"Yes\" : \"No\";", "language": "PHP", "metadata": {"date": 1591056727, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03637.html", "problem_id": "p03637", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03637/input.txt", "sample_output_relpath": "derived/input_output/data/p03637/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03637/PHP/s589357126.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s589357126", "user_id": "u769447691"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " 0) $two--;\n if($n-$two == 1){\n echo \"Yes\";\n exit;\n }\n echo $count >= (int)(($n-$two)/2) ? \"Yes\" : \"No\";", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "sample_input": "3\n1 10 100\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03637", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 376, "cpu_time_ms": 32, "memory_kb": 12792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s153246579", "group_id": "codeNet:p03637", "input_text": " 0 ? 'No' : 'Yes';", "language": "PHP", "metadata": {"date": 1502070945, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03637.html", "problem_id": "p03637", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03637/input.txt", "sample_output_relpath": "derived/input_output/data/p03637/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03637/PHP/s153246579.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s153246579", "user_id": "u705304778"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": " 0 ? 'No' : 'Yes';", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "sample_input": "3\n1 10 100\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03637", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 242, "cpu_time_ms": 28, "memory_kb": 12792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s273170970", "group_id": "codeNet:p03638", "input_text": "= $h || $ans[$y+1][$x]!=0){\n $dir = 1;\n $x++;\n }else{\n $y++;\n }\n }else if($dir == 1){\n if($x+1 >= $w || $ans[$y][$x+1]!=0){\n $dir = 2;\n $y--;\n }else{\n $x++;\n }\n }else if($dir == 2){\n if($y == 0 || $ans[$y-1][$x]!=0){\n $dir = 3;\n $x--;\n }else{\n $y--;\n }\n }else{\n if($x == 0 || $ans[$y][$x-1]!=0){\n $dir = 0;\n $y++;\n }else{\n $x--;\n }\n } \n }\n for($i=0;$i<$h;$i++){\n echo implode(\" \", $ans[$i]);\n echo PHP_EOL;\n }\n", "language": "PHP", "metadata": {"date": 1596820070, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03638.html", "problem_id": "p03638", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03638/input.txt", "sample_output_relpath": "derived/input_output/data/p03638/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03638/PHP/s273170970.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s273170970", "user_id": "u800169017"}, "prompt_components": {"gold_output": "1 1\n2 3\n", "input_to_evaluate": "= $h || $ans[$y+1][$x]!=0){\n $dir = 1;\n $x++;\n }else{\n $y++;\n }\n }else if($dir == 1){\n if($x+1 >= $w || $ans[$y][$x+1]!=0){\n $dir = 2;\n $y--;\n }else{\n $x++;\n }\n }else if($dir == 2){\n if($y == 0 || $ans[$y-1][$x]!=0){\n $dir = 3;\n $x--;\n }else{\n $y--;\n }\n }else{\n if($x == 0 || $ans[$y][$x-1]!=0){\n $dir = 0;\n $y++;\n }else{\n $x--;\n }\n } \n }\n for($i=0;$i<$h;$i++){\n echo implode(\" \", $ans[$i]);\n echo PHP_EOL;\n }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nSnuke is painting these squares in colors 1, 2, ..., N.\nHere, the following conditions should be satisfied:\n\nFor each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.\n\nFor each i (1 ≤ i ≤ N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.\n\nFind a way to paint the squares so that the conditions are satisfied.\nIt can be shown that a solution always exists.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\n1 ≤ N ≤ H W\n\na_i ≥ 1\n\na_1 + a_2 + ... + a_N = H W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint one way to paint the squares that satisfies the conditions.\nOutput in the following format:\n\nc_{1 1} ... c_{1 W}\n:\nc_{H 1} ... c_{H W}\n\nHere, c_{i j} is the color of the square at the i-th row from the top and j-th column from the left.\n\nSample Input 1\n\n2 2\n3\n2 1 1\n\nSample Output 1\n\n1 1\n2 3\n\nBelow is an example of an invalid solution:\n\n1 2\n3 1\n\nThis is because the squares painted in Color 1 are not 4-connected.\n\nSample Input 2\n\n3 5\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 4 4 4 3\n2 5 4 5 3\n2 5 5 5 3\n\nSample Input 3\n\n1 1\n1\n1\n\nSample Output 3\n\n1", "sample_input": "2 2\n3\n2 1 1\n"}, "reference_outputs": ["1 1\n2 3\n"], "source_document_id": "p03638", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nSnuke is painting these squares in colors 1, 2, ..., N.\nHere, the following conditions should be satisfied:\n\nFor each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.\n\nFor each i (1 ≤ i ≤ N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.\n\nFind a way to paint the squares so that the conditions are satisfied.\nIt can be shown that a solution always exists.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\n1 ≤ N ≤ H W\n\na_i ≥ 1\n\na_1 + a_2 + ... + a_N = H W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint one way to paint the squares that satisfies the conditions.\nOutput in the following format:\n\nc_{1 1} ... c_{1 W}\n:\nc_{H 1} ... c_{H W}\n\nHere, c_{i j} is the color of the square at the i-th row from the top and j-th column from the left.\n\nSample Input 1\n\n2 2\n3\n2 1 1\n\nSample Output 1\n\n1 1\n2 3\n\nBelow is an example of an invalid solution:\n\n1 2\n3 1\n\nThis is because the squares painted in Color 1 are not 4-connected.\n\nSample Input 2\n\n3 5\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 4 4 4 3\n2 5 4 5 3\n2 5 5 5 3\n\nSample Input 3\n\n1 1\n1\n1\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1153, "cpu_time_ms": 30, "memory_kb": 17020}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s915483707", "group_id": "codeNet:p03638", "input_text": "A = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$H = $key->A[0];\n$W = $key->A[1];\n$N = $key->X[0][0];\n$a=array();\nforeach($key->X[1] as $v) {\n $a[]=$v;\n}\n$pos=0;\n$line=array();\nfor($y=0;$y<$H;$y++) {\n $line[$y]=array();\n for($x=0;$x<$W;$x++) {\n $c = getColor($pos,$a);\n if ($c !== false) {\n $pos++;\n $line[$y][]=$c;\n }\n }\n if ($y%2==1) $line[$y]=array_reverse($line[$y]);\n}\nforeach($line as $l) {\n $ll=\"\";\n foreach($l as $v) {\n if ($ll!=\"\") $ll .= \" \";\n $ll.=$v;\n }\n printf(\"%s\\n\",$ll);\n}\n\nfunction getColor($pos,$col) {\n $chk=0;\n foreach($col as $k=>$c) {\n if ($chk <= $pos && $pos < $chk+$c) {\n return $k+1;\n }\n $chk+=$c;\n }\n return false;\n}\n", "language": "PHP", "metadata": {"date": 1502158461, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03638.html", "problem_id": "p03638", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03638/input.txt", "sample_output_relpath": "derived/input_output/data/p03638/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03638/PHP/s915483707.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s915483707", "user_id": "u278278558"}, "prompt_components": {"gold_output": "1 1\n2 3\n", "input_to_evaluate": "A = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$H = $key->A[0];\n$W = $key->A[1];\n$N = $key->X[0][0];\n$a=array();\nforeach($key->X[1] as $v) {\n $a[]=$v;\n}\n$pos=0;\n$line=array();\nfor($y=0;$y<$H;$y++) {\n $line[$y]=array();\n for($x=0;$x<$W;$x++) {\n $c = getColor($pos,$a);\n if ($c !== false) {\n $pos++;\n $line[$y][]=$c;\n }\n }\n if ($y%2==1) $line[$y]=array_reverse($line[$y]);\n}\nforeach($line as $l) {\n $ll=\"\";\n foreach($l as $v) {\n if ($ll!=\"\") $ll .= \" \";\n $ll.=$v;\n }\n printf(\"%s\\n\",$ll);\n}\n\nfunction getColor($pos,$col) {\n $chk=0;\n foreach($col as $k=>$c) {\n if ($chk <= $pos && $pos < $chk+$c) {\n return $k+1;\n }\n $chk+=$c;\n }\n return false;\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nSnuke is painting these squares in colors 1, 2, ..., N.\nHere, the following conditions should be satisfied:\n\nFor each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.\n\nFor each i (1 ≤ i ≤ N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.\n\nFind a way to paint the squares so that the conditions are satisfied.\nIt can be shown that a solution always exists.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\n1 ≤ N ≤ H W\n\na_i ≥ 1\n\na_1 + a_2 + ... + a_N = H W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint one way to paint the squares that satisfies the conditions.\nOutput in the following format:\n\nc_{1 1} ... c_{1 W}\n:\nc_{H 1} ... c_{H W}\n\nHere, c_{i j} is the color of the square at the i-th row from the top and j-th column from the left.\n\nSample Input 1\n\n2 2\n3\n2 1 1\n\nSample Output 1\n\n1 1\n2 3\n\nBelow is an example of an invalid solution:\n\n1 2\n3 1\n\nThis is because the squares painted in Color 1 are not 4-connected.\n\nSample Input 2\n\n3 5\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 4 4 4 3\n2 5 4 5 3\n2 5 5 5 3\n\nSample Input 3\n\n1 1\n1\n1\n\nSample Output 3\n\n1", "sample_input": "2 2\n3\n2 1 1\n"}, "reference_outputs": ["1 1\n2 3\n"], "source_document_id": "p03638", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nSnuke is painting these squares in colors 1, 2, ..., N.\nHere, the following conditions should be satisfied:\n\nFor each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.\n\nFor each i (1 ≤ i ≤ N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.\n\nFind a way to paint the squares so that the conditions are satisfied.\nIt can be shown that a solution always exists.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\n1 ≤ N ≤ H W\n\na_i ≥ 1\n\na_1 + a_2 + ... + a_N = H W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint one way to paint the squares that satisfies the conditions.\nOutput in the following format:\n\nc_{1 1} ... c_{1 W}\n:\nc_{H 1} ... c_{H W}\n\nHere, c_{i j} is the color of the square at the i-th row from the top and j-th column from the left.\n\nSample Input 1\n\n2 2\n3\n2 1 1\n\nSample Output 1\n\n1 1\n2 3\n\nBelow is an example of an invalid solution:\n\n1 2\n3 1\n\nThis is because the squares painted in Color 1 are not 4-connected.\n\nSample Input 2\n\n3 5\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 4 4 4 3\n2 5 4 5 3\n2 5 5 5 3\n\nSample Input 3\n\n1 1\n1\n1\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1020, "cpu_time_ms": 2104, "memory_kb": 7956}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s788414032", "group_id": "codeNet:p03643", "input_text": "", "language": "PHP", "metadata": {"date": 1575910060, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03643.html", "problem_id": "p03643", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03643/input.txt", "sample_output_relpath": "derived/input_output/data/p03643/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03643/PHP/s302397440.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s302397440", "user_id": "u397596606"}, "prompt_components": {"gold_output": "ABC100\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThis contest, AtCoder Beginner Contest, is abbreviated as ABC.\n\nWhen we refer to a specific round of ABC, a three-digit number is appended after ABC. For example, ABC680 is the 680th round of ABC.\n\nWhat is the abbreviation for the N-th round of ABC? Write a program to output the answer.\n\nConstraints\n\n100 ≤ N ≤ 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the abbreviation for the N-th round of ABC.\n\nSample Input 1\n\n100\n\nSample Output 1\n\nABC100\n\nThe 100th round of ABC is ABC100.\n\nSample Input 2\n\n425\n\nSample Output 2\n\nABC425\n\nSample Input 3\n\n999\n\nSample Output 3\n\nABC999", "sample_input": "100\n"}, "reference_outputs": ["ABC100\n"], "source_document_id": "p03643", "source_text": "Score : 100 points\n\nProblem Statement\n\nThis contest, AtCoder Beginner Contest, is abbreviated as ABC.\n\nWhen we refer to a specific round of ABC, a three-digit number is appended after ABC. For example, ABC680 is the 680th round of ABC.\n\nWhat is the abbreviation for the N-th round of ABC? Write a program to output the answer.\n\nConstraints\n\n100 ≤ N ≤ 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the abbreviation for the N-th round of ABC.\n\nSample Input 1\n\n100\n\nSample Output 1\n\nABC100\n\nThe 100th round of ABC is ABC100.\n\nSample Input 2\n\n425\n\nSample Output 2\n\nABC425\n\nSample Input 3\n\n999\n\nSample Output 3\n\nABC999", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 54, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s158441651", "group_id": "codeNet:p03644", "input_text": "= 64){\necho 64;\n}elseif($n >= 32){\necho 32;\n}elseif($n >= 16){\necho 16;\n}elseif($n >= 8){\necho 8;\n}elseif($n >= 4){\necho 4;\n}elseif($n >= 2){\necho 2;\n}else{\necho 1;\n}", "language": "PHP", "metadata": {"date": 1501816077, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03644.html", "problem_id": "p03644", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03644/input.txt", "sample_output_relpath": "derived/input_output/data/p03644/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03644/PHP/s158441651.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s158441651", "user_id": "u281500237"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "= 64){\necho 64;\n}elseif($n >= 32){\necho 32;\n}elseif($n >= 16){\necho 16;\n}elseif($n >= 8){\necho 8;\n}elseif($n >= 4){\necho 4;\n}elseif($n >= 2){\necho 2;\n}else{\necho 1;\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves numbers divisible by 2.\n\nYou are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.\n\nHere, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.\n\nFor example,\n\n6 can be divided by 2 once: 6 -> 3.\n\n8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.\n\n3 can be divided by 2 zero times.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n4\n\n4 can be divided by 2 twice, which is the most number of times among 1, 2, ..., 7.\n\nSample Input 2\n\n32\n\nSample Output 2\n\n32\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nSample Input 4\n\n100\n\nSample Output 4\n\n64", "sample_input": "7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03644", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves numbers divisible by 2.\n\nYou are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.\n\nHere, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.\n\nFor example,\n\n6 can be divided by 2 once: 6 -> 3.\n\n8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.\n\n3 can be divided by 2 zero times.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n4\n\n4 can be divided by 2 twice, which is the most number of times among 1, 2, ..., 7.\n\nSample Input 2\n\n32\n\nSample Output 2\n\n32\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nSample Input 4\n\n100\n\nSample Output 4\n\n64", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 198, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s998420981", "group_id": "codeNet:p03645", "input_text": " 0){\nlist($a,$b) = explode(\" \",trim(fgets(STDIN)));\n$s = min($a,$b);\n$g = max($a,$b);\n$r[$s][$g] = 1;\n--$m;\n}\n$ans = 0;\nforeach($r[1] as $key => $val){\nif(isset($r[$key])){\nforeach($r[$key] as $k => $v){\nif($k == $n){\n++$ans;\nbreak;\n}\n}\n}\n}\nif($ans == 0){\necho \"IMPOSSIBLE\";\n}else{\necho \"POSSIBLE\";\n}", "language": "PHP", "metadata": {"date": 1501378023, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03645.html", "problem_id": "p03645", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03645/input.txt", "sample_output_relpath": "derived/input_output/data/p03645/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03645/PHP/s998420981.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s998420981", "user_id": "u281500237"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": " 0){\nlist($a,$b) = explode(\" \",trim(fgets(STDIN)));\n$s = min($a,$b);\n$g = max($a,$b);\n$r[$s][$g] = 1;\n--$m;\n}\n$ans = 0;\nforeach($r[1] as $key => $val){\nif(isset($r[$key])){\nforeach($r[$key] as $k => $v){\nif($k == $n){\n++$ans;\nbreak;\n}\n}\n}\n}\nif($ans == 0){\necho \"IMPOSSIBLE\";\n}else{\necho \"POSSIBLE\";\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands.\nFor convenience, we will call them Island 1, Island 2, ..., Island N.\n\nThere are M kinds of regular boat services between these islands.\nEach service connects two islands. The i-th service connects Island a_i and Island b_i.\n\nCat Snuke is on Island 1 now, and wants to go to Island N.\nHowever, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.\n\nHelp him.\n\nConstraints\n\n3 ≤ N ≤ 200 000\n\n1 ≤ M ≤ 200 000\n\n1 ≤ a_i < b_i ≤ N\n\n(a_i, b_i) \\neq (1, N)\n\nIf i \\neq j, (a_i, b_i) \\neq (a_j, b_j).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nIf it is possible to go to Island N by using two boat services, print POSSIBLE; otherwise, print IMPOSSIBLE.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\nPOSSIBLE\n\nSample Input 2\n\n4 3\n1 2\n2 3\n3 4\n\nSample Output 2\n\nIMPOSSIBLE\n\nYou have to use three boat services to get to Island 4.\n\nSample Input 3\n\n100000 1\n1 99999\n\nSample Output 3\n\nIMPOSSIBLE\n\nSample Input 4\n\n5 5\n1 3\n4 5\n2 3\n2 4\n1 4\n\nSample Output 4\n\nPOSSIBLE\n\nYou can get to Island 5 by using two boat services: Island 1 -> Island 4 -> Island 5.", "sample_input": "3 2\n1 2\n2 3\n"}, "reference_outputs": ["POSSIBLE\n"], "source_document_id": "p03645", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands.\nFor convenience, we will call them Island 1, Island 2, ..., Island N.\n\nThere are M kinds of regular boat services between these islands.\nEach service connects two islands. The i-th service connects Island a_i and Island b_i.\n\nCat Snuke is on Island 1 now, and wants to go to Island N.\nHowever, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.\n\nHelp him.\n\nConstraints\n\n3 ≤ N ≤ 200 000\n\n1 ≤ M ≤ 200 000\n\n1 ≤ a_i < b_i ≤ N\n\n(a_i, b_i) \\neq (1, N)\n\nIf i \\neq j, (a_i, b_i) \\neq (a_j, b_j).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nIf it is possible to go to Island N by using two boat services, print POSSIBLE; otherwise, print IMPOSSIBLE.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\nPOSSIBLE\n\nSample Input 2\n\n4 3\n1 2\n2 3\n3 4\n\nSample Output 2\n\nIMPOSSIBLE\n\nYou have to use three boat services to get to Island 4.\n\nSample Input 3\n\n100000 1\n1 99999\n\nSample Output 3\n\nIMPOSSIBLE\n\nSample Input 4\n\n5 5\n1 3\n4 5\n2 3\n2 4\n1 4\n\nSample Output 4\n\nPOSSIBLE\n\nYou can get to Island 5 by using two boat services: Island 1 -> Island 4 -> Island 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 363, "cpu_time_ms": 426, "memory_kb": 65908}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s760433947", "group_id": "codeNet:p03646", "input_text": " [0, 3] -> [1, 1].\n\nSample Input 4\n\n3\n\nSample Output 4\n\n7\n27 0 0 0 0 0 0\n\nSample Input 5\n\n1234567894848\n\nSample Output 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425", "sample_input": "0\n"}, "reference_outputs": ["4\n3 3 3 3\n"], "source_document_id": "p03646", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes N-1 or smaller.\n\nDetermine the largest element in the sequence (if there is more than one, choose one). Decrease the value of this element by N, and increase each of the other elements by 1.\n\nIt can be proved that the largest element in the sequence becomes N-1 or smaller after a finite number of operations.\n\nYou are given an integer K. Find an integer sequence a_i such that the number of times we will perform the above operation is exactly K. It can be shown that there is always such a sequence under the constraints on input and output in this problem.\n\nConstraints\n\n0 ≤ K ≤ 50 \\times 10^{16}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint a solution in the following format:\n\nN\na_1 a_2 ... a_N\n\nHere, 2 ≤ N ≤ 50 and 0 ≤ a_i ≤ 10^{16} + 1000 must hold.\n\nSample Input 1\n\n0\n\nSample Output 1\n\n4\n3 3 3 3\n\nSample Input 2\n\n1\n\nSample Output 2\n\n3\n1 0 3\n\nSample Input 3\n\n2\n\nSample Output 3\n\n2\n2 2\n\nThe operation will be performed twice: [2, 2] -> [0, 3] -> [1, 1].\n\nSample Input 4\n\n3\n\nSample Output 4\n\n7\n27 0 0 0 0 0 0\n\nSample Input 5\n\n1234567894848\n\nSample Output 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 397, "cpu_time_ms": 10, "memory_kb": 4732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s641954141", "group_id": "codeNet:p03647", "input_text": " Island 4 -> Island 5.", "sample_input": "3 2\n1 2\n2 3\n"}, "reference_outputs": ["POSSIBLE\n"], "source_document_id": "p03647", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands.\nFor convenience, we will call them Island 1, Island 2, ..., Island N.\n\nThere are M kinds of regular boat services between these islands.\nEach service connects two islands. The i-th service connects Island a_i and Island b_i.\n\nCat Snuke is on Island 1 now, and wants to go to Island N.\nHowever, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.\n\nHelp him.\n\nConstraints\n\n3 ≤ N ≤ 200 000\n\n1 ≤ M ≤ 200 000\n\n1 ≤ a_i < b_i ≤ N\n\n(a_i, b_i) \\neq (1, N)\n\nIf i \\neq j, (a_i, b_i) \\neq (a_j, b_j).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nIf it is possible to go to Island N by using two boat services, print POSSIBLE; otherwise, print IMPOSSIBLE.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\nPOSSIBLE\n\nSample Input 2\n\n4 3\n1 2\n2 3\n3 4\n\nSample Output 2\n\nIMPOSSIBLE\n\nYou have to use three boat services to get to Island 4.\n\nSample Input 3\n\n100000 1\n1 99999\n\nSample Output 3\n\nIMPOSSIBLE\n\nSample Input 4\n\n5 5\n1 3\n4 5\n2 3\n2 4\n1 4\n\nSample Output 4\n\nPOSSIBLE\n\nYou can get to Island 5 by using two boat services: Island 1 -> Island 4 -> Island 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 510, "cpu_time_ms": 2108, "memory_kb": 14840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s739576173", "group_id": "codeNet:p03651", "input_text": " $m || count($l2) < 2) {\n $res = 'IMPOSSIBLE';\n} else {\n //------------------\n // 最大公約数を求める\n //------------------\n // 値の昇順\n asort($l2);\n $v1 = array_pop($l2);\n $cnt = count($l2);\n for ($i = 0; $i < $cnt; $i++) {\n $v2 = array_pop($l2);\n\n //------------------\n // 2数の最大公約数を求める\n //------------------\n while (true) {\n if ($v1 == 0 || $v2 == 0) {\n $g = 0;\n break;\n }\n if ($v1 == 1 || $v2 == 1) {\n $g = 1;\n break;\n }\n if ($v1 > $v2) {\n $v1 = $v1 % $v2;\n $v3 = abs($v2 - $v1);\n } else {\n $v2 = $v2 % $v1;\n $v3 = abs($v1 - $v2);\n }\n if ($v2 == $v3) {\n $g = $v3;\n break;\n }\n $v1 = $v2;\n $v2 = $v3;\n }\n $v1 = $g;\n }\n if ($g == 0) {\n $res = 'IMPOSSIBLE';\n } else if ($k % $g == 0) {\n $res = 'POSSIBLE';\n } else {\n $res = 'IMPOSSIBLE';\n }\n}\necho $res;", "language": "PHP", "metadata": {"date": 1500958166, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03651.html", "problem_id": "p03651", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03651/input.txt", "sample_output_relpath": "derived/input_output/data/p03651/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03651/PHP/s739576173.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s739576173", "user_id": "u442788381"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": " $m || count($l2) < 2) {\n $res = 'IMPOSSIBLE';\n} else {\n //------------------\n // 最大公約数を求める\n //------------------\n // 値の昇順\n asort($l2);\n $v1 = array_pop($l2);\n $cnt = count($l2);\n for ($i = 0; $i < $cnt; $i++) {\n $v2 = array_pop($l2);\n\n //------------------\n // 2数の最大公約数を求める\n //------------------\n while (true) {\n if ($v1 == 0 || $v2 == 0) {\n $g = 0;\n break;\n }\n if ($v1 == 1 || $v2 == 1) {\n $g = 1;\n break;\n }\n if ($v1 > $v2) {\n $v1 = $v1 % $v2;\n $v3 = abs($v2 - $v1);\n } else {\n $v2 = $v2 % $v1;\n $v3 = abs($v1 - $v2);\n }\n if ($v2 == $v3) {\n $g = $v3;\n break;\n }\n $v1 = $v2;\n $v2 = $v3;\n }\n $v1 = $g;\n }\n if ($g == 0) {\n $res = 'IMPOSSIBLE';\n } else if ($k % $g == 0) {\n $res = 'POSSIBLE';\n } else {\n $res = 'IMPOSSIBLE';\n }\n}\necho $res;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a box containing N balls. The i-th ball has the integer A_i written on it.\nSnuke can perform the following operation any number of times:\n\nTake out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.\n\nDetermine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nIf it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written, print POSSIBLE; if it is not possible, print IMPOSSIBLE.\n\nSample Input 1\n\n3 7\n9 3 4\n\nSample Output 1\n\nPOSSIBLE\n\nFirst, take out the two balls 9 and 4, and return them back along with a new ball, abs(9-4)=5.\nNext, take out 3 and 5, and return them back along with abs(3-5)=2.\nFinally, take out 9 and 2, and return them back along with abs(9-2)=7.\nNow we have 7 in the box, and the answer is therefore POSSIBLE.\n\nSample Input 2\n\n3 5\n6 9 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo matter what we do, it is not possible to have 5 in the box. The answer is therefore IMPOSSIBLE.\n\nSample Input 3\n\n4 11\n11 3 7 15\n\nSample Output 3\n\nPOSSIBLE\n\nThe box already contains 11 before we do anything. The answer is therefore POSSIBLE.\n\nSample Input 4\n\n5 12\n10 2 8 6 4\n\nSample Output 4\n\nIMPOSSIBLE", "sample_input": "3 7\n9 3 4\n"}, "reference_outputs": ["POSSIBLE\n"], "source_document_id": "p03651", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a box containing N balls. The i-th ball has the integer A_i written on it.\nSnuke can perform the following operation any number of times:\n\nTake out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.\n\nDetermine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nIf it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written, print POSSIBLE; if it is not possible, print IMPOSSIBLE.\n\nSample Input 1\n\n3 7\n9 3 4\n\nSample Output 1\n\nPOSSIBLE\n\nFirst, take out the two balls 9 and 4, and return them back along with a new ball, abs(9-4)=5.\nNext, take out 3 and 5, and return them back along with abs(3-5)=2.\nFinally, take out 9 and 2, and return them back along with abs(9-2)=7.\nNow we have 7 in the box, and the answer is therefore POSSIBLE.\n\nSample Input 2\n\n3 5\n6 9 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo matter what we do, it is not possible to have 5 in the box. The answer is therefore IMPOSSIBLE.\n\nSample Input 3\n\n4 11\n11 3 7 15\n\nSample Output 3\n\nPOSSIBLE\n\nThe box already contains 11 before we do anything. The answer is therefore POSSIBLE.\n\nSample Input 4\n\n5 12\n10 2 8 6 4\n\nSample Output 4\n\nIMPOSSIBLE", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1137, "cpu_time_ms": 363, "memory_kb": 21928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s413264303", "group_id": "codeNet:p03657", "input_text": " $value){\n\t$l += (int)$value;\n\tarray_push($left, $l);\n}\n\n$r = 0;\n$right = [];\n$right[0] = 0;\n$r_a = array_reverse($a);\nforeach($r_a as $key => $value){\n\t$r += (int)$value;\n\tarray_push($right, $r);\n}\n$right = array_reverse($right);\n\n$ans = abs($right[1] - $left[1]);\nfor($i = 2;$i abs($right[$i] - $left[$i])){\n\t\t$ans = abs($right[$i] - $left[$i]);\n\t}\n}\n\necho $ans . PHP_EOL;", "language": "PHP", "metadata": {"date": 1558277989, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03659.html", "problem_id": "p03659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03659/input.txt", "sample_output_relpath": "derived/input_output/data/p03659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03659/PHP/s373943465.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s373943465", "user_id": "u003019316"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $value){\n\t$l += (int)$value;\n\tarray_push($left, $l);\n}\n\n$r = 0;\n$right = [];\n$right[0] = 0;\n$r_a = array_reverse($a);\nforeach($r_a as $key => $value){\n\t$r += (int)$value;\n\tarray_push($right, $r);\n}\n$right = array_reverse($right);\n\n$ans = abs($right[1] - $left[1]);\nfor($i = 2;$i abs($right[$i] - $left[$i])){\n\t\t$ans = abs($right[$i] - $left[$i]);\n\t}\n}\n\necho $ans . PHP_EOL;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke and Raccoon have a heap of N cards. The i-th card from the top has the integer a_i written on it.\n\nThey will share these cards.\nFirst, Snuke will take some number of cards from the top of the heap, then Raccoon will take all the remaining cards.\nHere, both Snuke and Raccoon have to take at least one card.\n\nLet the sum of the integers on Snuke's cards and Raccoon's cards be x and y, respectively.\nThey would like to minimize |x-y|.\nFind the minimum possible value of |x-y|.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n-10^{9} \\leq a_i \\leq 10^{9}\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6\n1 2 3 4 5 6\n\nSample Output 1\n\n1\n\nIf Snuke takes four cards from the top, and Raccoon takes the remaining two cards, x=10, y=11, and thus |x-y|=1. This is the minimum possible value.\n\nSample Input 2\n\n2\n10 -10\n\nSample Output 2\n\n20\n\nSnuke can only take one card from the top, and Raccoon can only take the remaining one card. In this case, x=10, y=-10, and thus |x-y|=20.", "sample_input": "6\n1 2 3 4 5 6\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03659", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke and Raccoon have a heap of N cards. The i-th card from the top has the integer a_i written on it.\n\nThey will share these cards.\nFirst, Snuke will take some number of cards from the top of the heap, then Raccoon will take all the remaining cards.\nHere, both Snuke and Raccoon have to take at least one card.\n\nLet the sum of the integers on Snuke's cards and Raccoon's cards be x and y, respectively.\nThey would like to minimize |x-y|.\nFind the minimum possible value of |x-y|.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n-10^{9} \\leq a_i \\leq 10^{9}\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6\n1 2 3 4 5 6\n\nSample Output 1\n\n1\n\nIf Snuke takes four cards from the top, and Raccoon takes the remaining two cards, x=10, y=11, and thus |x-y|=1. This is the minimum possible value.\n\nSample Input 2\n\n2\n10 -10\n\nSample Output 2\n\n20\n\nSnuke can only take one card from the top, and Raccoon can only take the remaining one card. In this case, x=10, y=-10, and thus |x-y|=20.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 604, "cpu_time_ms": 107, "memory_kb": 53728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s483750354", "group_id": "codeNet:p03659", "input_text": " $val){\n $amari = $val%2;\n if($input1_ary == $amari){\n $kotae++;\n }\n}\necho $kotae;", "language": "PHP", "metadata": {"date": 1499654348, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03665.html", "problem_id": "p03665", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03665/input.txt", "sample_output_relpath": "derived/input_output/data/p03665/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03665/PHP/s862212938.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s862212938", "user_id": "u455117192"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $val){\n $amari = $val%2;\n if($input1_ary == $amari){\n $kotae++;\n }\n}\necho $kotae;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N bags of biscuits. The i-th bag contains A_i biscuits.\n\nTakaki will select some of these bags and eat all of the biscuits inside.\nHere, it is also possible to select all or none of the bags.\n\nHe would like to select bags so that the total number of biscuits inside is congruent to P modulo 2.\nHow many such ways to select bags there are?\n\nConstraints\n\n1 \\leq N \\leq 50\n\nP = 0 or 1\n\n1 \\leq A_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of ways to select bags so that the total number of biscuits inside is congruent to P modulo 2.\n\nSample Input 1\n\n2 0\n1 3\n\nSample Output 1\n\n2\n\nThere are two ways to select bags so that the total number of biscuits inside is congruent to 0 modulo 2:\n\nSelect neither bag. The total number of biscuits is 0.\n\nSelect both bags. The total number of biscuits is 4.\n\nSample Input 2\n\n1 1\n50\n\nSample Output 2\n\n0\n\nSample Input 3\n\n3 0\n1 1 1\n\nSample Output 3\n\n4\n\nTwo bags are distinguished even if they contain the same number of biscuits.\n\nSample Input 4\n\n45 1\n17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 66 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 25 26\n\nSample Output 4\n\n17592186044416", "sample_input": "2 0\n1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03665", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N bags of biscuits. The i-th bag contains A_i biscuits.\n\nTakaki will select some of these bags and eat all of the biscuits inside.\nHere, it is also possible to select all or none of the bags.\n\nHe would like to select bags so that the total number of biscuits inside is congruent to P modulo 2.\nHow many such ways to select bags there are?\n\nConstraints\n\n1 \\leq N \\leq 50\n\nP = 0 or 1\n\n1 \\leq A_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of ways to select bags so that the total number of biscuits inside is congruent to P modulo 2.\n\nSample Input 1\n\n2 0\n1 3\n\nSample Output 1\n\n2\n\nThere are two ways to select bags so that the total number of biscuits inside is congruent to 0 modulo 2:\n\nSelect neither bag. The total number of biscuits is 0.\n\nSelect both bags. The total number of biscuits is 4.\n\nSample Input 2\n\n1 1\n50\n\nSample Output 2\n\n0\n\nSample Input 3\n\n3 0\n1 1 1\n\nSample Output 3\n\n4\n\nTwo bags are distinguished even if they contain the same number of biscuits.\n\nSample Input 4\n\n45 1\n17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 66 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 25 26\n\nSample Output 4\n\n17592186044416", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 10, "memory_kb": 3700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s628559432", "group_id": "codeNet:p03667", "input_text": " 0; $i--) {\n if ($stock == 0) {\n $stock += $arr[$i];\n }\n if ($stock > 0) {\n $stock--;\n } else {\n $ret++;\n }\n }\n return $ret;\n}", "language": "PHP", "metadata": {"date": 1499654288, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03667.html", "problem_id": "p03667", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03667/input.txt", "sample_output_relpath": "derived/input_output/data/p03667/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03667/PHP/s628559432.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s628559432", "user_id": "u195912432"}, "prompt_components": {"gold_output": "0\n1\n1\n", "input_to_evaluate": " 0; $i--) {\n if ($stock == 0) {\n $stock += $arr[$i];\n }\n if ($stock > 0) {\n $stock--;\n } else {\n $ret++;\n }\n }\n return $ret;\n}", "problem_context": "Score : 1000 points\n\nProblem Statement\n\nThere are N balls in a row.\nInitially, the i-th ball from the left has the integer A_i written on it.\n\nWhen Snuke cast a spell, the following happens:\n\nLet the current number of balls be k. All the balls with k written on them disappear at the same time.\n\nSnuke's objective is to vanish all the balls by casting the spell some number of times.\nThis may not be possible as it is. If that is the case, he would like to modify the integers on the minimum number of balls to make his objective achievable.\n\nBy the way, the integers on these balls sometimes change by themselves.\nThere will be M such changes. In the j-th change, the integer on the X_j-th ball from the left will change into Y_j.\n\nAfter each change, find the minimum number of modifications of integers on the balls Snuke needs to make if he wishes to achieve his objective before the next change occurs. We will assume that he is quick enough in modifying integers. Here, note that he does not actually perform those necessary modifications and leaves them as they are.\n\nConstraints\n\n1 \\leq N \\leq 200000\n\n1 \\leq M \\leq 200000\n\n1 \\leq A_i \\leq N\n\n1 \\leq X_j \\leq N\n\n1 \\leq Y_j \\leq N\n\nSubscore\n\nIn the test set worth 500 points, N \\leq 200 and M \\leq 200.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nX_1 Y_1\nX_2 Y_2\n:\nX_M Y_M\n\nOutput\n\nPrint M lines.\nThe j-th line should contain the minimum necessary number of modifications of integers on the balls to make Snuke's objective achievable.\n\nSample Input 1\n\n5 3\n1 1 3 4 5\n1 2\n2 5\n5 4\n\nSample Output 1\n\n0\n1\n1\n\nAfter the first change, the integers on the balls become 2, 1, 3, 4, 5, from left to right. Here, all the balls can be vanished by casting the spell five times. Thus, no modification is necessary.\n\nAfter the second change, the integers on the balls become 2, 5, 3, 4, 5, from left to right. In this case, at least one modification must be made. One optimal solution is to modify the integer on the fifth ball from the left to 2, and cast the spell four times.\n\nAfter the third change, the integers on the balls become 2, 5, 3, 4, 4, from left to right. Also in this case, at least one modification must be made. One optimal solution is to modify the integer on the third ball from the left to 2, and cast the spell three times.\n\nSample Input 2\n\n4 4\n4 4 4 4\n4 1\n3 1\n1 1\n2 1\n\nSample Output 2\n\n0\n1\n2\n3\n\nSample Input 3\n\n10 10\n8 7 2 9 10 6 6 5 5 4\n8 1\n6 3\n6 2\n7 10\n9 7\n9 9\n2 4\n8 1\n1 8\n7 7\n\nSample Output 3\n\n1\n0\n1\n2\n2\n3\n3\n3\n3\n2", "sample_input": "5 3\n1 1 3 4 5\n1 2\n2 5\n5 4\n"}, "reference_outputs": ["0\n1\n1\n"], "source_document_id": "p03667", "source_text": "Score : 1000 points\n\nProblem Statement\n\nThere are N balls in a row.\nInitially, the i-th ball from the left has the integer A_i written on it.\n\nWhen Snuke cast a spell, the following happens:\n\nLet the current number of balls be k. All the balls with k written on them disappear at the same time.\n\nSnuke's objective is to vanish all the balls by casting the spell some number of times.\nThis may not be possible as it is. If that is the case, he would like to modify the integers on the minimum number of balls to make his objective achievable.\n\nBy the way, the integers on these balls sometimes change by themselves.\nThere will be M such changes. In the j-th change, the integer on the X_j-th ball from the left will change into Y_j.\n\nAfter each change, find the minimum number of modifications of integers on the balls Snuke needs to make if he wishes to achieve his objective before the next change occurs. We will assume that he is quick enough in modifying integers. Here, note that he does not actually perform those necessary modifications and leaves them as they are.\n\nConstraints\n\n1 \\leq N \\leq 200000\n\n1 \\leq M \\leq 200000\n\n1 \\leq A_i \\leq N\n\n1 \\leq X_j \\leq N\n\n1 \\leq Y_j \\leq N\n\nSubscore\n\nIn the test set worth 500 points, N \\leq 200 and M \\leq 200.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nX_1 Y_1\nX_2 Y_2\n:\nX_M Y_M\n\nOutput\n\nPrint M lines.\nThe j-th line should contain the minimum necessary number of modifications of integers on the balls to make Snuke's objective achievable.\n\nSample Input 1\n\n5 3\n1 1 3 4 5\n1 2\n2 5\n5 4\n\nSample Output 1\n\n0\n1\n1\n\nAfter the first change, the integers on the balls become 2, 1, 3, 4, 5, from left to right. Here, all the balls can be vanished by casting the spell five times. Thus, no modification is necessary.\n\nAfter the second change, the integers on the balls become 2, 5, 3, 4, 5, from left to right. In this case, at least one modification must be made. One optimal solution is to modify the integer on the fifth ball from the left to 2, and cast the spell four times.\n\nAfter the third change, the integers on the balls become 2, 5, 3, 4, 4, from left to right. Also in this case, at least one modification must be made. One optimal solution is to modify the integer on the third ball from the left to 2, and cast the spell three times.\n\nSample Input 2\n\n4 4\n4 4 4 4\n4 1\n3 1\n1 1\n2 1\n\nSample Output 2\n\n0\n1\n2\n3\n\nSample Input 3\n\n10 10\n8 7 2 9 10 6 6 5 5 4\n8 1\n6 3\n6 2\n7 10\n9 7\n9 9\n2 4\n8 1\n1 8\n7 7\n\nSample Output 3\n\n1\n0\n1\n2\n2\n3\n3\n3\n3\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 789, "cpu_time_ms": 2104, "memory_kb": 29680}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s847429566", "group_id": "codeNet:p03677", "input_text": "\n", "language": "PHP", "metadata": {"date": 1498949571, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03679.html", "problem_id": "p03679", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03679/input.txt", "sample_output_relpath": "derived/input_output/data/p03679/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03679/PHP/s684241159.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s684241159", "user_id": "u679071005"}, "prompt_components": {"gold_output": "safe\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has a strong stomach. He never gets a stomachache from eating something whose \"best-by\" date is at most X days earlier.\nHe gets a stomachache if the \"best-by\" date of the food is X+1 or more days earlier, though.\n\nOther than that, he finds the food delicious if he eats it not later than the \"best-by\" date. Otherwise, he does not find it delicious.\n\nTakahashi bought some food A days before the \"best-by\" date, and ate it B days after he bought it.\n\nWrite a program that outputs delicious if he found it delicious, safe if he did not found it delicious but did not get a stomachache either, and dangerous if he got a stomachache.\n\nConstraints\n\n1 ≤ X,A,B ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A B\n\nOutput\n\nPrint delicious if Takahashi found the food delicious; print safe if he neither found it delicious nor got a stomachache; print dangerous if he got a stomachache.\n\nSample Input 1\n\n4 3 6\n\nSample Output 1\n\nsafe\n\nHe ate the food three days after the \"best-by\" date. It was not delicious or harmful for him.\n\nSample Input 2\n\n6 5 1\n\nSample Output 2\n\ndelicious\n\nHe ate the food by the \"best-by\" date. It was delicious for him.\n\nSample Input 3\n\n3 7 12\n\nSample Output 3\n\ndangerous\n\nHe ate the food five days after the \"best-by\" date. It was harmful for him.", "sample_input": "4 3 6\n"}, "reference_outputs": ["safe\n"], "source_document_id": "p03679", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has a strong stomach. He never gets a stomachache from eating something whose \"best-by\" date is at most X days earlier.\nHe gets a stomachache if the \"best-by\" date of the food is X+1 or more days earlier, though.\n\nOther than that, he finds the food delicious if he eats it not later than the \"best-by\" date. Otherwise, he does not find it delicious.\n\nTakahashi bought some food A days before the \"best-by\" date, and ate it B days after he bought it.\n\nWrite a program that outputs delicious if he found it delicious, safe if he did not found it delicious but did not get a stomachache either, and dangerous if he got a stomachache.\n\nConstraints\n\n1 ≤ X,A,B ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A B\n\nOutput\n\nPrint delicious if Takahashi found the food delicious; print safe if he neither found it delicious nor got a stomachache; print dangerous if he got a stomachache.\n\nSample Input 1\n\n4 3 6\n\nSample Output 1\n\nsafe\n\nHe ate the food three days after the \"best-by\" date. It was not delicious or harmful for him.\n\nSample Input 2\n\n6 5 1\n\nSample Output 2\n\ndelicious\n\nHe ate the food by the \"best-by\" date. It was delicious for him.\n\nSample Input 3\n\n3 7 12\n\nSample Output 3\n\ndangerous\n\nHe ate the food five days after the \"best-by\" date. It was harmful for him.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 164, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s013218009", "group_id": "codeNet:p03680", "input_text": "= 10) printf('error');\nelse printf($sum);\n", "language": "PHP", "metadata": {"date": 1496701761, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03697.html", "problem_id": "p03697", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03697/input.txt", "sample_output_relpath": "derived/input_output/data/p03697/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03697/PHP/s431059754.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s431059754", "user_id": "u717434590"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "= 10) printf('error');\nelse printf($sum);\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B as the input. Output the value of A + B.\n\nHowever, if A + B is 10 or greater, output error instead.\n\nConstraints\n\nA and B are integers.\n\n1 ≤ A, B ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A + B is 10 or greater, print the string error (case-sensitive); otherwise, print the value of A + B.\n\nSample Input 1\n\n6 3\n\nSample Output 1\n\n9\n\nSample Input 2\n\n6 4\n\nSample Output 2\n\nerror", "sample_input": "6 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03697", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B as the input. Output the value of A + B.\n\nHowever, if A + B is 10 or greater, output error instead.\n\nConstraints\n\nA and B are integers.\n\n1 ≤ A, B ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A + B is 10 or greater, print the string error (case-sensitive); otherwise, print the value of A + B.\n\nSample Input 1\n\n6 3\n\nSample Output 1\n\n9\n\nSample Input 2\n\n6 4\n\nSample Output 2\n\nerror", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 150, "cpu_time_ms": 12, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s073879367", "group_id": "codeNet:p03699", "input_text": " $V){\n $cnt+=$V;\n }\n echo $cnt.PHP_EOL;\n }\n else echo \"0\".PHP_EOL;\n }", "language": "PHP", "metadata": {"date": 1598585633, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03720.html", "problem_id": "p03720", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03720/input.txt", "sample_output_relpath": "derived/input_output/data/p03720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03720/PHP/s849372783.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s849372783", "user_id": "u800169017"}, "prompt_components": {"gold_output": "2\n2\n1\n1\n", "input_to_evaluate": " $V){\n $cnt+=$V;\n }\n echo $cnt.PHP_EOL;\n }\n else echo \"0\".PHP_EOL;\n }", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N cities and M roads.\nThe i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirectionally.\nThere may be more than one road that connects the same pair of two cities.\nFor each city, how many roads are connected to the city?\n\nConstraints\n\n2≤N,M≤50\n\n1≤a_i,b_i≤N\n\na_i ≠ b_i\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_M b_M\n\nOutput\n\nPrint the answer in N lines.\nIn the i-th line (1≤i≤N), print the number of roads connected to city i.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n1 4\n\nSample Output 1\n\n2\n2\n1\n1\n\nCity 1 is connected to the 1-st and 3-rd roads.\n\nCity 2 is connected to the 1-st and 2-nd roads.\n\nCity 3 is connected to the 2-nd road.\n\nCity 4 is connected to the 3-rd road.\n\nSample Input 2\n\n2 5\n1 2\n2 1\n1 2\n2 1\n1 2\n\nSample Output 2\n\n5\n5\n\nSample Input 3\n\n8 8\n1 2\n3 4\n1 5\n2 8\n3 7\n5 2\n4 1\n6 8\n\nSample Output 3\n\n3\n3\n2\n2\n2\n1\n1\n2", "sample_input": "4 3\n1 2\n2 3\n1 4\n"}, "reference_outputs": ["2\n2\n1\n1\n"], "source_document_id": "p03720", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N cities and M roads.\nThe i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirectionally.\nThere may be more than one road that connects the same pair of two cities.\nFor each city, how many roads are connected to the city?\n\nConstraints\n\n2≤N,M≤50\n\n1≤a_i,b_i≤N\n\na_i ≠ b_i\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_M b_M\n\nOutput\n\nPrint the answer in N lines.\nIn the i-th line (1≤i≤N), print the number of roads connected to city i.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n1 4\n\nSample Output 1\n\n2\n2\n1\n1\n\nCity 1 is connected to the 1-st and 3-rd roads.\n\nCity 2 is connected to the 1-st and 2-nd roads.\n\nCity 3 is connected to the 2-nd road.\n\nCity 4 is connected to the 3-rd road.\n\nSample Input 2\n\n2 5\n1 2\n2 1\n1 2\n2 1\n1 2\n\nSample Output 2\n\n5\n5\n\nSample Input 3\n\n8 8\n1 2\n3 4\n1 5\n2 8\n3 7\n5 2\n4 1\n6 8\n\nSample Output 3\n\n3\n3\n2\n2\n2\n1\n1\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 547, "cpu_time_ms": 24, "memory_kb": 16276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s560548940", "group_id": "codeNet:p03720", "input_text": "A = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$N = $key->A[0];\n$K = $key->A[1];\n$ary = array();\n$cnt=0;\n$res=0;\n$ary=array();\n//K番目の数ではなくK番目に小さい数\nforeach($key->X as $r) {\n $ary[$r[0]]+=$r[1];\n}\nksort($ary);\nif ($K <= count($ary)) {\n //出てきた数値の個数以下なら\n //配列のキーから取り出せる\n $cnt=1;\n while($c = current($ary)) {\n if ($K == $cnt) {\n printf(\"%d\\n\",key($ary));\n exit;\n }\n next($ary);\n $cnt++;\n }\n}\nelse {\n //出てきた個数の数値より大きければ\n //何番目になるのか数える必要がある\n $cnt=0;\n foreach($ary as $k => $v) {\n if ($K <= ($cnt + $v)) {\n printf(\"%d\\n\",$k);\n exit;\n }\n $cnt+=$v;\n }\n}\n", "language": "PHP", "metadata": {"date": 1494726919, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03721.html", "problem_id": "p03721", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03721/input.txt", "sample_output_relpath": "derived/input_output/data/p03721/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03721/PHP/s390044706.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390044706", "user_id": "u278278558"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "A = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$N = $key->A[0];\n$K = $key->A[1];\n$ary = array();\n$cnt=0;\n$res=0;\n$ary=array();\n//K番目の数ではなくK番目に小さい数\nforeach($key->X as $r) {\n $ary[$r[0]]+=$r[1];\n}\nksort($ary);\nif ($K <= count($ary)) {\n //出てきた数値の個数以下なら\n //配列のキーから取り出せる\n $cnt=1;\n while($c = current($ary)) {\n if ($K == $cnt) {\n printf(\"%d\\n\",key($ary));\n exit;\n }\n next($ary);\n $cnt++;\n }\n}\nelse {\n //出てきた個数の数値より大きければ\n //何番目になるのか数える必要がある\n $cnt=0;\n foreach($ary as $k => $v) {\n if ($K <= ($cnt + $v)) {\n printf(\"%d\\n\",$k);\n exit;\n }\n $cnt+=$v;\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is an empty array.\nThe following N operations will be performed to insert integers into the array.\nIn the i-th operation (1≤i≤N), b_i copies of an integer a_i are inserted into the array.\nFind the K-th smallest integer in the array after the N operations.\nFor example, the 4-th smallest integer in the array \\{1,2,2,3,3,3\\} is 3.\n\nConstraints\n\n1≤N≤10^5\n\n1≤a_i,b_i≤10^5\n\n1≤K≤b_1…+…b_n\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the K-th smallest integer in the array after the N operations.\n\nSample Input 1\n\n3 4\n1 1\n2 2\n3 3\n\nSample Output 1\n\n3\n\nThe resulting array is the same as the one in the problem statement.\n\nSample Input 2\n\n10 500000\n1 100000\n1 100000\n1 100000\n1 100000\n1 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n\nSample Output 2\n\n1", "sample_input": "3 4\n1 1\n2 2\n3 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03721", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is an empty array.\nThe following N operations will be performed to insert integers into the array.\nIn the i-th operation (1≤i≤N), b_i copies of an integer a_i are inserted into the array.\nFind the K-th smallest integer in the array after the N operations.\nFor example, the 4-th smallest integer in the array \\{1,2,2,3,3,3\\} is 3.\n\nConstraints\n\n1≤N≤10^5\n\n1≤a_i,b_i≤10^5\n\n1≤K≤b_1…+…b_n\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the K-th smallest integer in the array after the N operations.\n\nSample Input 1\n\n3 4\n1 1\n2 2\n3 3\n\nSample Output 1\n\n3\n\nThe resulting array is the same as the one in the problem statement.\n\nSample Input 2\n\n10 500000\n1 100000\n1 100000\n1 100000\n1 100000\n1 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1065, "cpu_time_ms": 272, "memory_kb": 96884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s411692703", "group_id": "codeNet:p03723", "input_text": "", "language": "PHP", "metadata": {"date": 1575882790, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03729.html", "problem_id": "p03729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03729/input.txt", "sample_output_relpath": "derived/input_output/data/p03729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03729/PHP/s294386401.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s294386401", "user_id": "u397596606"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three strings A, B and C. Check whether they form a word chain.\n\nMore formally, determine whether both of the following are true:\n\nThe last character in A and the initial character in B are the same.\n\nThe last character in B and the initial character in C are the same.\n\nIf both are true, print YES. Otherwise, print NO.\n\nConstraints\n\nA, B and C are all composed of lowercase English letters (a - z).\n\n1 ≤ |A|, |B|, |C| ≤ 10, where |A|, |B| and |C| are the lengths of A, B and C, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint YES or NO.\n\nSample Input 1\n\nrng gorilla apple\n\nSample Output 1\n\nYES\n\nThey form a word chain.\n\nSample Input 2\n\nyakiniku unagi sushi\n\nSample Output 2\n\nNO\n\nA and B form a word chain, but B and C do not.\n\nSample Input 3\n\na a a\n\nSample Output 3\n\nYES\n\nSample Input 4\n\naaaaaaaaab aaaaaaaaaa aaaaaaaaab\n\nSample Output 4\n\nNO", "sample_input": "rng gorilla apple\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03729", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three strings A, B and C. Check whether they form a word chain.\n\nMore formally, determine whether both of the following are true:\n\nThe last character in A and the initial character in B are the same.\n\nThe last character in B and the initial character in C are the same.\n\nIf both are true, print YES. Otherwise, print NO.\n\nConstraints\n\nA, B and C are all composed of lowercase English letters (a - z).\n\n1 ≤ |A|, |B|, |C| ≤ 10, where |A|, |B| and |C| are the lengths of A, B and C, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint YES or NO.\n\nSample Input 1\n\nrng gorilla apple\n\nSample Output 1\n\nYES\n\nThey form a word chain.\n\nSample Input 2\n\nyakiniku unagi sushi\n\nSample Output 2\n\nNO\n\nA and B form a word chain, but B and C do not.\n\nSample Input 3\n\na a a\n\nSample Output 3\n\nYES\n\nSample Input 4\n\naaaaaaaaab aaaaaaaaaa aaaaaaaaab\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 226, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s381645939", "group_id": "codeNet:p03737", "input_text": " $b){\n echo 'GREATER';\n}elseif($a < $b){\n echo 'LESS';\n}elseif($a == $b){\n echo 'EQUAL';\n}", "language": "PHP", "metadata": {"date": 1574973880, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03738.html", "problem_id": "p03738", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03738/input.txt", "sample_output_relpath": "derived/input_output/data/p03738/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03738/PHP/s555008473.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s555008473", "user_id": "u078274014"}, "prompt_components": {"gold_output": "GREATER\n", "input_to_evaluate": " $b){\n echo 'GREATER';\n}elseif($a < $b){\n echo 'LESS';\n}elseif($a == $b){\n echo 'EQUAL';\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two positive integers A and B. Compare the magnitudes of these numbers.\n\nConstraints\n\n1 ≤ A, B ≤ 10^{100}\n\nNeither A nor B begins with a 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint GREATER if A>B, LESS if A24, print GREATER.\n\nSample Input 2\n\n850\n3777\n\nSample Output 2\n\nLESS\n\nSample Input 3\n\n9720246\n22516266\n\nSample Output 3\n\nLESS\n\nSample Input 4\n\n123456789012345678901234567890\n234567890123456789012345678901\n\nSample Output 4\n\nLESS", "sample_input": "36\n24\n"}, "reference_outputs": ["GREATER\n"], "source_document_id": "p03738", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two positive integers A and B. Compare the magnitudes of these numbers.\n\nConstraints\n\n1 ≤ A, B ≤ 10^{100}\n\nNeither A nor B begins with a 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint GREATER if A>B, LESS if A24, print GREATER.\n\nSample Input 2\n\n850\n3777\n\nSample Output 2\n\nLESS\n\nSample Input 3\n\n9720246\n22516266\n\nSample Output 3\n\nLESS\n\nSample Input 4\n\n123456789012345678901234567890\n234567890123456789012345678901\n\nSample Output 4\n\nLESS", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 165, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s406638362", "group_id": "codeNet:p03760", "input_text": "", "language": "PHP", "metadata": {"date": 1576212468, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03761.html", "problem_id": "p03761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03761/input.txt", "sample_output_relpath": "derived/input_output/data/p03761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03761/PHP/s204023337.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s204023337", "user_id": "u397596606"}, "prompt_components": {"gold_output": "aac\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke loves \"paper cutting\": he cuts out characters from a newspaper headline and rearranges them to form another string.\n\nHe will receive a headline which contains one of the strings S_1,...,S_n tomorrow.\nHe is excited and already thinking of what string he will create.\nSince he does not know the string on the headline yet, he is interested in strings that can be created regardless of which string the headline contains.\n\nFind the longest string that can be created regardless of which string among S_1,...,S_n the headline contains.\nIf there are multiple such strings, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq n \\leq 50\n\n1 \\leq |S_i| \\leq 50 for every i = 1, ..., n.\n\nS_i consists of lowercase English letters (a - z) for every i = 1, ..., n.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nS_1\n...\nS_n\n\nOutput\n\nPrint the lexicographically smallest string among the longest strings that satisfy the condition.\nIf the answer is an empty string, print an empty line.\n\nSample Input 1\n\n3\ncbaa\ndaacc\nacacac\n\nSample Output 1\n\naac\n\nThe strings that can be created from each of cbaa, daacc and acacac, are aa, aac, aca, caa and so forth.\nAmong them, aac, aca and caa are the longest, and the lexicographically smallest of these three is aac.\n\nSample Input 2\n\n3\na\naa\nb\n\nSample Output 2\n\nThe answer is an empty string.", "sample_input": "3\ncbaa\ndaacc\nacacac\n"}, "reference_outputs": ["aac\n"], "source_document_id": "p03761", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke loves \"paper cutting\": he cuts out characters from a newspaper headline and rearranges them to form another string.\n\nHe will receive a headline which contains one of the strings S_1,...,S_n tomorrow.\nHe is excited and already thinking of what string he will create.\nSince he does not know the string on the headline yet, he is interested in strings that can be created regardless of which string the headline contains.\n\nFind the longest string that can be created regardless of which string among S_1,...,S_n the headline contains.\nIf there are multiple such strings, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq n \\leq 50\n\n1 \\leq |S_i| \\leq 50 for every i = 1, ..., n.\n\nS_i consists of lowercase English letters (a - z) for every i = 1, ..., n.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nS_1\n...\nS_n\n\nOutput\n\nPrint the lexicographically smallest string among the longest strings that satisfy the condition.\nIf the answer is an empty string, print an empty line.\n\nSample Input 1\n\n3\ncbaa\ndaacc\nacacac\n\nSample Output 1\n\naac\n\nThe strings that can be created from each of cbaa, daacc and acacac, are aa, aac, aca, caa and so forth.\nAmong them, aac, aca and caa are the longest, and the lexicographically smallest of these three is aac.\n\nSample Input 2\n\n3\na\naa\nb\n\nSample Output 2\n\nThe answer is an empty string.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 266, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s184994873", "group_id": "codeNet:p03762", "input_text": "A = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$N = $key->A[0];\n$M = $key->A[1];\n$X = $key->X[0];\n$Y = $key->X[1];\n//X,Yの組み合わせから四角形を全部列挙する必要がある。\nfor($i=0;$iA = $a;\n $fi++;\n continue;\n }\n if ($fi > 0) {\n $a = explode(\" \",$l);\n $key->X[] = $a;\n }\n}\n$N = $key->A[0];\n$M = $key->A[1];\n$X = $key->X[0];\n$Y = $key->X[1];\n//X,Yの組み合わせから四角形を全部列挙する必要がある。\nfor($i=0;$i $value) {\n $data[] = explode(' ', $value);\n}\n\nforeach ($data as &$line) {\n $line = array_map(function($val) { return (int)$val; }, $line);\n}\n\n\n$N = $data[0][0];\n$C = $data[0][1];\n$K = $data[0][2];\n\nfor ($i = 1; $i <= $N; $i++) {\n $T[$i] = $data[$i][0];\n}\nsort($T);\n\n$bus = 0;\n$startTime = null;\n$tmpPeople = 0;\nforeach ($T as $key => $time) {\n if (is_null($startTime)) {\n $startTime = $time;\n }\n $tmpPeople++;\n\n $nextKey = $key + 1;\n if ($tmpPeople === $C || !array_key_exists($nextKey, $T) || $T[$nextKey] - $startTime > $K) {\n $bus++;\n $startTime = null;\n $tmpPeople = 0;\n }\n}\n\n$ans = $bus;\n\nprintf('%d', $ans);\n", "language": "PHP", "metadata": {"date": 1589694957, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03785.html", "problem_id": "p03785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03785/input.txt", "sample_output_relpath": "derived/input_output/data/p03785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03785/PHP/s994056048.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s994056048", "user_id": "u671910250"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $value) {\n $data[] = explode(' ', $value);\n}\n\nforeach ($data as &$line) {\n $line = array_map(function($val) { return (int)$val; }, $line);\n}\n\n\n$N = $data[0][0];\n$C = $data[0][1];\n$K = $data[0][2];\n\nfor ($i = 1; $i <= $N; $i++) {\n $T[$i] = $data[$i][0];\n}\nsort($T);\n\n$bus = 0;\n$startTime = null;\n$tmpPeople = 0;\nforeach ($T as $key => $time) {\n if (is_null($startTime)) {\n $startTime = $time;\n }\n $tmpPeople++;\n\n $nextKey = $key + 1;\n if ($tmpPeople === $C || !array_key_exists($nextKey, $T) || $T[$nextKey] - $startTime > $K) {\n $bus++;\n $startTime = null;\n $tmpPeople = 0;\n }\n}\n\n$ans = $bus;\n\nprintf('%d', $ans);\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nEvery day, N passengers arrive at Takahashi Airport.\nThe i-th passenger arrives at time T_i.\n\nEvery passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers.\nNaturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport.\nAlso, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane.\nFor that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive).\n\nWhen setting the departure times for buses under this condition, find the minimum required number of buses.\nHere, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq C \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\n1 \\leq T_i \\leq 10^9\n\nC, K and T_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C K\nT_1\nT_2\n:\nT_N\n\nOutput\n\nPrint the minimum required number of buses.\n\nSample Input 1\n\n5 3 5\n1\n2\n3\n6\n12\n\nSample Output 1\n\n3\n\nFor example, the following three buses are enough:\n\nA bus departing at time 4.5, that carries the passengers arriving at time 2 and 3.\n\nA bus departing at time 6, that carries the passengers arriving at time 1 and 6.\n\nA bus departing at time 12, that carries the passenger arriving at time 12.\n\nSample Input 2\n\n6 3 3\n7\n6\n2\n8\n10\n6\n\nSample Output 2\n\n3", "sample_input": "5 3 5\n1\n2\n3\n6\n12\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03785", "source_text": "Score : 300 points\n\nProblem Statement\n\nEvery day, N passengers arrive at Takahashi Airport.\nThe i-th passenger arrives at time T_i.\n\nEvery passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers.\nNaturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport.\nAlso, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane.\nFor that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive).\n\nWhen setting the departure times for buses under this condition, find the minimum required number of buses.\nHere, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq C \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\n1 \\leq T_i \\leq 10^9\n\nC, K and T_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C K\nT_1\nT_2\n:\nT_N\n\nOutput\n\nPrint the minimum required number of buses.\n\nSample Input 1\n\n5 3 5\n1\n2\n3\n6\n12\n\nSample Output 1\n\n3\n\nFor example, the following three buses are enough:\n\nA bus departing at time 4.5, that carries the passengers arriving at time 2 and 3.\n\nA bus departing at time 6, that carries the passengers arriving at time 1 and 6.\n\nA bus departing at time 12, that carries the passenger arriving at time 12.\n\nSample Input 2\n\n6 3 3\n7\n6\n2\n8\n10\n6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 764, "cpu_time_ms": 130, "memory_kb": 58224}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s068631471", "group_id": "codeNet:p03785", "input_text": " $t[$min] + $k){\n $bus++;\n $bus_rider = 1;\n $min = $i;\n if($n-1 == $i) $bus++;\n }elseif($bus_rider == $c){\n $bus_rider = 0;\n $bus++;\n $min = $i+1;\n }else{\n if($n-1 == $i) $bus++;\n }\n }\n\n\n echo $bus;\n", "language": "PHP", "metadata": {"date": 1489370875, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03785.html", "problem_id": "p03785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03785/input.txt", "sample_output_relpath": "derived/input_output/data/p03785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03785/PHP/s068631471.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s068631471", "user_id": "u465318593"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $t[$min] + $k){\n $bus++;\n $bus_rider = 1;\n $min = $i;\n if($n-1 == $i) $bus++;\n }elseif($bus_rider == $c){\n $bus_rider = 0;\n $bus++;\n $min = $i+1;\n }else{\n if($n-1 == $i) $bus++;\n }\n }\n\n\n echo $bus;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nEvery day, N passengers arrive at Takahashi Airport.\nThe i-th passenger arrives at time T_i.\n\nEvery passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers.\nNaturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport.\nAlso, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane.\nFor that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive).\n\nWhen setting the departure times for buses under this condition, find the minimum required number of buses.\nHere, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq C \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\n1 \\leq T_i \\leq 10^9\n\nC, K and T_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C K\nT_1\nT_2\n:\nT_N\n\nOutput\n\nPrint the minimum required number of buses.\n\nSample Input 1\n\n5 3 5\n1\n2\n3\n6\n12\n\nSample Output 1\n\n3\n\nFor example, the following three buses are enough:\n\nA bus departing at time 4.5, that carries the passengers arriving at time 2 and 3.\n\nA bus departing at time 6, that carries the passengers arriving at time 1 and 6.\n\nA bus departing at time 12, that carries the passenger arriving at time 12.\n\nSample Input 2\n\n6 3 3\n7\n6\n2\n8\n10\n6\n\nSample Output 2\n\n3", "sample_input": "5 3 5\n1\n2\n3\n6\n12\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03785", "source_text": "Score : 300 points\n\nProblem Statement\n\nEvery day, N passengers arrive at Takahashi Airport.\nThe i-th passenger arrives at time T_i.\n\nEvery passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers.\nNaturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport.\nAlso, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane.\nFor that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive).\n\nWhen setting the departure times for buses under this condition, find the minimum required number of buses.\nHere, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq C \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\n1 \\leq T_i \\leq 10^9\n\nC, K and T_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C K\nT_1\nT_2\n:\nT_N\n\nOutput\n\nPrint the minimum required number of buses.\n\nSample Input 1\n\n5 3 5\n1\n2\n3\n6\n12\n\nSample Output 1\n\n3\n\nFor example, the following three buses are enough:\n\nA bus departing at time 4.5, that carries the passengers arriving at time 2 and 3.\n\nA bus departing at time 6, that carries the passengers arriving at time 1 and 6.\n\nA bus departing at time 12, that carries the passenger arriving at time 12.\n\nSample Input 2\n\n6 3 3\n7\n6\n2\n8\n10\n6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 540, "cpu_time_ms": 176, "memory_kb": 18932}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s347259626", "group_id": "codeNet:p03786", "input_text": " $b){\n if($size * 2 < $b)$start = $i;\n $size+=$b;\n}\necho $n - $start,\"\\n\";", "language": "PHP", "metadata": {"date": 1576622366, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03786.html", "problem_id": "p03786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03786/input.txt", "sample_output_relpath": "derived/input_output/data/p03786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03786/PHP/s347259626.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s347259626", "user_id": "u248209126"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": " $b){\n if($size * 2 < $b)$start = $i;\n $size+=$b;\n}\necho $n - $start,\"\\n\";", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke found N strange creatures.\nEach creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively.\n\nEvery creature can absorb another creature whose size is at most twice the size of itself.\nWhen a creature of size A and color B absorbs another creature of size C and color D (C \\leq 2 \\times A), they will merge into one creature of size A+C and color B.\nHere, depending on the sizes of two creatures, it is possible that both of them can absorb the other.\n\nSnuke has been watching these creatures merge over and over and ultimately become one creature.\nFind the number of the possible colors of this creature.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\n\nOutput\n\nPrint the number of the possible colors of the last remaining creature after the N creatures repeatedly merge and ultimately become one creature.\n\nSample Input 1\n\n3\n3 1 4\n\nSample Output 1\n\n2\n\nThe possible colors of the last remaining creature are colors 1 and 3.\nFor example, when the creature of color 3 absorbs the creature of color 2, then the creature of color 1 absorbs the creature of color 3, the color of the last remaining creature will be color 1.\n\nSample Input 2\n\n5\n1 1 1 1 1\n\nSample Output 2\n\n5\n\nThere may be multiple creatures of the same size.\n\nSample Input 3\n\n6\n40 1 30 2 7 20\n\nSample Output 3\n\n4", "sample_input": "3\n3 1 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03786", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke found N strange creatures.\nEach creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively.\n\nEvery creature can absorb another creature whose size is at most twice the size of itself.\nWhen a creature of size A and color B absorbs another creature of size C and color D (C \\leq 2 \\times A), they will merge into one creature of size A+C and color B.\nHere, depending on the sizes of two creatures, it is possible that both of them can absorb the other.\n\nSnuke has been watching these creatures merge over and over and ultimately become one creature.\nFind the number of the possible colors of this creature.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\n\nOutput\n\nPrint the number of the possible colors of the last remaining creature after the N creatures repeatedly merge and ultimately become one creature.\n\nSample Input 1\n\n3\n3 1 4\n\nSample Output 1\n\n2\n\nThe possible colors of the last remaining creature are colors 1 and 3.\nFor example, when the creature of color 3 absorbs the creature of color 2, then the creature of color 1 absorbs the creature of color 3, the color of the last remaining creature will be color 1.\n\nSample Input 2\n\n5\n1 1 1 1 1\n\nSample Output 2\n\n5\n\nThere may be multiple creatures of the same size.\n\nSample Input 3\n\n6\n40 1 30 2 7 20\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 215, "cpu_time_ms": 48, "memory_kb": 17140}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s169414535", "group_id": "codeNet:p03795", "input_text": "= floor($c / 2)) {\n echo floor($c / 2).\"\\n\";\n} else {\n echo 2 * $s + floor( ($c - 2 * $s ) / 4) . \"\\n\";\n}", "language": "PHP", "metadata": {"date": 1577514441, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03797.html", "problem_id": "p03797", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03797/input.txt", "sample_output_relpath": "derived/input_output/data/p03797/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03797/PHP/s202964421.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s202964421", "user_id": "u734434881"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "= floor($c / 2)) {\n echo floor($c / 2).\"\\n\";\n} else {\n echo 2 * $s + floor( ($c - 2 * $s ) / 4) . \"\\n\";\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "sample_input": "1 6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03797", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 215, "cpu_time_ms": 10, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s150478501", "group_id": "codeNet:p03798", "input_text": " $b || $a == 1){\n\techo \"Alice\\n\";\n}else echo \"Bob\\n\";\n?>", "language": "PHP", "metadata": {"date": 1486866762, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03803.html", "problem_id": "p03803", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03803/input.txt", "sample_output_relpath": "derived/input_output/data/p03803/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03803/PHP/s619206595.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s619206595", "user_id": "u299791633"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": " $b || $a == 1){\n\techo \"Alice\\n\";\n}else echo \"Bob\\n\";\n?>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAlice and Bob are playing One Card Poker.\n\nOne Card Poker is a two-player game using playing cards.\n\nEach card in this game shows an integer between 1 and 13, inclusive.\n\nThe strength of a card is determined by the number written on it, as follows:\n\nWeak 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 Strong\n\nOne Card Poker is played as follows:\n\nEach player picks one card from the deck. The chosen card becomes the player's hand.\n\nThe players reveal their hands to each other. The player with the stronger card wins the game.\n\nIf their cards are equally strong, the game is drawn.\n\nYou are watching Alice and Bob playing the game, and can see their hands.\n\nThe number written on Alice's card is A, and the number written on Bob's card is B.\n\nWrite a program to determine the outcome of the game.\n\nConstraints\n\n1≦A≦13\n\n1≦B≦13\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\nAlice\n\n8 is written on Alice's card, and 6 is written on Bob's card.\nAlice has the stronger card, and thus the output should be Alice.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nDraw\n\nSince their cards have the same number, the game will be drawn.\n\nSample Input 3\n\n13 1\n\nSample Output 3\n\nBob", "sample_input": "8 6\n"}, "reference_outputs": ["Alice\n"], "source_document_id": "p03803", "source_text": "Score : 100 points\n\nProblem Statement\n\nAlice and Bob are playing One Card Poker.\n\nOne Card Poker is a two-player game using playing cards.\n\nEach card in this game shows an integer between 1 and 13, inclusive.\n\nThe strength of a card is determined by the number written on it, as follows:\n\nWeak 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 Strong\n\nOne Card Poker is played as follows:\n\nEach player picks one card from the deck. The chosen card becomes the player's hand.\n\nThe players reveal their hands to each other. The player with the stronger card wins the game.\n\nIf their cards are equally strong, the game is drawn.\n\nYou are watching Alice and Bob playing the game, and can see their hands.\n\nThe number written on Alice's card is A, and the number written on Bob's card is B.\n\nWrite a program to determine the outcome of the game.\n\nConstraints\n\n1≦A≦13\n\n1≦B≦13\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\nAlice\n\n8 is written on Alice's card, and 6 is written on Bob's card.\nAlice has the stronger card, and thus the output should be Alice.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nDraw\n\nSince their cards have the same number, the game will be drawn.\n\nSample Input 3\n\n13 1\n\nSample Output 3\n\nBob", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 190, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s839695045", "group_id": "codeNet:p03804", "input_text": "", "language": "PHP", "metadata": {"date": 1578585801, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03804/input.txt", "sample_output_relpath": "derived/input_output/data/p03804/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03804/PHP/s529678205.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s529678205", "user_id": "u415671616"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "sample_input": "3 2\n#.#\n.#.\n#.#\n#.\n.#\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03804", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 588, "cpu_time_ms": 50, "memory_kb": 4856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s900687524", "group_id": "codeNet:p03806", "input_text": " $va) {\n foreach ($va as $b => $c) {\n $price_map[$i + 1][$a][$b] = $c;\n $price_map[$i + 1][$a + $drug[$i][\"a\"]][$b + $drug[$i][\"b\"]] = $c + $drug[$i][\"c\"];\n }\n }\n }\n $min_c = $n * 100 + 1;\n for ($i = 1; $i <= $n; $i++) {\n foreach ($price_map[$i] as $a => $va) {\n foreach ($va as $b => $c) {\n if (($a/$ma == $b/$mb) && ($c != 0 && $c < $min_c)) {\n $min_c = $c;\n }\n }\n }\n }\n if ($min_c == ($maxc + 1)) {\n echo \"-1\";\n } else {\n echo $min_c;\n }\n }\n}\n\n$object = new main();\n$object->run();\n", "language": "PHP", "metadata": {"date": 1487353785, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03806.html", "problem_id": "p03806", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03806/input.txt", "sample_output_relpath": "derived/input_output/data/p03806/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03806/PHP/s900687524.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s900687524", "user_id": "u832841302"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $va) {\n foreach ($va as $b => $c) {\n $price_map[$i + 1][$a][$b] = $c;\n $price_map[$i + 1][$a + $drug[$i][\"a\"]][$b + $drug[$i][\"b\"]] = $c + $drug[$i][\"c\"];\n }\n }\n }\n $min_c = $n * 100 + 1;\n for ($i = 1; $i <= $n; $i++) {\n foreach ($price_map[$i] as $a => $va) {\n foreach ($va as $b => $c) {\n if (($a/$ma == $b/$mb) && ($c != 0 && $c < $min_c)) {\n $min_c = $c;\n }\n }\n }\n }\n if ($min_c == ($maxc + 1)) {\n echo \"-1\";\n } else {\n echo $min_c;\n }\n }\n}\n\n$object = new main();\n$object->run();\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nDolphin is planning to generate a small amount of a certain chemical substance C.\n\nIn order to generate the substance C, he must prepare a solution which is a mixture of two substances A and B in the ratio of M_a:M_b.\n\nHe does not have any stock of chemicals, however, so he will purchase some chemicals at a local pharmacy.\n\nThe pharmacy sells N kinds of chemicals. For each kind of chemical, there is exactly one package of that chemical in stock.\n\nThe package of chemical i contains a_i grams of the substance A and b_i grams of the substance B, and is sold for c_i yen (the currency of Japan).\n\nDolphin will purchase some of these packages. For some reason, he must use all contents of the purchased packages to generate the substance C.\n\nFind the minimum amount of money required to generate the substance C.\n\nIf it is not possible to generate the substance C by purchasing any combination of packages at the pharmacy, report that fact.\n\nConstraints\n\n1≦N≦40\n\n1≦a_i,b_i≦10\n\n1≦c_i≦100\n\n1≦M_a,M_b≦10\n\ngcd(M_a,M_b)=1\n\na_i, b_i, c_i, M_a and M_b are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M_a M_b\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the minimum amount of money required to generate the substance C. If it is not possible to generate the substance C, print -1 instead.\n\nSample Input 1\n\n3 1 1\n1 2 1\n2 1 2\n3 3 10\n\nSample Output 1\n\n3\n\nThe amount of money spent will be minimized by purchasing the packages of chemicals 1 and 2.\n\nIn this case, the mixture of the purchased chemicals will contain 3 grams of the substance A and 3 grams of the substance B, which are in the desired ratio: 3:3=1:1.\n\nThe total price of these packages is 3 yen.\n\nSample Input 2\n\n1 1 10\n10 10 10\n\nSample Output 2\n\n-1\n\nThe ratio 1:10 of the two substances A and B cannot be satisfied by purchasing any combination of the packages. Thus, the output should be -1.", "sample_input": "3 1 1\n1 2 1\n2 1 2\n3 3 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03806", "source_text": "Score : 400 points\n\nProblem Statement\n\nDolphin is planning to generate a small amount of a certain chemical substance C.\n\nIn order to generate the substance C, he must prepare a solution which is a mixture of two substances A and B in the ratio of M_a:M_b.\n\nHe does not have any stock of chemicals, however, so he will purchase some chemicals at a local pharmacy.\n\nThe pharmacy sells N kinds of chemicals. For each kind of chemical, there is exactly one package of that chemical in stock.\n\nThe package of chemical i contains a_i grams of the substance A and b_i grams of the substance B, and is sold for c_i yen (the currency of Japan).\n\nDolphin will purchase some of these packages. For some reason, he must use all contents of the purchased packages to generate the substance C.\n\nFind the minimum amount of money required to generate the substance C.\n\nIf it is not possible to generate the substance C by purchasing any combination of packages at the pharmacy, report that fact.\n\nConstraints\n\n1≦N≦40\n\n1≦a_i,b_i≦10\n\n1≦c_i≦100\n\n1≦M_a,M_b≦10\n\ngcd(M_a,M_b)=1\n\na_i, b_i, c_i, M_a and M_b are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M_a M_b\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the minimum amount of money required to generate the substance C. If it is not possible to generate the substance C, print -1 instead.\n\nSample Input 1\n\n3 1 1\n1 2 1\n2 1 2\n3 3 10\n\nSample Output 1\n\n3\n\nThe amount of money spent will be minimized by purchasing the packages of chemicals 1 and 2.\n\nIn this case, the mixture of the purchased chemicals will contain 3 grams of the substance A and 3 grams of the substance B, which are in the desired ratio: 3:3=1:1.\n\nThe total price of these packages is 3 yen.\n\nSample Input 2\n\n1 1 10\n10 10 10\n\nSample Output 2\n\n-1\n\nThe ratio 1:10 of the two substances A and B cannot be satisfied by purchasing any combination of the packages. Thus, the output should be -1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1210, "cpu_time_ms": 221, "memory_kb": 36596}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s912212080", "group_id": "codeNet:p03807", "input_text": " 1) {\n $e = 1;\n }\n $o %= 2;\n if ($e == 1 && $o == 1) {\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n }\n\n\n", "language": "PHP", "metadata": {"date": 1486260896, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03807.html", "problem_id": "p03807", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03807/input.txt", "sample_output_relpath": "derived/input_output/data/p03807/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03807/PHP/s944081291.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s944081291", "user_id": "u195912432"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": " 1) {\n $e = 1;\n }\n $o %= 2;\n if ($e == 1 && $o == 1) {\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n }\n\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers written on a blackboard. The i-th integer is A_i.\n\nTakahashi will repeatedly perform the following operation on these numbers:\n\nSelect a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.\n\nThen, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.\n\nDetermine whether it is possible to have only one integer on the blackboard.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\n\nA_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\n\nOutput\n\nIf it is possible to have only one integer on the blackboard, print YES. Otherwise, print NO.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYES\n\nIt is possible to have only one integer on the blackboard, as follows:\n\nErase 1 and 3 from the blackboard, then write 4. Now, there are two integers on the blackboard: 2 and 4.\n\nErase 2 and 4 from the blackboard, then write 6. Now, there is only one integer on the blackboard: 6.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\nNO", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03807", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers written on a blackboard. The i-th integer is A_i.\n\nTakahashi will repeatedly perform the following operation on these numbers:\n\nSelect a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.\n\nThen, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.\n\nDetermine whether it is possible to have only one integer on the blackboard.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\n\nA_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\n\nOutput\n\nIf it is possible to have only one integer on the blackboard, print YES. Otherwise, print NO.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYES\n\nIt is possible to have only one integer on the blackboard, as follows:\n\nErase 1 and 3 from the blackboard, then write 4. Now, there are two integers on the blackboard: 2 and 4.\n\nErase 2 and 4 from the blackboard, then write 6. Now, there is only one integer on the blackboard: 6.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 596, "cpu_time_ms": 44, "memory_kb": 11124}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s634155800", "group_id": "codeNet:p03809", "input_text": "p = explode(\" \", $line);\n for ($i = count($this->p);$i > 0;$i--) {\n $this->p[$i] = $this->p[$i - 1];\n unset($this->p[$i - 1]);\n }\n $this->adv = array();\n for ($i = 0; $i < $n - 1; $i++) {\n $line = trim(fgets(STDIN));\n $arr = explode(\" \", $line);\n $this->adv[$arr[0]][$arr[1]] = null;\n $this->adv[$arr[1]][$arr[0]] = null;\n }\n $flag = 0;\n $sum_c = 0;\n foreach ($this->adv[1] as $c => $t) {\n if (is_null($t)) {\n $sum_c += $this->t(1, $c);\n } else {\n $sum_c += $t;\n }\n }\n\n if (count($this->adv[1]) == 1) {\n $d = $this->p[1];\n } else {\n $d = 2 * $this->p[1];\n }\n\n if ($d != $sum_c) {\n $flag = 1;\n }\n\n if ($flag) {\n echo \"NO\";\n } else {\n echo \"YES\";\n }\n}\n\n\nfunction t($root, $cur) {\n if (!is_null($this->adv[$cur][$root])) {\n return $this->adv[$cur][$root];\n } elseif (count($this->adv[$cur]) == 1) {\n $this->adv[$root][$cur] = $this->p[$cur];\n $this->adv[$cur][$root] = $this->p[$cur];\n return $this->p[$cur];\n }\n $sum_c = 0;\n $max = 0;\n foreach ($this->adv[$cur] as $c => $t) {\n if ($root != $c) {\n $c_t = $this->t($cur, $c);\n $sum_c += $c_t;\n if ($c_t > $max) {\n $max = $c_t;\n }\n }\n }\n\n $cur_t = 2 * $this->p[$cur] - $sum_c;\n if ($cur_t < 0) {\n echo \"NO\";\n exit;\n } elseif (count($this->adv[$cur]) == 2 && $cur_t != $sum_c && $cur_t != 0) {\n echo \"NO\";\n exit;\n } elseif (($cur_t + $sum_c - $max) < ($max)) {\n echo \"NO\";\n exit;\n }\n $this->adv[$root][$cur] = $cur_t;\n $this->adv[$cur][$root] = $cur_t;\n return $cur_t;\n}\n\n}\n\n$object = new main();\n$object->run();\n", "language": "PHP", "metadata": {"date": 1486496934, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03809.html", "problem_id": "p03809", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03809/input.txt", "sample_output_relpath": "derived/input_output/data/p03809/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03809/PHP/s634155800.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s634155800", "user_id": "u823610167"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "p = explode(\" \", $line);\n for ($i = count($this->p);$i > 0;$i--) {\n $this->p[$i] = $this->p[$i - 1];\n unset($this->p[$i - 1]);\n }\n $this->adv = array();\n for ($i = 0; $i < $n - 1; $i++) {\n $line = trim(fgets(STDIN));\n $arr = explode(\" \", $line);\n $this->adv[$arr[0]][$arr[1]] = null;\n $this->adv[$arr[1]][$arr[0]] = null;\n }\n $flag = 0;\n $sum_c = 0;\n foreach ($this->adv[1] as $c => $t) {\n if (is_null($t)) {\n $sum_c += $this->t(1, $c);\n } else {\n $sum_c += $t;\n }\n }\n\n if (count($this->adv[1]) == 1) {\n $d = $this->p[1];\n } else {\n $d = 2 * $this->p[1];\n }\n\n if ($d != $sum_c) {\n $flag = 1;\n }\n\n if ($flag) {\n echo \"NO\";\n } else {\n echo \"YES\";\n }\n}\n\n\nfunction t($root, $cur) {\n if (!is_null($this->adv[$cur][$root])) {\n return $this->adv[$cur][$root];\n } elseif (count($this->adv[$cur]) == 1) {\n $this->adv[$root][$cur] = $this->p[$cur];\n $this->adv[$cur][$root] = $this->p[$cur];\n return $this->p[$cur];\n }\n $sum_c = 0;\n $max = 0;\n foreach ($this->adv[$cur] as $c => $t) {\n if ($root != $c) {\n $c_t = $this->t($cur, $c);\n $sum_c += $c_t;\n if ($c_t > $max) {\n $max = $c_t;\n }\n }\n }\n\n $cur_t = 2 * $this->p[$cur] - $sum_c;\n if ($cur_t < 0) {\n echo \"NO\";\n exit;\n } elseif (count($this->adv[$cur]) == 2 && $cur_t != $sum_c && $cur_t != 0) {\n echo \"NO\";\n exit;\n } elseif (($cur_t + $sum_c - $max) < ($max)) {\n echo \"NO\";\n exit;\n }\n $this->adv[$root][$cur] = $cur_t;\n $this->adv[$cur][$root] = $cur_t;\n return $cur_t;\n}\n\n}\n\n$object = new main();\n$object->run();\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nThere is a tree with N vertices, numbered 1 through N.\nThe i-th of the N-1 edges connects vertices a_i and b_i.\n\nCurrently, there are A_i stones placed on vertex i.\nDetermine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation:\n\nSelect a pair of different leaves. Then, remove exactly one stone from every vertex on the path between those two vertices.\nHere, a leaf is a vertex of the tree whose degree is 1, and the selected leaves themselves are also considered as vertices on the path connecting them.\n\nNote that the operation cannot be performed if there is a vertex with no stone on the path.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ a_i,b_i ≦ N\n\n0 ≦ A_i ≦ 10^9\n\nThe given graph is a tree.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf it is possible to remove all the stones from the vertices, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n1 2 1 1 2\n2 4\n5 2\n3 2\n1 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed, as follows:\n\nSelect vertices 4 and 5. Then, there is one stone remaining on each vertex except 4.\n\nSelect vertices 1 and 5. Then, there is no stone on any vertex.\n\nSample Input 2\n\n3\n1 2 1\n1 2\n2 3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n6\n3 2 2 2 2 2\n1 2\n2 3\n1 4\n1 5\n4 6\n\nSample Output 3\n\nYES", "sample_input": "5\n1 2 1 1 2\n2 4\n5 2\n3 2\n1 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03809", "source_text": "Score : 700 points\n\nProblem Statement\n\nThere is a tree with N vertices, numbered 1 through N.\nThe i-th of the N-1 edges connects vertices a_i and b_i.\n\nCurrently, there are A_i stones placed on vertex i.\nDetermine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation:\n\nSelect a pair of different leaves. Then, remove exactly one stone from every vertex on the path between those two vertices.\nHere, a leaf is a vertex of the tree whose degree is 1, and the selected leaves themselves are also considered as vertices on the path connecting them.\n\nNote that the operation cannot be performed if there is a vertex with no stone on the path.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ a_i,b_i ≦ N\n\n0 ≦ A_i ≦ 10^9\n\nThe given graph is a tree.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf it is possible to remove all the stones from the vertices, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n1 2 1 1 2\n2 4\n5 2\n3 2\n1 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed, as follows:\n\nSelect vertices 4 and 5. Then, there is one stone remaining on each vertex except 4.\n\nSelect vertices 1 and 5. Then, there is no stone on any vertex.\n\nSample Input 2\n\n3\n1 2 1\n1 2\n2 3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n6\n3 2 2 2 2 2\n1 2\n2 3\n1 4\n1 5\n4 6\n\nSample Output 3\n\nYES", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1963, "cpu_time_ms": 1674, "memory_kb": 323248}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s269038943", "group_id": "codeNet:p03813", "input_text": "", "language": "PHP", "metadata": {"date": 1560446562, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03813.html", "problem_id": "p03813", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03813/input.txt", "sample_output_relpath": "derived/input_output/data/p03813/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03813/PHP/s269038943.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s269038943", "user_id": "u775501928"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSmeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.\n\nYou are given Smeke's current rating, x. Print ABC if Smeke will participate in ABC, and print ARC otherwise.\n\nConstraints\n\n1 ≦ x ≦ 3{,}000\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1000\n\nSample Output 1\n\nABC\n\nSmeke's current rating is less than 1200, thus the output should be ABC.\n\nSample Input 2\n\n2000\n\nSample Output 2\n\nARC\n\nSmeke's current rating is not less than 1200, thus the output should be ARC.", "sample_input": "1000\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03813", "source_text": "Score : 100 points\n\nProblem Statement\n\nSmeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.\n\nYou are given Smeke's current rating, x. Print ABC if Smeke will participate in ABC, and print ARC otherwise.\n\nConstraints\n\n1 ≦ x ≦ 3{,}000\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1000\n\nSample Output 1\n\nABC\n\nSmeke's current rating is less than 1200, thus the output should be ABC.\n\nSample Input 2\n\n2000\n\nSample Output 2\n\nARC\n\nSmeke's current rating is not less than 1200, thus the output should be ARC.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 67, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s924759617", "group_id": "codeNet:p03817", "input_text": "", "language": "PHP", "metadata": {"date": 1485658931, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03817.html", "problem_id": "p03817", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03817/input.txt", "sample_output_relpath": "derived/input_output/data/p03817/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03817/PHP/s924759617.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s924759617", "user_id": "u896218048"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "sample_input": "7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03817", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 409, "cpu_time_ms": 18, "memory_kb": 3064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s735967794", "group_id": "codeNet:p03824", "input_text": ">= 1;\n $p++;\n }\n return $p;\n }\n?>\n", "language": "PHP", "metadata": {"date": 1485209202, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03824.html", "problem_id": "p03824", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03824/input.txt", "sample_output_relpath": "derived/input_output/data/p03824/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03824/PHP/s735967794.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s735967794", "user_id": "u384109138"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": ">= 1;\n $p++;\n }\n return $p;\n }\n?>\n", "problem_context": "Score : 1400 points\n\nProblem Statement\n\nWe will recursively define uninity of a tree, as follows: (Uni is a Japanese word for sea urchins.)\n\nA tree consisting of one vertex is a tree of uninity 0.\n\nSuppose there are zero or more trees of uninity k, and a vertex v. If a vertex is selected from each tree of uninity k and connected to v with an edge, the resulting tree is a tree of uninity k+1.\n\nIt can be shown that a tree of uninity k is also a tree of uninity k+1,k+2,..., and so forth.\n\nYou are given a tree consisting of N vertices.\nThe vertices of the tree are numbered 1 through N, and the i-th of the N-1 edges connects vertices a_i and b_i.\n\nFind the minimum k such that the given tree is a tree of uninity k.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ a_i, b_i ≦ N(1 ≦ i ≦ N-1)\n\nThe given graph is a tree.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nPrint the minimum k such that the given tree is a tree of uninity k.\n\nSample Input 1\n\n7\n1 2\n2 3\n2 4\n4 6\n6 7\n7 5\n\nSample Output 1\n\n2\n\nA tree of uninity 1 consisting of vertices 1, 2, 3 and 4 can be constructed from the following: a tree of uninity 0 consisting of vertex 1, a tree of uninity 0 consisting of vertex 3, a tree of uninity 0 consisting of vertex 4, and vertex 2.\n\nA tree of uninity 1 consisting of vertices 5 and 7 can be constructed from the following: a tree of uninity 1 consisting of vertex 5, and vertex 7.\n\nA tree of uninity 2 consisting of vertices 1, 2, 3, 4, 5, 6 and 7 can be constructed from the following: a tree of uninity 1 consisting of vertex 1, 2, 3 and 4, a tree of uninity 1 consisting of vertex 5 and 7, and vertex 6.\n\nSample Input 2\n\n12\n1 2\n2 3\n2 4\n4 5\n5 6\n6 7\n7 8\n5 9\n9 10\n10 11\n11 12\n\nSample Output 2\n\n3", "sample_input": "7\n1 2\n2 3\n2 4\n4 6\n6 7\n7 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03824", "source_text": "Score : 1400 points\n\nProblem Statement\n\nWe will recursively define uninity of a tree, as follows: (Uni is a Japanese word for sea urchins.)\n\nA tree consisting of one vertex is a tree of uninity 0.\n\nSuppose there are zero or more trees of uninity k, and a vertex v. If a vertex is selected from each tree of uninity k and connected to v with an edge, the resulting tree is a tree of uninity k+1.\n\nIt can be shown that a tree of uninity k is also a tree of uninity k+1,k+2,..., and so forth.\n\nYou are given a tree consisting of N vertices.\nThe vertices of the tree are numbered 1 through N, and the i-th of the N-1 edges connects vertices a_i and b_i.\n\nFind the minimum k such that the given tree is a tree of uninity k.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ a_i, b_i ≦ N(1 ≦ i ≦ N-1)\n\nThe given graph is a tree.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nPrint the minimum k such that the given tree is a tree of uninity k.\n\nSample Input 1\n\n7\n1 2\n2 3\n2 4\n4 6\n6 7\n7 5\n\nSample Output 1\n\n2\n\nA tree of uninity 1 consisting of vertices 1, 2, 3 and 4 can be constructed from the following: a tree of uninity 0 consisting of vertex 1, a tree of uninity 0 consisting of vertex 3, a tree of uninity 0 consisting of vertex 4, and vertex 2.\n\nA tree of uninity 1 consisting of vertices 5 and 7 can be constructed from the following: a tree of uninity 1 consisting of vertex 5, and vertex 7.\n\nA tree of uninity 2 consisting of vertices 1, 2, 3, 4, 5, 6 and 7 can be constructed from the following: a tree of uninity 1 consisting of vertex 1, 2, 3 and 4, a tree of uninity 1 consisting of vertex 5 and 7, and vertex 6.\n\nSample Input 2\n\n12\n1 2\n2 3\n2 4\n4 5\n5 6\n6 7\n7 8\n5 9\n9 10\n10 11\n11 12\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1012, "cpu_time_ms": 375, "memory_kb": 63568}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s592869059", "group_id": "codeNet:p03829", "input_text": " $b){\n $ans += $b;\n }else{\n $ans += $a*($x[$i]-$x[$i-1]);\n }\n }\n echo $ans;", "language": "PHP", "metadata": {"date": 1594579243, "filename_ext": "php", "original_language": "PHP (7.4.4)", "problem_description_relpath": "problem_descriptions/p03829.html", "problem_id": "p03829", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03829/input.txt", "sample_output_relpath": "derived/input_output/data/p03829/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03829/PHP/s592869059.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s592869059", "user_id": "u800169017"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": " $b){\n $ans += $b;\n }else{\n $ans += $a*($x[$i]-$x[$i-1]);\n }\n }\n echo $ans;", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N towns on a line running east-west.\nThe towns are numbered 1 through N, in order from west to east.\nEach point on the line has a one-dimensional coordinate, and a point that is farther east has a greater coordinate value.\nThe coordinate of town i is X_i.\n\nYou are now at town 1, and you want to visit all the other towns.\nYou have two ways to travel:\n\nWalk on the line.\nYour fatigue level increases by A each time you travel a distance of 1, regardless of direction.\n\nTeleport to any location of your choice.\nYour fatigue level increases by B, regardless of the distance covered.\n\nFind the minimum possible total increase of your fatigue level when you visit all the towns in these two ways.\n\nConstraints\n\nAll input values are integers.\n\n2≤N≤10^5\n\n1≤X_i≤10^9\n\nFor all i(1≤i≤N-1), X_i", "language": "PHP", "metadata": {"date": 1588041544, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03834.html", "problem_id": "p03834", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03834/input.txt", "sample_output_relpath": "derived/input_output/data/p03834/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03834/PHP/s890341908.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s890341908", "user_id": "u127740906"}, "prompt_components": {"gold_output": "happy newyear enjoy\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\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 wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "sample_input": "happy,newyear,enjoy\n"}, "reference_outputs": ["happy newyear enjoy\n"], "source_document_id": "p03834", "source_text": "Score : 100 points\n\nProblem Statement\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 wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 114, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s872309174", "group_id": "codeNet:p03834", "input_text": "", "language": "PHP", "metadata": {"date": 1576550824, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03834.html", "problem_id": "p03834", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03834/input.txt", "sample_output_relpath": "derived/input_output/data/p03834/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03834/PHP/s872309174.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s872309174", "user_id": "u723414064"}, "prompt_components": {"gold_output": "happy newyear enjoy\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\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 wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "sample_input": "happy,newyear,enjoy\n"}, "reference_outputs": ["happy newyear enjoy\n"], "source_document_id": "p03834", "source_text": "Score : 100 points\n\nProblem Statement\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 wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 82, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s328964710", "group_id": "codeNet:p03834", "input_text": " ", "language": "PHP", "metadata": {"date": 1483840976, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03834.html", "problem_id": "p03834", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03834/input.txt", "sample_output_relpath": "derived/input_output/data/p03834/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03834/PHP/s328964710.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s328964710", "user_id": "u794603719"}, "prompt_components": {"gold_output": "happy newyear enjoy\n", "input_to_evaluate": " ", "problem_context": "Score : 100 points\n\nProblem Statement\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 wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "sample_input": "happy,newyear,enjoy\n"}, "reference_outputs": ["happy newyear enjoy\n"], "source_document_id": "p03834", "source_text": "Score : 100 points\n\nProblem Statement\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 wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 91, "cpu_time_ms": 19, "memory_kb": 3704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s734735038", "group_id": "codeNet:p03836", "input_text": "", "language": "PHP", "metadata": {"date": 1559527843, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03836.html", "problem_id": "p03836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03836/input.txt", "sample_output_relpath": "derived/input_output/data/p03836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03836/PHP/s734735038.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s734735038", "user_id": "u308787251"}, "prompt_components": {"gold_output": "UURDDLLUUURRDRDDDLLU\n", "input_to_evaluate": "", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.\n\nCurrently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.\n\nHere, both the x- and y-coordinates before and after each movement must be integers.\n\nHe will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).\n\nHere, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).\n\nUnder this condition, find a shortest path for him.\n\nConstraints\n\n-1000 ≤ sx < tx ≤ 1000\n\n-1000 ≤ sy < ty ≤ 1000\n\nsx,sy,tx and ty are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nsx sy tx ty\n\nOutput\n\nPrint a string S that represents a shortest path for Dolphin.\n\nThe i-th character in S should correspond to his i-th movement.\n\nThe directions of the movements should be indicated by the following characters:\n\nU: Up\n\nD: Down\n\nL: Left\n\nR: Right\n\nIf there exist multiple shortest paths under the condition, print any of them.\n\nSample Input 1\n\n0 0 1 2\n\nSample Output 1\n\nUURDDLLUUURRDRDDDLLU\n\nOne possible shortest path is:\n\nGoing from (sx,sy) to (tx,ty) for the first time: (0,0) → (0,1) → (0,2) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the first time: (1,2) → (1,1) → (1,0) → (0,0)\n\nGoing from (sx,sy) to (tx,ty) for the second time: (0,0) → (-1,0) → (-1,1) → (-1,2) → (-1,3) → (0,3) → (1,3) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the second time: (1,2) → (2,2) → (2,1) → (2,0) → (2,-1) → (1,-1) → (0,-1) → (0,0)\n\nSample Input 2\n\n-2 -2 1 1\n\nSample Output 2\n\nUURRURRDDDLLDLLULUUURRURRDDDLLDL", "sample_input": "0 0 1 2\n"}, "reference_outputs": ["UURDDLLUUURRDRDDDLLU\n"], "source_document_id": "p03836", "source_text": "Score : 300 points\n\nProblem Statement\n\nDolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.\n\nCurrently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.\n\nHere, both the x- and y-coordinates before and after each movement must be integers.\n\nHe will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).\n\nHere, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).\n\nUnder this condition, find a shortest path for him.\n\nConstraints\n\n-1000 ≤ sx < tx ≤ 1000\n\n-1000 ≤ sy < ty ≤ 1000\n\nsx,sy,tx and ty are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nsx sy tx ty\n\nOutput\n\nPrint a string S that represents a shortest path for Dolphin.\n\nThe i-th character in S should correspond to his i-th movement.\n\nThe directions of the movements should be indicated by the following characters:\n\nU: Up\n\nD: Down\n\nL: Left\n\nR: Right\n\nIf there exist multiple shortest paths under the condition, print any of them.\n\nSample Input 1\n\n0 0 1 2\n\nSample Output 1\n\nUURDDLLUUURRDRDDDLLU\n\nOne possible shortest path is:\n\nGoing from (sx,sy) to (tx,ty) for the first time: (0,0) → (0,1) → (0,2) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the first time: (1,2) → (1,1) → (1,0) → (0,0)\n\nGoing from (sx,sy) to (tx,ty) for the second time: (0,0) → (-1,0) → (-1,1) → (-1,2) → (-1,3) → (0,3) → (1,3) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the second time: (1,2) → (2,2) → (2,1) → (2,0) → (2,-1) → (1,-1) → (0,-1) → (0,0)\n\nSample Input 2\n\n-2 -2 1 1\n\nSample Output 2\n\nUURRURRDDDLLDLLULUUURRURRDDDLLDL", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 393, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s690421126", "group_id": "codeNet:p03836", "input_text": " $m[$i][$j] + $m[$j][$k]) {\n if (DEBUG) echo \"X {$i} {$k} - {$i} {$j} + {$j} {$k}\\n\";\n $ans++;\n }\n }\n }\n}\n\necho ($ans / 2) . PHP_EOL;\n", "language": "PHP", "metadata": {"date": 1483855902, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03837.html", "problem_id": "p03837", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03837/input.txt", "sample_output_relpath": "derived/input_output/data/p03837/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03837/PHP/s460504509.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s460504509", "user_id": "u195912432"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": " $m[$i][$j] + $m[$j][$k]) {\n if (DEBUG) echo \"X {$i} {$k} - {$i} {$j} + {$j} {$k}\\n\";\n $ans++;\n }\n }\n }\n}\n\necho ($ans / 2) . PHP_EOL;\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges.\n\nThe i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i.\n\nHere, a self-loop is an edge where a_i = b_i (1≤i≤M), and double edges are two edges where (a_i,b_i)=(a_j,b_j) or (a_i,b_i)=(b_j,a_j) (1≤i= 0 && $y >= 0) {\n if ($x < $y) {\n echo ($y - $x) . PHP_EOL;\n exit;\n } elseif ($y == 0) {\n echo (($x - $y) + 1 ) . PHP_EOL;\n exit;\n } else {\n echo (($x - $y) + 2 ) . PHP_EOL;\n exit;\n }\n } elseif ($x >= 0 && $y < 0) {\n if ($x >= -$y) {\n echo ($x + $y + 1) . PHP_EOL;\n exit;\n } else {\n echo (-$y - $x + 1) . PHP_EOL;\n exit;\n }\n } elseif ($x < 0 && $y >= 0) {\n if ($x == -$y) {\n echo \"1\\n\";\n exit;\n } elseif (-$x >= $y) {\n echo (-$x - $y + 1) . PHP_EOL;\n exit;\n } else {\n $w1 = $y - $x;\n $w2 = $y + $x + 1;\n echo min($w1, $w2) . PHP_EOL;\n exit;\n }\n } elseif ($x < 0 && $y < 0) {\n if ($x > $y) {\n echo ($x - $y + 2) . PHP_EOL;\n exit;\n } else {\n echo ($y - $x) . PHP_EOL;\n exit;\n }\n }\n", "language": "PHP", "metadata": {"date": 1482719211, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03838.html", "problem_id": "p03838", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03838/input.txt", "sample_output_relpath": "derived/input_output/data/p03838/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03838/PHP/s631777787.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s631777787", "user_id": "u195912432"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "= 0 && $y >= 0) {\n if ($x < $y) {\n echo ($y - $x) . PHP_EOL;\n exit;\n } elseif ($y == 0) {\n echo (($x - $y) + 1 ) . PHP_EOL;\n exit;\n } else {\n echo (($x - $y) + 2 ) . PHP_EOL;\n exit;\n }\n } elseif ($x >= 0 && $y < 0) {\n if ($x >= -$y) {\n echo ($x + $y + 1) . PHP_EOL;\n exit;\n } else {\n echo (-$y - $x + 1) . PHP_EOL;\n exit;\n }\n } elseif ($x < 0 && $y >= 0) {\n if ($x == -$y) {\n echo \"1\\n\";\n exit;\n } elseif (-$x >= $y) {\n echo (-$x - $y + 1) . PHP_EOL;\n exit;\n } else {\n $w1 = $y - $x;\n $w2 = $y + $x + 1;\n echo min($w1, $w2) . PHP_EOL;\n exit;\n }\n } elseif ($x < 0 && $y < 0) {\n if ($x > $y) {\n echo ($x - $y + 2) . PHP_EOL;\n exit;\n } else {\n echo ($y - $x) . PHP_EOL;\n exit;\n }\n }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has a calculator. It has a display and two buttons.\n\nInitially, the display shows an integer x.\nSnuke wants to change this value into another integer y, by pressing the following two buttons some number of times in arbitrary order:\n\nButton A: When pressed, the value on the display is incremented by 1.\n\nButton B: When pressed, the sign of the value on the display is reversed.\n\nFind the minimum number of times Snuke needs to press the buttons to achieve his objective.\nIt can be shown that the objective is always achievable regardless of the values of the integers x and y.\n\nConstraints\n\nx and y are integers.\n\n|x|, |y| ≤ 10^9\n\nx and y are different.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nPrint the minimum number of times Snuke needs to press the buttons to achieve his objective.\n\nSample Input 1\n\n10 20\n\nSample Output 1\n\n10\n\nPress button A ten times.\n\nSample Input 2\n\n10 -10\n\nSample Output 2\n\n1\n\nPress button B once.\n\nSample Input 3\n\n-10 -20\n\nSample Output 3\n\n12\n\nPress the buttons as follows:\n\nPress button B once.\n\nPress button A ten times.\n\nPress button B once.", "sample_input": "10 20\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03838", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has a calculator. It has a display and two buttons.\n\nInitially, the display shows an integer x.\nSnuke wants to change this value into another integer y, by pressing the following two buttons some number of times in arbitrary order:\n\nButton A: When pressed, the value on the display is incremented by 1.\n\nButton B: When pressed, the sign of the value on the display is reversed.\n\nFind the minimum number of times Snuke needs to press the buttons to achieve his objective.\nIt can be shown that the objective is always achievable regardless of the values of the integers x and y.\n\nConstraints\n\nx and y are integers.\n\n|x|, |y| ≤ 10^9\n\nx and y are different.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nPrint the minimum number of times Snuke needs to press the buttons to achieve his objective.\n\nSample Input 1\n\n10 20\n\nSample Output 1\n\n10\n\nPress button A ten times.\n\nSample Input 2\n\n10 -10\n\nSample Output 2\n\n1\n\nPress button B once.\n\nSample Input 3\n\n-10 -20\n\nSample Output 3\n\n12\n\nPress the buttons as follows:\n\nPress button B once.\n\nPress button A ten times.\n\nPress button B once.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1379, "cpu_time_ms": 17, "memory_kb": 3064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s774053654", "group_id": "codeNet:p03844", "input_text": "", "language": "PHP", "metadata": {"date": 1576551741, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03860.html", "problem_id": "p03860", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03860/input.txt", "sample_output_relpath": "derived/input_output/data/p03860/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03860/PHP/s720251072.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s720251072", "user_id": "u723414064"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is going to open a contest named \"AtCoder s Contest\".\nHere, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.\n\nSnuke has decided to abbreviate the name of the contest as \"AxC\".\nHere, x is the uppercase English letter at the beginning of s.\n\nGiven the name of the contest, print the abbreviation of the name.\n\nConstraints\n\nThe length of s is between 1 and 100, inclusive.\n\nThe first character in s is an uppercase English letter.\n\nThe second and subsequent characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nAtCoder s Contest\n\nOutput\n\nPrint the abbreviation of the name of the contest.\n\nSample Input 1\n\nAtCoder Beginner Contest\n\nSample Output 1\n\nABC\n\nThe contest in which you are participating now.\n\nSample Input 2\n\nAtCoder Snuke Contest\n\nSample Output 2\n\nASC\n\nThis contest does not actually exist.\n\nSample Input 3\n\nAtCoder X Contest\n\nSample Output 3\n\nAXC", "sample_input": "AtCoder Beginner Contest\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03860", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is going to open a contest named \"AtCoder s Contest\".\nHere, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.\n\nSnuke has decided to abbreviate the name of the contest as \"AxC\".\nHere, x is the uppercase English letter at the beginning of s.\n\nGiven the name of the contest, print the abbreviation of the name.\n\nConstraints\n\nThe length of s is between 1 and 100, inclusive.\n\nThe first character in s is an uppercase English letter.\n\nThe second and subsequent characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nAtCoder s Contest\n\nOutput\n\nPrint the abbreviation of the name of the contest.\n\nSample Input 1\n\nAtCoder Beginner Contest\n\nSample Output 1\n\nABC\n\nThe contest in which you are participating now.\n\nSample Input 2\n\nAtCoder Snuke Contest\n\nSample Output 2\n\nASC\n\nThis contest does not actually exist.\n\nSample Input 3\n\nAtCoder X Contest\n\nSample Output 3\n\nAXC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 96, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s549599518", "group_id": "codeNet:p03860", "input_text": "", "language": "PHP", "metadata": {"date": 1482265169, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03860.html", "problem_id": "p03860", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03860/input.txt", "sample_output_relpath": "derived/input_output/data/p03860/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03860/PHP/s980313088.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s980313088", "user_id": "u229632297"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is going to open a contest named \"AtCoder s Contest\".\nHere, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.\n\nSnuke has decided to abbreviate the name of the contest as \"AxC\".\nHere, x is the uppercase English letter at the beginning of s.\n\nGiven the name of the contest, print the abbreviation of the name.\n\nConstraints\n\nThe length of s is between 1 and 100, inclusive.\n\nThe first character in s is an uppercase English letter.\n\nThe second and subsequent characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nAtCoder s Contest\n\nOutput\n\nPrint the abbreviation of the name of the contest.\n\nSample Input 1\n\nAtCoder Beginner Contest\n\nSample Output 1\n\nABC\n\nThe contest in which you are participating now.\n\nSample Input 2\n\nAtCoder Snuke Contest\n\nSample Output 2\n\nASC\n\nThis contest does not actually exist.\n\nSample Input 3\n\nAtCoder X Contest\n\nSample Output 3\n\nAXC", "sample_input": "AtCoder Beginner Contest\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03860", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is going to open a contest named \"AtCoder s Contest\".\nHere, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.\n\nSnuke has decided to abbreviate the name of the contest as \"AxC\".\nHere, x is the uppercase English letter at the beginning of s.\n\nGiven the name of the contest, print the abbreviation of the name.\n\nConstraints\n\nThe length of s is between 1 and 100, inclusive.\n\nThe first character in s is an uppercase English letter.\n\nThe second and subsequent characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nAtCoder s Contest\n\nOutput\n\nPrint the abbreviation of the name of the contest.\n\nSample Input 1\n\nAtCoder Beginner Contest\n\nSample Output 1\n\nABC\n\nThe contest in which you are participating now.\n\nSample Input 2\n\nAtCoder Snuke Contest\n\nSample Output 2\n\nASC\n\nThis contest does not actually exist.\n\nSample Input 3\n\nAtCoder X Contest\n\nSample Output 3\n\nAXC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 90, "cpu_time_ms": 16, "memory_kb": 3452}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s067719863", "group_id": "codeNet:p03861", "input_text": "\n", "language": "PHP", "metadata": {"date": 1591453061, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03861/input.txt", "sample_output_relpath": "derived/input_output/data/p03861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03861/PHP/s067719863.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s067719863", "user_id": "u348811384"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\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\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "sample_input": "4 8 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03861", "source_text": "Score : 200 points\n\nProblem Statement\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\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 195, "cpu_time_ms": 2104, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s957814138", "group_id": "codeNet:p03861", "input_text": "\n", "language": "PHP", "metadata": {"date": 1554746899, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03861/input.txt", "sample_output_relpath": "derived/input_output/data/p03861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03861/PHP/s976247572.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s976247572", "user_id": "u109193095"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\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\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "sample_input": "4 8 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03861", "source_text": "Score : 200 points\n\nProblem Statement\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\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 221, "cpu_time_ms": 12, "memory_kb": 3828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s723773352", "group_id": "codeNet:p03861", "input_text": " 1 && array_sum($aa) == 0 && array_sum($a) == 0 && $ans) {\n if (DEBUG) echo \"hell\\n\";\n while($a) {\n array_unshift($ans, array_pop($a));\n }\n break;\n }\n $ret = bigSub(bigKeta($aa), $b);\n // print_r($ret);\n // echo PHP_EOL;\n if ($ret === false) {\n if (!$a) break;\n array_unshift($aa, array_pop($a));\n if ($ans) {\n array_unshift($ans, 0);\n }\n } else {\n if (!$ans) {\n array_unshift($ans, 0);\n }\n $ans[0]++;\n $aa = bigGetArray($ret);\n }\n }\n // var_dump($ans);\n $ret = implode(\"\", array_reverse($ans));\n // echo \"amari: \" . implode(\"\", array_reverse($aa)) . PHP_EOL;\n $amari = implode(\"\", array_reverse($aa));\n if ($amari != 0 && $ceilFlag === true) {\n $ret = bigAdd($ret, \"1\");\n }\n if ($ret == null) {\n $ret = \"0\";\n }\n if (DEBUG) echo \"bigDiv: {$a} {$b} {$ret}\\n\";\n return $ret;\n}\n\nfunction bigAdd($a, $b) {\n if (gettype($a) != \"string\") {\n exit(\"arg1 not string\\n\");\n }\n if (gettype($b) != \"string\") {\n exit(\"arg2 not string\\n\");\n }\n $a = bigGetArray($a);\n $b = bigGetArray($b);\n $keta = max(count($a), count($b));\n for ($i = 0; $i < $keta; $i++) {\n $a_ex = isset($a[$i]) ? $a[$i] : 0;\n $b_ex = isset($b[$i]) ? $b[$i] : 0;\n $a[$i] = $a_ex + $b_ex;\n }\n $a = bigKeta($a);\n\n return $a;\n}\n\n/*\n param : string\n return: string \n*/\nfunction bigSub($a, $b) {\n // echo \"sub1: {$a} {$b}\\n\";\n if (gettype($a) != \"string\") {\n exit(\"arg1 not string\\n\");\n }\n if (gettype($b) != \"string\") {\n exit(\"arg2 not string\\n\");\n }\n if (strlen($b) > strlen($a)) {\n // exit(\"arg2 is larger than ard1\\n\");\n return false;\n }\n if ((strlen($b) == strlen($a)) && $b > $a) {\n // exit(\"arg2 is larger than ard1\\n\");\n return false;\n }\n\n $a = bigGetArray($a);\n $b = bigGetArray($b);\n $keta = max(count($a), count($b));\n for ($i = 0; $i < $keta; $i++) {\n $a_ex = isset($a[$i]) ? $a[$i] : 0;\n $b_ex = isset($b[$i]) ? $b[$i] : 0;\n $a[$i] = $a_ex - $b_ex;\n }\n $a = bigKeta($a);\n\n // echo \"sub2: {$a}\\n\";\n return $a;\n}\n\n/*\n param : string\n return: array \n*/\nfunction bigGetArray($a) {\n if (gettype($a) != \"string\") {\n exit(\"arg1 not string\\n\");\n }\n return array_reverse(str_split($a));\n}\n\nfunction bigGetString($a) {\n if (gettype($a) != \"array\") {\n exit(\"arg1 not array\\n\");\n }\n return implode(\"\", array_reverse($a));\n}\n\n/*\n param : array\n return: string \n*/\nfunction bigKeta($a) {\n if (gettype($a) != \"array\") {\n exit(\"arg1 not array\\n\");\n }\n $cnt = count($a);\n\n $flag = true;\n\n while($flag) {\n $flag = false;\n foreach ($a as $key => $val) {\n if ($val < 0) {\n $a[$key+1]--;\n $a[$key] += 10;\n $flag = true;\n }\n if ($val > 9) {\n $a[$key+1]++;\n $a[$key] -= 10;\n $flag = true;\n }\n }\n }\n\n if ($a[$cnt-1] == \"0\") {\n unset($a[$cnt-1]);\n }\n return implode(\"\", array_reverse($a));\n}\n\n", "language": "PHP", "metadata": {"date": 1483328639, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03861/input.txt", "sample_output_relpath": "derived/input_output/data/p03861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03861/PHP/s723773352.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s723773352", "user_id": "u195912432"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " 1 && array_sum($aa) == 0 && array_sum($a) == 0 && $ans) {\n if (DEBUG) echo \"hell\\n\";\n while($a) {\n array_unshift($ans, array_pop($a));\n }\n break;\n }\n $ret = bigSub(bigKeta($aa), $b);\n // print_r($ret);\n // echo PHP_EOL;\n if ($ret === false) {\n if (!$a) break;\n array_unshift($aa, array_pop($a));\n if ($ans) {\n array_unshift($ans, 0);\n }\n } else {\n if (!$ans) {\n array_unshift($ans, 0);\n }\n $ans[0]++;\n $aa = bigGetArray($ret);\n }\n }\n // var_dump($ans);\n $ret = implode(\"\", array_reverse($ans));\n // echo \"amari: \" . implode(\"\", array_reverse($aa)) . PHP_EOL;\n $amari = implode(\"\", array_reverse($aa));\n if ($amari != 0 && $ceilFlag === true) {\n $ret = bigAdd($ret, \"1\");\n }\n if ($ret == null) {\n $ret = \"0\";\n }\n if (DEBUG) echo \"bigDiv: {$a} {$b} {$ret}\\n\";\n return $ret;\n}\n\nfunction bigAdd($a, $b) {\n if (gettype($a) != \"string\") {\n exit(\"arg1 not string\\n\");\n }\n if (gettype($b) != \"string\") {\n exit(\"arg2 not string\\n\");\n }\n $a = bigGetArray($a);\n $b = bigGetArray($b);\n $keta = max(count($a), count($b));\n for ($i = 0; $i < $keta; $i++) {\n $a_ex = isset($a[$i]) ? $a[$i] : 0;\n $b_ex = isset($b[$i]) ? $b[$i] : 0;\n $a[$i] = $a_ex + $b_ex;\n }\n $a = bigKeta($a);\n\n return $a;\n}\n\n/*\n param : string\n return: string \n*/\nfunction bigSub($a, $b) {\n // echo \"sub1: {$a} {$b}\\n\";\n if (gettype($a) != \"string\") {\n exit(\"arg1 not string\\n\");\n }\n if (gettype($b) != \"string\") {\n exit(\"arg2 not string\\n\");\n }\n if (strlen($b) > strlen($a)) {\n // exit(\"arg2 is larger than ard1\\n\");\n return false;\n }\n if ((strlen($b) == strlen($a)) && $b > $a) {\n // exit(\"arg2 is larger than ard1\\n\");\n return false;\n }\n\n $a = bigGetArray($a);\n $b = bigGetArray($b);\n $keta = max(count($a), count($b));\n for ($i = 0; $i < $keta; $i++) {\n $a_ex = isset($a[$i]) ? $a[$i] : 0;\n $b_ex = isset($b[$i]) ? $b[$i] : 0;\n $a[$i] = $a_ex - $b_ex;\n }\n $a = bigKeta($a);\n\n // echo \"sub2: {$a}\\n\";\n return $a;\n}\n\n/*\n param : string\n return: array \n*/\nfunction bigGetArray($a) {\n if (gettype($a) != \"string\") {\n exit(\"arg1 not string\\n\");\n }\n return array_reverse(str_split($a));\n}\n\nfunction bigGetString($a) {\n if (gettype($a) != \"array\") {\n exit(\"arg1 not array\\n\");\n }\n return implode(\"\", array_reverse($a));\n}\n\n/*\n param : array\n return: string \n*/\nfunction bigKeta($a) {\n if (gettype($a) != \"array\") {\n exit(\"arg1 not array\\n\");\n }\n $cnt = count($a);\n\n $flag = true;\n\n while($flag) {\n $flag = false;\n foreach ($a as $key => $val) {\n if ($val < 0) {\n $a[$key+1]--;\n $a[$key] += 10;\n $flag = true;\n }\n if ($val > 9) {\n $a[$key+1]++;\n $a[$key] -= 10;\n $flag = true;\n }\n }\n }\n\n if ($a[$cnt-1] == \"0\") {\n unset($a[$cnt-1]);\n }\n return implode(\"\", array_reverse($a));\n}\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\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\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "sample_input": "4 8 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03861", "source_text": "Score : 200 points\n\nProblem Statement\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\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4606, "cpu_time_ms": 20, "memory_kb": 2940}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s938209596", "group_id": "codeNet:p03861", "input_text": " $N) {\n\t\t$diff = abs($score - $N);\n\t\tunset($ans[$diff-1]);\n\t\techo implode(\" \", $ans);\n\t\techo PHP_EOL;\n\t\texit;\n\t}\n}\n", "language": "PHP", "metadata": {"date": 1480182163, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03920.html", "problem_id": "p03920", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03920/input.txt", "sample_output_relpath": "derived/input_output/data/p03920/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03920/PHP/s900335087.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s900335087", "user_id": "u195912432"}, "prompt_components": {"gold_output": "1\n3\n", "input_to_evaluate": " $N) {\n\t\t$diff = abs($score - $N);\n\t\tunset($ans[$diff-1]);\n\t\techo implode(\" \", $ans);\n\t\techo PHP_EOL;\n\t\texit;\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe problem set at CODE FESTIVAL 20XX Finals consists of N problems.\n\nThe score allocated to the i-th (1≦i≦N) problem is i points.\n\nTakahashi, a contestant, is trying to score exactly N points. For that, he is deciding which problems to solve.\n\nAs problems with higher scores are harder, he wants to minimize the highest score of a problem among the ones solved by him.\n\nDetermine the set of problems that should be solved.\n\nConstraints\n\n1≦N≦10^7\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 1≦N≦1000.\n\nAdditional 100 points will be awarded for passing the test set without additional constraints.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nAmong the sets of problems with the total score of N, find a set in which the highest score of a problem is minimum, then print the indices of the problems in the set in any order, one per line.\n\nIf there exists more than one such set, any of them will be accepted.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n3\n\nSolving only the 4-th problem will also result in the total score of 4 points, but solving the 1-st and 3-rd problems will lower the highest score of a solved problem.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n1\n2\n4\n\nThe set \\{3,4\\} will also be accepted.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1", "sample_input": "4\n"}, "reference_outputs": ["1\n3\n"], "source_document_id": "p03920", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe problem set at CODE FESTIVAL 20XX Finals consists of N problems.\n\nThe score allocated to the i-th (1≦i≦N) problem is i points.\n\nTakahashi, a contestant, is trying to score exactly N points. For that, he is deciding which problems to solve.\n\nAs problems with higher scores are harder, he wants to minimize the highest score of a problem among the ones solved by him.\n\nDetermine the set of problems that should be solved.\n\nConstraints\n\n1≦N≦10^7\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 1≦N≦1000.\n\nAdditional 100 points will be awarded for passing the test set without additional constraints.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nAmong the sets of problems with the total score of N, find a set in which the highest score of a problem is minimum, then print the indices of the problems in the set in any order, one per line.\n\nIf there exists more than one such set, any of them will be accepted.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n3\n\nSolving only the 4-th problem will also result in the total score of 4 points, but solving the 1-st and 3-rd problems will lower the highest score of a solved problem.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n1\n2\n4\n\nThe set \\{3,4\\} will also be accepted.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 562, "cpu_time_ms": 17, "memory_kb": 3192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s927026670", "group_id": "codeNet:p03937", "input_text": "$pastRange[0]&&$end>$pastRange[1])||($start===$pastRange[1]&&$start<=$end)){\n $ansflg=true;\n $pastRange=array($start,$end);\n }else{\n $ansflg=false;\n break;\n }\n}\nif($ansflg){\n echo \"Possible\";\n}else{\n echo \"Impossible\";\n}\n?>\n", "language": "PHP", "metadata": {"date": 1479005749, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03937.html", "problem_id": "p03937", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03937/input.txt", "sample_output_relpath": "derived/input_output/data/p03937/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03937/PHP/s067841500.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s067841500", "user_id": "u369582099"}, "prompt_components": {"gold_output": "Possible\n", "input_to_evaluate": "$pastRange[0]&&$end>$pastRange[1])||($start===$pastRange[1]&&$start<=$end)){\n $ansflg=true;\n $pastRange=array($start,$end);\n }else{\n $ansflg=false;\n break;\n }\n}\nif($ansflg){\n echo \"Possible\";\n}else{\n echo \"Impossible\";\n}\n?>\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nWe have a grid of H rows and W columns. Initially, there is a stone in the top left cell. Shik is trying to move the stone to the bottom right cell. In each step, he can move the stone one cell to its left, up, right, or down (if such cell exists). It is possible that the stone visits a cell multiple times (including the bottom right and the top left cell).\n\nYou are given a matrix of characters a_{ij} (1 \\leq i \\leq H, 1 \\leq j \\leq W). After Shik completes all moving actions, a_{ij} is # if the stone had ever located at the i-th row and the j-th column during the process of moving. Otherwise, a_{ij} is .. Please determine whether it is possible that Shik only uses right and down moves in all steps.\n\nConstraints\n\n2 \\leq H, W \\leq 8\n\na_{i,j} is either # or ..\n\nThere exists a valid sequence of moves for Shik to generate the map a.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\na_{11}a_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf it is possible that Shik only uses right and down moves, print Possible. Otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n##...\n.##..\n..##.\n...##\n\nSample Output 1\n\nPossible\n\nThe matrix can be generated by a 7-move sequence: right, down, right, down, right, down, and right.\n\nSample Input 2\n\n5 3\n###\n..#\n###\n#..\n###\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n4 5\n##...\n.###.\n.###.\n...##\n\nSample Output 3\n\nImpossible", "sample_input": "4 5\n##...\n.##..\n..##.\n...##\n"}, "reference_outputs": ["Possible\n"], "source_document_id": "p03937", "source_text": "Score : 200 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nWe have a grid of H rows and W columns. Initially, there is a stone in the top left cell. Shik is trying to move the stone to the bottom right cell. In each step, he can move the stone one cell to its left, up, right, or down (if such cell exists). It is possible that the stone visits a cell multiple times (including the bottom right and the top left cell).\n\nYou are given a matrix of characters a_{ij} (1 \\leq i \\leq H, 1 \\leq j \\leq W). After Shik completes all moving actions, a_{ij} is # if the stone had ever located at the i-th row and the j-th column during the process of moving. Otherwise, a_{ij} is .. Please determine whether it is possible that Shik only uses right and down moves in all steps.\n\nConstraints\n\n2 \\leq H, W \\leq 8\n\na_{i,j} is either # or ..\n\nThere exists a valid sequence of moves for Shik to generate the map a.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\na_{11}a_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf it is possible that Shik only uses right and down moves, print Possible. Otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n##...\n.##..\n..##.\n...##\n\nSample Output 1\n\nPossible\n\nThe matrix can be generated by a 7-move sequence: right, down, right, down, right, down, and right.\n\nSample Input 2\n\n5 3\n###\n..#\n###\n#..\n###\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n4 5\n##...\n.###.\n.###.\n...##\n\nSample Output 3\n\nImpossible", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 474, "cpu_time_ms": 18, "memory_kb": 3832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s156122121", "group_id": "codeNet:p03938", "input_text": " b_2 > ... > b_N\n\na_{p_1}+b_{p_1} < a_{p_2}+b_{p_2} < ... < a_{p_N}+b_{p_N}\n\nConstraints\n\n2 \\leq N \\leq 20,000\n\np is a permutation of the set {1, 2, ..., N}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nThe output consists of two lines. The first line contains a_1, a_2, ..., a_N seperated by a space. The second line contains b_1, b_2, ..., b_N seperated by a space.\n\nIt can be shown that there always exists a solution for any input satisfying the constraints.\n\nSample Input 1\n\n2\n1 2\n\nSample Output 1\n\n1 4\n5 4\n\na_1 + b_1 = 6 and a_2 + b_2 = 8. So this output satisfies all conditions.\n\nSample Input 2\n\n3\n3 2 1\n\nSample Output 2\n\n1 2 3\n5 3 1\n\nSample Input 3\n\n3\n2 3 1\n\nSample Output 3\n\n5 10 100\n100 10 1", "sample_input": "2\n1 2\n"}, "reference_outputs": ["1 4\n5 4\n"], "source_document_id": "p03938", "source_text": "Score : 400 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nYou are given a permutation p of the set {1, 2, ..., N}. Please construct two sequences of positive integers a_1, a_2, ..., a_N and b_1, b_2, ..., b_N satisfying the following conditions:\n\n1 \\leq a_i, b_i \\leq 10^9 for all i\n\na_1 < a_2 < ... < a_N\n\nb_1 > b_2 > ... > b_N\n\na_{p_1}+b_{p_1} < a_{p_2}+b_{p_2} < ... < a_{p_N}+b_{p_N}\n\nConstraints\n\n2 \\leq N \\leq 20,000\n\np is a permutation of the set {1, 2, ..., N}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nThe output consists of two lines. The first line contains a_1, a_2, ..., a_N seperated by a space. The second line contains b_1, b_2, ..., b_N seperated by a space.\n\nIt can be shown that there always exists a solution for any input satisfying the constraints.\n\nSample Input 1\n\n2\n1 2\n\nSample Output 1\n\n1 4\n5 4\n\na_1 + b_1 = 6 and a_2 + b_2 = 8. So this output satisfies all conditions.\n\nSample Input 2\n\n3\n3 2 1\n\nSample Output 2\n\n1 2 3\n5 3 1\n\nSample Input 3\n\n3\n2 3 1\n\nSample Output 3\n\n5 10 100\n100 10 1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 246, "cpu_time_ms": 16, "memory_kb": 11128}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s710857961", "group_id": "codeNet:p03943", "input_text": "=0;--$i){\n $offsets=substr($s,$i);\n $offsett=substr($t,0,$n-$i);\n if($offsett===$offsets){\n $ans=$s.substr($t,$n-$i);\n break;\n }\n }\n \n}\nif($ans===\"\"){\n $ans=$s.$t;\n}\necho strlen($ans);\n?>", "language": "PHP", "metadata": {"date": 1477790902, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03951.html", "problem_id": "p03951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03951/input.txt", "sample_output_relpath": "derived/input_output/data/p03951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03951/PHP/s702280273.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s702280273", "user_id": "u369582099"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "=0;--$i){\n $offsets=substr($s,$i);\n $offsett=substr($t,0,$n-$i);\n if($offsett===$offsets){\n $ans=$s.substr($t,$n-$i);\n break;\n }\n }\n \n}\nif($ans===\"\"){\n $ans=$s.$t;\n}\necho strlen($ans);\n?>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke is interested in strings that satisfy the following conditions:\n\nThe length of the string is at least N.\n\nThe first N characters equal to the string s.\n\nThe last N characters equal to the string t.\n\nFind the length of the shortest string that satisfies the conditions.\n\nConstraints\n\n1≤N≤100\n\nThe lengths of s and t are both N.\n\ns and t consist of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\nt\n\nOutput\n\nPrint the length of the shortest string that satisfies the conditions.\n\nSample Input 1\n\n3\nabc\ncde\n\nSample Output 1\n\n5\n\nThe shortest string is abcde.\n\nSample Input 2\n\n1\na\nz\n\nSample Output 2\n\n2\n\nThe shortest string is az.\n\nSample Input 3\n\n4\nexpr\nexpr\n\nSample Output 3\n\n4\n\nThe shortest string is expr.", "sample_input": "3\nabc\ncde\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03951", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke is interested in strings that satisfy the following conditions:\n\nThe length of the string is at least N.\n\nThe first N characters equal to the string s.\n\nThe last N characters equal to the string t.\n\nFind the length of the shortest string that satisfies the conditions.\n\nConstraints\n\n1≤N≤100\n\nThe lengths of s and t are both N.\n\ns and t consist of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\nt\n\nOutput\n\nPrint the length of the shortest string that satisfies the conditions.\n\nSample Input 1\n\n3\nabc\ncde\n\nSample Output 1\n\n5\n\nThe shortest string is abcde.\n\nSample Input 2\n\n1\na\nz\n\nSample Output 2\n\n2\n\nThe shortest string is az.\n\nSample Input 3\n\n4\nexpr\nexpr\n\nSample Output 3\n\n4\n\nThe shortest string is expr.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 390, "cpu_time_ms": 19, "memory_kb": 3704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s493788006", "group_id": "codeNet:p03951", "input_text": "= 0; $i--) {\n\t$ss = substr($s, strlen($s) - $i);\n\t$tt = substr($t, 0, $i);\n\t// echo \"{$ss} {$tt}\\n\";\n\tif ($ss == $tt) {\n\t\techo ($N * 2 - $i) . PHP_EOL;\n\t\texit;\n\t}\n}", "language": "PHP", "metadata": {"date": 1477790542, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03951.html", "problem_id": "p03951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03951/input.txt", "sample_output_relpath": "derived/input_output/data/p03951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03951/PHP/s493788006.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s493788006", "user_id": "u195912432"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "= 0; $i--) {\n\t$ss = substr($s, strlen($s) - $i);\n\t$tt = substr($t, 0, $i);\n\t// echo \"{$ss} {$tt}\\n\";\n\tif ($ss == $tt) {\n\t\techo ($N * 2 - $i) . PHP_EOL;\n\t\texit;\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke is interested in strings that satisfy the following conditions:\n\nThe length of the string is at least N.\n\nThe first N characters equal to the string s.\n\nThe last N characters equal to the string t.\n\nFind the length of the shortest string that satisfies the conditions.\n\nConstraints\n\n1≤N≤100\n\nThe lengths of s and t are both N.\n\ns and t consist of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\nt\n\nOutput\n\nPrint the length of the shortest string that satisfies the conditions.\n\nSample Input 1\n\n3\nabc\ncde\n\nSample Output 1\n\n5\n\nThe shortest string is abcde.\n\nSample Input 2\n\n1\na\nz\n\nSample Output 2\n\n2\n\nThe shortest string is az.\n\nSample Input 3\n\n4\nexpr\nexpr\n\nSample Output 3\n\n4\n\nThe shortest string is expr.", "sample_input": "3\nabc\ncde\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03951", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke is interested in strings that satisfy the following conditions:\n\nThe length of the string is at least N.\n\nThe first N characters equal to the string s.\n\nThe last N characters equal to the string t.\n\nFind the length of the shortest string that satisfies the conditions.\n\nConstraints\n\n1≤N≤100\n\nThe lengths of s and t are both N.\n\ns and t consist of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\nt\n\nOutput\n\nPrint the length of the shortest string that satisfies the conditions.\n\nSample Input 1\n\n3\nabc\ncde\n\nSample Output 1\n\n5\n\nThe shortest string is abcde.\n\nSample Input 2\n\n1\na\nz\n\nSample Output 2\n\n2\n\nThe shortest string is az.\n\nSample Input 3\n\n4\nexpr\nexpr\n\nSample Output 3\n\n4\n\nThe shortest string is expr.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 438, "cpu_time_ms": 19, "memory_kb": 3064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s504853551", "group_id": "codeNet:p03959", "input_text": " ($A[$i-1]??0)){\n $Amin = $A[$i];\n $Amax = $A[$i];\n }else{\n $Amin = 1;\n $Amax = $A[$i];\n }\n if($B[$i] > ($B[$i+1]??0)){\n $Bmin = $B[$i];\n $Bmax = $B[$i];\n }else{\n $Bmin = 1;\n $Bmax = $B[$i];\n }\n $min = max($Amin, $Bmin);\n $max = min($Amax, $Bmax);\n if($min > $max){\n $p = 0;\n }\n $p*=$max-$min+1;\n $p%=10**9+7;\n}\necho $p,\"\\n\";\n\nfunction str(){return trim(fgets(STDIN));}\nfunction ints(){return array_map('intval',explode(' ',trim(fgets(STDIN))));}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$N = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "language": "PHP", "metadata": {"date": 1587313648, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p03959.html", "problem_id": "p03959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03959/input.txt", "sample_output_relpath": "derived/input_output/data/p03959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03959/PHP/s504853551.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s504853551", "user_id": "u248209126"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": " ($A[$i-1]??0)){\n $Amin = $A[$i];\n $Amax = $A[$i];\n }else{\n $Amin = 1;\n $Amax = $A[$i];\n }\n if($B[$i] > ($B[$i+1]??0)){\n $Bmin = $B[$i];\n $Bmax = $B[$i];\n }else{\n $Bmin = 1;\n $Bmax = $B[$i];\n }\n $min = max($Amin, $Bmin);\n $max = min($Amax, $Bmax);\n if($min > $max){\n $p = 0;\n }\n $p*=$max-$min+1;\n $p%=10**9+7;\n}\necho $p,\"\\n\";\n\nfunction str(){return trim(fgets(STDIN));}\nfunction ints(){return array_map('intval',explode(' ',trim(fgets(STDIN))));}\nfunction int(){return intval(trim(fgets(STDIN)));}\nfunction chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}\nfunction chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}\nfunction popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}\nfunction o(...$val){\n if(count($val)==1)$val=array_shift($val);\n echo debug_backtrace()[0]['line'].\")\";\n if(is_array($val)){\n if(count($val) == 0)echo \"empty array\";\n elseif(!is_array(current($val)))echo \"array: \",implode(\" \", addIndex($val)),\"\\n\";\n else{\n echo \"array:array\\n\";\n if(isCleanArray($val))foreach($val as $row)echo implode(\" \", addIndex($row)),\"\\n\";\n else foreach($val as $i => $row)echo \"[\".$i.\"] \".implode(\" \", addIndex($row)),\"\\n\";\n }\n }else echo $val.\"\\n\";\n}\nfunction addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.\":\".$v;}, array_keys($val), $val);}return $val;}\nfunction isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}\n// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]\nfunction atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}\nfunction gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}\nfunction gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}\nfunction lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}\nfunction lcm($a, $b) {return $a / gcd($a, $b) * $b;}\n\nfunction dfs($current, $from = -1, $d = 0){\n global $G, $distance;\n $distance[$current] = $d;\n foreach($G[$current] as $to){\n if($from != $to){\n dfs($to, $current, $d + 1);\n }\n }\n}\n\nfunction loadTree($N = false){\n if($N === false)$N = $GLOBALS['N'];\n return loadGraph($N, $N-1);\n}\nfunction loadGraph($N = false, $M = false, $both = true){\n if($N === false)$N = $GLOBALS['N'];\n if($M === false)$N = $GLOBALS['M'];\n $G = array_fill(1, $N, []);\n for($i = 0; $i < $M; $i++){\n $values = ints();\n if(count($values) == 2){\n list($a, $b) = $values;\n $G[$a][] = $b;\n if($both)$G[$b][] = $a;\n }else{\n list($a, $b, $d) = $values;\n $G[$a][] = [$b, $d];\n if($both)$G[$b][] = [$a, $d];\n }\n }\n return $G;\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nMountaineers Mr. Takahashi and Mr. Aoki recently trekked across a certain famous mountain range.\nThe mountain range consists of N mountains, extending from west to east in a straight line as Mt. 1, Mt. 2, ..., Mt. N.\nMr. Takahashi traversed the range from the west and Mr. Aoki from the east.\n\nThe height of Mt. i is h_i, but they have forgotten the value of each h_i.\nInstead, for each i (1 ≤ i ≤ N), they recorded the maximum height of the mountains climbed up to the time they reached the peak of Mt. i (including Mt. i).\nMr. Takahashi's record is T_i and Mr. Aoki's record is A_i.\n\nWe know that the height of each mountain h_i is a positive integer.\nCompute the number of the possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nNote that the records may be incorrect and thus there may be no possible sequence of the mountains' heights.\nIn such a case, output 0.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ T_i ≤ 10^9\n\n1 ≤ A_i ≤ 10^9\n\nT_i ≤ T_{i+1} (1 ≤ i ≤ N - 1)\n\nA_i ≥ A_{i+1} (1 ≤ i ≤ N - 1)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nSample Input 1\n\n5\n1 3 3 3 3\n3 3 2 2 2\n\nSample Output 1\n\n4\n\nThe possible sequences of the mountains' heights are:\n\n1, 3, 2, 2, 2\n\n1, 3, 2, 1, 2\n\n1, 3, 1, 2, 2\n\n1, 3, 1, 1, 2\n\nfor a total of four sequences.\n\nSample Input 2\n\n5\n1 1 1 2 2\n3 2 1 1 1\n\nSample Output 2\n\n0\n\nThe records are contradictory, since Mr. Takahashi recorded 2 as the highest peak after climbing all the mountains but Mr. Aoki recorded 3.\n\nSample Input 3\n\n10\n1 3776 3776 8848 8848 8848 8848 8848 8848 8848\n8848 8848 8848 8848 8848 8848 8848 8848 3776 5\n\nSample Output 3\n\n884111967\n\nDon't forget to compute the number modulo 10^9 + 7.\n\nSample Input 4\n\n1\n17\n17\n\nSample Output 4\n\n1\n\nSome mountain ranges consist of only one mountain.", "sample_input": "5\n1 3 3 3 3\n3 3 2 2 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03959", "source_text": "Score : 400 points\n\nProblem Statement\n\nMountaineers Mr. Takahashi and Mr. Aoki recently trekked across a certain famous mountain range.\nThe mountain range consists of N mountains, extending from west to east in a straight line as Mt. 1, Mt. 2, ..., Mt. N.\nMr. Takahashi traversed the range from the west and Mr. Aoki from the east.\n\nThe height of Mt. i is h_i, but they have forgotten the value of each h_i.\nInstead, for each i (1 ≤ i ≤ N), they recorded the maximum height of the mountains climbed up to the time they reached the peak of Mt. i (including Mt. i).\nMr. Takahashi's record is T_i and Mr. Aoki's record is A_i.\n\nWe know that the height of each mountain h_i is a positive integer.\nCompute the number of the possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nNote that the records may be incorrect and thus there may be no possible sequence of the mountains' heights.\nIn such a case, output 0.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ T_i ≤ 10^9\n\n1 ≤ A_i ≤ 10^9\n\nT_i ≤ T_{i+1} (1 ≤ i ≤ N - 1)\n\nA_i ≥ A_{i+1} (1 ≤ i ≤ N - 1)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nSample Input 1\n\n5\n1 3 3 3 3\n3 3 2 2 2\n\nSample Output 1\n\n4\n\nThe possible sequences of the mountains' heights are:\n\n1, 3, 2, 2, 2\n\n1, 3, 2, 1, 2\n\n1, 3, 1, 2, 2\n\n1, 3, 1, 1, 2\n\nfor a total of four sequences.\n\nSample Input 2\n\n5\n1 1 1 2 2\n3 2 1 1 1\n\nSample Output 2\n\n0\n\nThe records are contradictory, since Mr. Takahashi recorded 2 as the highest peak after climbing all the mountains but Mr. Aoki recorded 3.\n\nSample Input 3\n\n10\n1 3776 3776 8848 8848 8848 8848 8848 8848 8848\n8848 8848 8848 8848 8848 8848 8848 8848 3776 5\n\nSample Output 3\n\n884111967\n\nDon't forget to compute the number modulo 10^9 + 7.\n\nSample Input 4\n\n1\n17\n17\n\nSample Output 4\n\n1\n\nSome mountain ranges consist of only one mountain.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3072, "cpu_time_ms": 69, "memory_kb": 22132}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s524913087", "group_id": "codeNet:p03962", "input_text": "", "language": "PHP", "metadata": {"date": 1476584517, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03962.html", "problem_id": "p03962", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03962/input.txt", "sample_output_relpath": "derived/input_output/data/p03962/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03962/PHP/s425591233.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s425591233", "user_id": "u808731469"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer recently bought three paint cans.\nThe color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c.\nHere, the color of each paint can is represented by an integer between 1 and 100, inclusive.\n\nSince he is forgetful, he might have bought more than one paint can in the same color.\nCount the number of different kinds of colors of these paint cans and tell him.\n\nConstraints\n\n1≦a,b,c≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the number of different kinds of colors of the paint cans.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n3\n\nThree different colors: 1, 3, and 4.\n\nSample Input 2\n\n3 3 33\n\nSample Output 2\n\n2\n\nTwo different colors: 3 and 33.", "sample_input": "3 1 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03962", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer recently bought three paint cans.\nThe color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c.\nHere, the color of each paint can is represented by an integer between 1 and 100, inclusive.\n\nSince he is forgetful, he might have bought more than one paint can in the same color.\nCount the number of different kinds of colors of these paint cans and tell him.\n\nConstraints\n\n1≦a,b,c≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the number of different kinds of colors of the paint cans.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n3\n\nThree different colors: 1, 3, and 4.\n\nSample Input 2\n\n3 3 33\n\nSample Output 2\n\n2\n\nTwo different colors: 3 and 33.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 73, "cpu_time_ms": 18, "memory_kb": 3704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s293498289", "group_id": "codeNet:p03962", "input_text": "1){\n for($i=2;$i<=$n;++$i){\n $pattern*=($k-1);\n }\n}\necho $pattern;\n?>", "language": "PHP", "metadata": {"date": 1476580843, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03962.html", "problem_id": "p03962", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03962/input.txt", "sample_output_relpath": "derived/input_output/data/p03962/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03962/PHP/s293498289.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s293498289", "user_id": "u369582099"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "1){\n for($i=2;$i<=$n;++$i){\n $pattern*=($k-1);\n }\n}\necho $pattern;\n?>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer recently bought three paint cans.\nThe color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c.\nHere, the color of each paint can is represented by an integer between 1 and 100, inclusive.\n\nSince he is forgetful, he might have bought more than one paint can in the same color.\nCount the number of different kinds of colors of these paint cans and tell him.\n\nConstraints\n\n1≦a,b,c≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the number of different kinds of colors of the paint cans.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n3\n\nThree different colors: 1, 3, and 4.\n\nSample Input 2\n\n3 3 33\n\nSample Output 2\n\n2\n\nTwo different colors: 3 and 33.", "sample_input": "3 1 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03962", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer recently bought three paint cans.\nThe color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c.\nHere, the color of each paint can is represented by an integer between 1 and 100, inclusive.\n\nSince he is forgetful, he might have bought more than one paint can in the same color.\nCount the number of different kinds of colors of these paint cans and tell him.\n\nConstraints\n\n1≦a,b,c≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the number of different kinds of colors of the paint cans.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n3\n\nThree different colors: 1, 3, and 4.\n\nSample Input 2\n\n3 3 33\n\nSample Output 2\n\n2\n\nTwo different colors: 3 and 33.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 144, "cpu_time_ms": 17, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s638237983", "group_id": "codeNet:p03963", "input_text": "\n", "language": "PHP", "metadata": {"date": 1552849773, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03963.html", "problem_id": "p03963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03963/input.txt", "sample_output_relpath": "derived/input_output/data/p03963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03963/PHP/s638237983.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s638237983", "user_id": "u109193095"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N balls placed in a row.\nAtCoDeer the deer is painting each of these in one of the K colors of his paint cans.\nFor aesthetic reasons, any two adjacent balls must be painted in different colors.\n\nFind the number of the possible ways to paint the balls.\n\nConstraints\n\n1≦N≦1000\n\n2≦K≦1000\n\nThe correct answer is at most 2^{31}-1.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of the possible ways to paint the balls.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nWe will denote the colors by 0 and 1. There are two possible ways: we can either paint the left ball in color 0 and the right ball in color 1, or paint the left in color 1 and the right in color 0.\n\nSample Input 2\n\n1 10\n\nSample Output 2\n\n10\n\nSince there is only one ball, we can use any of the ten colors to paint it. Thus, the answer is ten.", "sample_input": "2 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03963", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N balls placed in a row.\nAtCoDeer the deer is painting each of these in one of the K colors of his paint cans.\nFor aesthetic reasons, any two adjacent balls must be painted in different colors.\n\nFind the number of the possible ways to paint the balls.\n\nConstraints\n\n1≦N≦1000\n\n2≦K≦1000\n\nThe correct answer is at most 2^{31}-1.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of the possible ways to paint the balls.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nWe will denote the colors by 0 and 1. There are two possible ways: we can either paint the left ball in color 0 and the right ball in color 1, or paint the left in color 1 and the right in color 0.\n\nSample Input 2\n\n1 10\n\nSample Output 2\n\n10\n\nSince there is only one ball, we can use any of the ten colors to paint it. Thus, the answer is ten.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 166, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s325197896", "group_id": "codeNet:p03971", "input_text": " $bucket)\n{\n $sum += $buckets[$i];\n}\n\n$sum2=0;\n\nforeach ($buckets as $i => $bucket)\n{\n if ($bucket > ((int)($sum /$size)))\n {\n $buckets[$i] = (int)($sum /$size);\n }\n $sum2 += $buckets[$i];\n}\n\n$result = (int)($sum2 / $size);\n\necho $result . \"\\n\";", "language": "PHP", "metadata": {"date": 1505167616, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03976.html", "problem_id": "p03976", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03976/input.txt", "sample_output_relpath": "derived/input_output/data/p03976/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03976/PHP/s423768331.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s423768331", "user_id": "u891052339"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": " $bucket)\n{\n $sum += $buckets[$i];\n}\n\n$sum2=0;\n\nforeach ($buckets as $i => $bucket)\n{\n if ($bucket > ((int)($sum /$size)))\n {\n $buckets[$i] = (int)($sum /$size);\n }\n $sum2 += $buckets[$i];\n}\n\n$result = (int)($sum2 / $size);\n\necho $result . \"\\n\";", "problem_context": "Score : 100 points\n\nProblem Statement\n\nKyoto University Programming Contest is a programming contest voluntarily held by some Kyoto University students.\nThis contest is abbreviated as Kyoto University Programming Contest and called KUPC.\n\nsource: Kyoto University Programming Contest Information\n\nThe problem-preparing committee met to hold this year's KUPC and N problems were proposed there.\nThe problems are numbered from 1 to N and the name of i-th problem is P_i.\nHowever, since they proposed too many problems, they decided to divide them into some sets for several contests.\n\nThey decided to divide this year's KUPC into several KUPCs by dividing problems under the following conditions.\n\nOne KUPC provides K problems.\n\nEach problem appears at most once among all the KUPCs.\n\nAll the first letters of the problem names in one KUPC must be different.\n\nYou, one of the committee members, want to hold as many KUPCs as possible.\nWrite a program to find the maximum number of KUPCs that can be held this year.\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq K \\leq 26\n\n1 \\leq |P_i| \\leq 10\n\nAll characters in P_i are capital letters.\n\nNote that, for each i and j (1 \\leq i < j \\leq N),\nP_i \\neq P_j are not necessarily satisfied.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nP_1\n:\nP_N\n\nOutput\n\nPrint the maximum number of KUPCs that can be held on one line.\n\nSample Input 1\n\n9 3\nAPPLE\nANT\nATCODER\nBLOCK\nBULL\nBOSS\nCAT\nDOG\nEGG\n\nFor example, three KUPCs can be held by dividing the problems as follows.\n\nFirst: APPLE, BLOCK, CAT\n\nSecond: ANT, BULL, DOG\n\nThird: ATCODER, BOSS, EGG\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3 2\nKU\nKYOUDAI\nKYOTOUNIV\n\nSample Output 2\n\n0\n\nNo KUPC can be held.", "sample_input": "9 3\nAPPLE\nANT\nATCODER\nBLOCK\nBULL\nBOSS\nCAT\nDOG\nEGG\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03976", "source_text": "Score : 100 points\n\nProblem Statement\n\nKyoto University Programming Contest is a programming contest voluntarily held by some Kyoto University students.\nThis contest is abbreviated as Kyoto University Programming Contest and called KUPC.\n\nsource: Kyoto University Programming Contest Information\n\nThe problem-preparing committee met to hold this year's KUPC and N problems were proposed there.\nThe problems are numbered from 1 to N and the name of i-th problem is P_i.\nHowever, since they proposed too many problems, they decided to divide them into some sets for several contests.\n\nThey decided to divide this year's KUPC into several KUPCs by dividing problems under the following conditions.\n\nOne KUPC provides K problems.\n\nEach problem appears at most once among all the KUPCs.\n\nAll the first letters of the problem names in one KUPC must be different.\n\nYou, one of the committee members, want to hold as many KUPCs as possible.\nWrite a program to find the maximum number of KUPCs that can be held this year.\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq K \\leq 26\n\n1 \\leq |P_i| \\leq 10\n\nAll characters in P_i are capital letters.\n\nNote that, for each i and j (1 \\leq i < j \\leq N),\nP_i \\neq P_j are not necessarily satisfied.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nP_1\n:\nP_N\n\nOutput\n\nPrint the maximum number of KUPCs that can be held on one line.\n\nSample Input 1\n\n9 3\nAPPLE\nANT\nATCODER\nBLOCK\nBULL\nBOSS\nCAT\nDOG\nEGG\n\nFor example, three KUPCs can be held by dividing the problems as follows.\n\nFirst: APPLE, BLOCK, CAT\n\nSecond: ANT, BULL, DOG\n\nThird: ATCODER, BOSS, EGG\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3 2\nKU\nKYOUDAI\nKYOTOUNIV\n\nSample Output 2\n\n0\n\nNo KUPC can be held.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 648, "cpu_time_ms": 17, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s175976312", "group_id": "codeNet:p03992", "input_text": " $d) if($data[(int)$d] == (int) $k)$count++;\necho $count;die;", "language": "PHP", "metadata": {"date": 1474765864, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03992.html", "problem_id": "p03992", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03992/input.txt", "sample_output_relpath": "derived/input_output/data/p03992/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03992/PHP/s175976312.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s175976312", "user_id": "u133240838"}, "prompt_components": {"gold_output": "CODE FESTIVAL\n", "input_to_evaluate": " $d) if($data[(int)$d] == (int) $k)$count++;\necho $count;die;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODE FESTIVAL.\nHowever, Mr. Takahashi always writes it CODEFESTIVAL, omitting the single space between CODE and FESTIVAL.\n\nSo he has decided to make a program that puts the single space he omitted.\n\nYou are given a string s with 12 letters.\nOutput the string putting a single space between the first 4 letters and last 8 letters in the string s.\n\nConstraints\n\ns contains exactly 12 letters.\n\nAll letters in s are uppercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string putting a single space between the first 4 letters and last 8 letters in the string s.\nPut a line break at the end.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nCODE FESTIVAL\n\nPutting a single space between the first 4 letters and last 8 letters in CODEFESTIVAL makes it CODE FESTIVAL.\n\nSample Input 2\n\nPOSTGRADUATE\n\nSample Output 2\n\nPOST GRADUATE\n\nSample Input 3\n\nABCDEFGHIJKL\n\nSample Output 3\n\nABCD EFGHIJKL", "sample_input": "CODEFESTIVAL\n"}, "reference_outputs": ["CODE FESTIVAL\n"], "source_document_id": "p03992", "source_text": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODE FESTIVAL.\nHowever, Mr. Takahashi always writes it CODEFESTIVAL, omitting the single space between CODE and FESTIVAL.\n\nSo he has decided to make a program that puts the single space he omitted.\n\nYou are given a string s with 12 letters.\nOutput the string putting a single space between the first 4 letters and last 8 letters in the string s.\n\nConstraints\n\ns contains exactly 12 letters.\n\nAll letters in s are uppercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string putting a single space between the first 4 letters and last 8 letters in the string s.\nPut a line break at the end.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nCODE FESTIVAL\n\nPutting a single space between the first 4 letters and last 8 letters in CODEFESTIVAL makes it CODE FESTIVAL.\n\nSample Input 2\n\nPOSTGRADUATE\n\nSample Output 2\n\nPOST GRADUATE\n\nSample Input 3\n\nABCDEFGHIJKL\n\nSample Output 3\n\nABCD EFGHIJKL", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 176, "cpu_time_ms": 17, "memory_kb": 3704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s498957356", "group_id": "codeNet:p03997", "input_text": " str_split($A),\n 'B' => str_split($B),\n 'C' => str_split($C),\n];\n\n$turn = 'A';\n\nwhile(true) {\n if (empty($data[$turn])) {\n break;\n }\n $turn = array_shift($data[$turn]);\n}\n\necho \"$turn\\n\";", "language": "PHP", "metadata": {"date": 1485747337, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p03998.html", "problem_id": "p03998", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03998/input.txt", "sample_output_relpath": "derived/input_output/data/p03998/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03998/PHP/s642416725.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s642416725", "user_id": "u729294108"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": " str_split($A),\n 'B' => str_split($B),\n 'C' => str_split($C),\n];\n\n$turn = 'A';\n\nwhile(true) {\n if (empty($data[$turn])) {\n break;\n }\n $turn = array_shift($data[$turn]);\n}\n\necho \"$turn\\n\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAlice, Bob and Charlie are playing Card Game for Three, as below:\n\nAt first, each of the three players has a deck consisting of some number of cards. Each card has a letter a, b or c written on it. The orders of the cards in the decks cannot be rearranged.\n\nThe players take turns. Alice goes first.\n\nIf the current player's deck contains at least one card, discard the top card in the deck. Then, the player whose name begins with the letter on the discarded card, takes the next turn. (For example, if the card says a, Alice takes the next turn.)\n\nIf the current player's deck is empty, the game ends and the current player wins the game.\n\nYou are given the initial decks of the players.\nMore specifically, you are given three strings S_A, S_B and S_C. The i-th (1≦i≦|S_A|) letter in S_A is the letter on the i-th card in Alice's initial deck. S_B and S_C describes Bob's and Charlie's initial decks in the same way.\n\nDetermine the winner of the game.\n\nConstraints\n\n1≦|S_A|≦100\n\n1≦|S_B|≦100\n\n1≦|S_C|≦100\n\nEach letter in S_A, S_B, S_C is a, b or c.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS_A\nS_B\nS_C\n\nOutput\n\nIf Alice will win, print A. If Bob will win, print B. If Charlie will win, print C.\n\nSample Input 1\n\naca\naccc\nca\n\nSample Output 1\n\nA\n\nThe game will progress as below:\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice's deck is empty. The game ends and Alice wins the game.\n\nSample Input 2\n\nabcb\naacb\nbccc\n\nSample Output 2\n\nC", "sample_input": "aca\naccc\nca\n"}, "reference_outputs": ["A\n"], "source_document_id": "p03998", "source_text": "Score : 200 points\n\nProblem Statement\n\nAlice, Bob and Charlie are playing Card Game for Three, as below:\n\nAt first, each of the three players has a deck consisting of some number of cards. Each card has a letter a, b or c written on it. The orders of the cards in the decks cannot be rearranged.\n\nThe players take turns. Alice goes first.\n\nIf the current player's deck contains at least one card, discard the top card in the deck. Then, the player whose name begins with the letter on the discarded card, takes the next turn. (For example, if the card says a, Alice takes the next turn.)\n\nIf the current player's deck is empty, the game ends and the current player wins the game.\n\nYou are given the initial decks of the players.\nMore specifically, you are given three strings S_A, S_B and S_C. The i-th (1≦i≦|S_A|) letter in S_A is the letter on the i-th card in Alice's initial deck. S_B and S_C describes Bob's and Charlie's initial decks in the same way.\n\nDetermine the winner of the game.\n\nConstraints\n\n1≦|S_A|≦100\n\n1≦|S_B|≦100\n\n1≦|S_C|≦100\n\nEach letter in S_A, S_B, S_C is a, b or c.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS_A\nS_B\nS_C\n\nOutput\n\nIf Alice will win, print A. If Bob will win, print B. If Charlie will win, print C.\n\nSample Input 1\n\naca\naccc\nca\n\nSample Output 1\n\nA\n\nThe game will progress as below:\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice's deck is empty. The game ends and Alice wins the game.\n\nSample Input 2\n\nabcb\naacb\nbccc\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 356, "cpu_time_ms": 16, "memory_kb": 3452}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s435167533", "group_id": "codeNet:p04000", "input_text": " 0){\n for($i = 1;$i <= $N;$i++){\n list($a,$b) = explode(\" \",trim(fgets(STDIN)));\n for($j = -1;$j <= 1;$j++){\n if($a + $j > 1 && $a + $j < $H){\n for($k = -1;$k <= 1;$k++){\n if($b + $k > 1 && $b + $k < $W){\n if(isset($map[$a + $j][$b + $k]) == true){\n $map[$a + $j][$b + $k] ++;\n }else{\n $map[$a + $j][$b + $k] = 1;\n }\n }\n }\n }\n }\n }\n \n foreach($map as $val){\n foreach($val as $val2){\n $ans[$val2] ++;\n }\n }\n\n $num0 = ($H - 2) * ($W - 2) - array_sum($ans);\n echo $num0 . PHP_EOL;\n}else{\n echo ($H - 2) * ($W - 2) . PHP_EOL;\n}\n\nfor($i = 1;$i <= 9;$i++){\n echo $ans[$i] . PHP_EOL;\n}\n?>", "language": "PHP", "metadata": {"date": 1473979415, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p04000.html", "problem_id": "p04000", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04000/input.txt", "sample_output_relpath": "derived/input_output/data/p04000/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04000/PHP/s435167533.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s435167533", "user_id": "u281500237"}, "prompt_components": {"gold_output": "0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n", "input_to_evaluate": " 0){\n for($i = 1;$i <= $N;$i++){\n list($a,$b) = explode(\" \",trim(fgets(STDIN)));\n for($j = -1;$j <= 1;$j++){\n if($a + $j > 1 && $a + $j < $H){\n for($k = -1;$k <= 1;$k++){\n if($b + $k > 1 && $b + $k < $W){\n if(isset($map[$a + $j][$b + $k]) == true){\n $map[$a + $j][$b + $k] ++;\n }else{\n $map[$a + $j][$b + $k] = 1;\n }\n }\n }\n }\n }\n }\n \n foreach($map as $val){\n foreach($val as $val2){\n $ans[$val2] ++;\n }\n }\n\n $num0 = ($H - 2) * ($W - 2) - array_sum($ans);\n echo $num0 . PHP_EOL;\n}else{\n echo ($H - 2) * ($W - 2) . PHP_EOL;\n}\n\nfor($i = 1;$i <= 9;$i++){\n echo $ans[$i] . PHP_EOL;\n}\n?>", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. At first, all cells were painted white.\n\nSnuke painted N of these cells. The i-th ( 1 \\leq i \\leq N ) cell he painted is the cell at the a_i-th row and b_i-th column.\n\nCompute the following:\n\nFor each integer j ( 0 \\leq j \\leq 9 ), how many subrectangles of size 3×3 of the grid contains exactly j black cells, after Snuke painted N cells?\n\nConstraints\n\n3 \\leq H \\leq 10^9\n\n3 \\leq W \\leq 10^9\n\n0 \\leq N \\leq min(10^5,H×W)\n\n1 \\leq a_i \\leq H (1 \\leq i \\leq N)\n\n1 \\leq b_i \\leq W (1 \\leq i \\leq N)\n\n(a_i, b_i) \\neq (a_j, b_j) (i \\neq j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W N\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint 10 lines.\nThe (j+1)-th ( 0 \\leq j \\leq 9 ) line should contain the number of the subrectangles of size 3×3 of the grid that contains exactly j black cells.\n\nSample Input 1\n\n4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n\nSample Output 1\n\n0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n\nThere are six subrectangles of size 3×3. Two of them contain three black cells each, and the remaining four contain four black cells each.\n\nSample Input 2\n\n10 10 20\n1 1\n1 4\n1 9\n2 5\n3 10\n4 2\n4 7\n5 9\n6 4\n6 6\n6 7\n7 1\n7 3\n7 7\n8 1\n8 5\n8 10\n9 2\n10 4\n10 9\n\nSample Output 2\n\n4\n26\n22\n10\n2\n0\n0\n0\n0\n0\n\nSample Input 3\n\n1000000000 1000000000 0\n\nSample Output 3\n\n999999996000000004\n0\n0\n0\n0\n0\n0\n0\n0\n0", "sample_input": "4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n"}, "reference_outputs": ["0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n"], "source_document_id": "p04000", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. At first, all cells were painted white.\n\nSnuke painted N of these cells. The i-th ( 1 \\leq i \\leq N ) cell he painted is the cell at the a_i-th row and b_i-th column.\n\nCompute the following:\n\nFor each integer j ( 0 \\leq j \\leq 9 ), how many subrectangles of size 3×3 of the grid contains exactly j black cells, after Snuke painted N cells?\n\nConstraints\n\n3 \\leq H \\leq 10^9\n\n3 \\leq W \\leq 10^9\n\n0 \\leq N \\leq min(10^5,H×W)\n\n1 \\leq a_i \\leq H (1 \\leq i \\leq N)\n\n1 \\leq b_i \\leq W (1 \\leq i \\leq N)\n\n(a_i, b_i) \\neq (a_j, b_j) (i \\neq j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W N\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint 10 lines.\nThe (j+1)-th ( 0 \\leq j \\leq 9 ) line should contain the number of the subrectangles of size 3×3 of the grid that contains exactly j black cells.\n\nSample Input 1\n\n4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n\nSample Output 1\n\n0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n\nThere are six subrectangles of size 3×3. Two of them contain three black cells each, and the remaining four contain four black cells each.\n\nSample Input 2\n\n10 10 20\n1 1\n1 4\n1 9\n2 5\n3 10\n4 2\n4 7\n5 9\n6 4\n6 6\n6 7\n7 1\n7 3\n7 7\n8 1\n8 5\n8 10\n9 2\n10 4\n10 9\n\nSample Output 2\n\n4\n26\n22\n10\n2\n0\n0\n0\n0\n0\n\nSample Input 3\n\n1000000000 1000000000 0\n\nSample Output 3\n\n999999996000000004\n0\n0\n0\n0\n0\n0\n0\n0\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 967, "cpu_time_ms": 2998, "memory_kb": 219768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s220163517", "group_id": "codeNet:p04001", "input_text": "", "language": "PHP", "metadata": {"date": 1525568929, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p04011.html", "problem_id": "p04011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04011/input.txt", "sample_output_relpath": "derived/input_output/data/p04011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04011/PHP/s246870281.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s246870281", "user_id": "u846552659"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "sample_input": "5\n3\n10000\n9000\n"}, "reference_outputs": ["48000\n"], "source_document_id": "p04011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 230, "cpu_time_ms": 11, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s848841925", "group_id": "codeNet:p04011", "input_text": "", "language": "PHP", "metadata": {"date": 1493158990, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p04011.html", "problem_id": "p04011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04011/input.txt", "sample_output_relpath": "derived/input_output/data/p04011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04011/PHP/s848841925.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s848841925", "user_id": "u187935934"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "sample_input": "5\n3\n10000\n9000\n"}, "reference_outputs": ["48000\n"], "source_document_id": "p04011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 207, "cpu_time_ms": 10, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s330078315", "group_id": "codeNet:p04011", "input_text": "fscanf(STDIN, \"%d\", $n);\nfscanf(STDIN, \"%d\", $k);\nfscanf(STDIN, \"%d\", $x);\nfscanf(STDIN, \"%d\", $y);\n$result = ($k * $x) + ($n - $k) * $y;\necho $result;", "language": "PHP", "metadata": {"date": 1493158173, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p04011.html", "problem_id": "p04011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04011/input.txt", "sample_output_relpath": "derived/input_output/data/p04011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04011/PHP/s330078315.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s330078315", "user_id": "u187935934"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": "fscanf(STDIN, \"%d\", $n);\nfscanf(STDIN, \"%d\", $k);\nfscanf(STDIN, \"%d\", $x);\nfscanf(STDIN, \"%d\", $y);\n$result = ($k * $x) + ($n - $k) * $y;\necho $result;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "sample_input": "5\n3\n10000\n9000\n"}, "reference_outputs": ["48000\n"], "source_document_id": "p04011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 151, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s740678397", "group_id": "codeNet:p04011", "input_text": " $value) {\n if (isset($str_hash[$value])) {\n $str_hash[$value] += 1;\n } else {\n $str_hash[$value] = 1;\n }\n}\n\n$is_beautiful = true;\nforeach ($str_hash as $key => $value) {\n if (!is_even($value)) {\n $is_beautiful = false;\n break;\n }\n}\n\necho $is_beautiful ? \"Yes\" : \"No\";\n\n?>\n", "language": "PHP", "metadata": {"date": 1484015485, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p04011.html", "problem_id": "p04011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04011/input.txt", "sample_output_relpath": "derived/input_output/data/p04011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04011/PHP/s740678397.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s740678397", "user_id": "u255781406"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": " $value) {\n if (isset($str_hash[$value])) {\n $str_hash[$value] += 1;\n } else {\n $str_hash[$value] = 1;\n }\n}\n\n$is_beautiful = true;\nforeach ($str_hash as $key => $value) {\n if (!is_even($value)) {\n $is_beautiful = false;\n break;\n }\n}\n\necho $is_beautiful ? \"Yes\" : \"No\";\n\n?>\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "sample_input": "5\n3\n10000\n9000\n"}, "reference_outputs": ["48000\n"], "source_document_id": "p04011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 508, "cpu_time_ms": 17, "memory_kb": 3064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s385213565", "group_id": "codeNet:p04012", "input_text": "\n", "language": "PHP", "metadata": {"date": 1493155930, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p04012.html", "problem_id": "p04012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04012/input.txt", "sample_output_relpath": "derived/input_output/data/p04012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04012/PHP/s385213565.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s385213565", "user_id": "u700573137"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "sample_input": "abaccaba\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p04012", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 335, "cpu_time_ms": 9, "memory_kb": 3576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s909510080", "group_id": "codeNet:p04029", "input_text": "", "language": "PHP", "metadata": {"date": 1584128023, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p04029.html", "problem_id": "p04029", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04029/input.txt", "sample_output_relpath": "derived/input_output/data/p04029/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04029/PHP/s909510080.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909510080", "user_id": "u608103149"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p04029", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 110, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s436843162", "group_id": "codeNet:p04029", "input_text": "\n", "language": "PHP", "metadata": {"date": 1573834545, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p04029.html", "problem_id": "p04029", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04029/input.txt", "sample_output_relpath": "derived/input_output/data/p04029/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04029/PHP/s918669498.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s918669498", "user_id": "u995747377"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p04029", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 156, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s630031156", "group_id": "codeNet:p04030", "input_text": "", "language": "PHP", "metadata": {"date": 1490903536, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p04032.html", "problem_id": "p04032", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04032/input.txt", "sample_output_relpath": "derived/input_output/data/p04032/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04032/PHP/s772338480.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s772338480", "user_id": "u546752118"}, "prompt_components": {"gold_output": "2 5\n", "input_to_evaluate": "", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven a string t, we will call it unbalanced if and only if the length of t is at least 2, and more than half of the letters in t are the same. For example, both voodoo and melee are unbalanced, while neither noon nor a is.\n\nYou are given a string s consisting of lowercase letters. Determine if there exists a (contiguous) substring of s that is unbalanced. If the answer is positive, show a position where such a substring occurs in s.\n\nConstraints\n\n2 ≦ |s| ≦ 10^5\n\ns consists of lowercase letters.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 2 ≦ N ≦ 100.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf there exists no unbalanced substring of s, print -1 -1.\n\nIf there exists an unbalanced substring of s, let one such substring be s_a s_{a+1} ... s_{b} (1 ≦ a < b ≦ |s|), and print a b. If there exists more than one such substring, any of them will be accepted.\n\nSample Input 1\n\nneeded\n\nSample Output 1\n\n2 5\n\nThe string s_2 s_3 s_4 s_5 = eede is unbalanced. There are also other unbalanced substrings. For example, the output 2 6 will also be accepted.\n\nSample Input 2\n\natcoder\n\nSample Output 2\n\n-1 -1\n\nThe string atcoder contains no unbalanced substring.", "sample_input": "needed\n"}, "reference_outputs": ["2 5\n"], "source_document_id": "p04032", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven a string t, we will call it unbalanced if and only if the length of t is at least 2, and more than half of the letters in t are the same. For example, both voodoo and melee are unbalanced, while neither noon nor a is.\n\nYou are given a string s consisting of lowercase letters. Determine if there exists a (contiguous) substring of s that is unbalanced. If the answer is positive, show a position where such a substring occurs in s.\n\nConstraints\n\n2 ≦ |s| ≦ 10^5\n\ns consists of lowercase letters.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 2 ≦ N ≦ 100.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf there exists no unbalanced substring of s, print -1 -1.\n\nIf there exists an unbalanced substring of s, let one such substring be s_a s_{a+1} ... s_{b} (1 ≦ a < b ≦ |s|), and print a b. If there exists more than one such substring, any of them will be accepted.\n\nSample Input 1\n\nneeded\n\nSample Output 1\n\n2 5\n\nThe string s_2 s_3 s_4 s_5 = eede is unbalanced. There are also other unbalanced substrings. For example, the output 2 6 will also be accepted.\n\nSample Input 2\n\natcoder\n\nSample Output 2\n\n-1 -1\n\nThe string atcoder contains no unbalanced substring.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 848, "cpu_time_ms": 2105, "memory_kb": 23180}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s308992803", "group_id": "codeNet:p04032", "input_text": " ($num_length/2)) {\n\t\t\t$result['value'] = true;\n\t\t\t$result['position_start'] = strpos($string, $char) + 1;\n\t\t\t$result['position_end'] = (strpos($string, $string_check) + 1) + ($num_length - 1);\n\t\t\treturn $result;\n\t\t}\n\t}\n\treturn $result;\n}\nfunction createAllSubStr($string, $array_char) \n{\n\t$array_sub_string = array();\n\t$count_letter = count($array_char);\n\tunset($array_char[0]);\n\tfor ($i = 2; $i < $count_letter; $i++) {\n\t\tfor ($j = 1; $j < $count_letter; $j++) {\n\t\t\t$str_string = substr($string, $j, $i);\n\t\t\tif (strlen($str_string) > 1) {\n\t\t\t\t$array_sub_string[] = $str_string;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $count_letter; $i++) {\n\t\tunset($array_char[$i]);\n\t\tif (count($array_char) >= 2) {\n\t\t\t$array_sub_string[] = implode(\"\", $array_char);\n\t\t}\n\t}\n\n\treturn $array_sub_string;\n}\n\n\nfscanf(STDIN, \"%s\", $string);\n$array_char = getArrayChar($string); \n$array_sub_string = createAllSubStr($string, $array_char);\n$count_sub_string = count($array_sub_string);\n$has_unbalance = false;\nfor ($i = 0; $i < $count_sub_string; $i++) {\n\t$result = checkIsUnbalance($string, $array_sub_string[$i]);\n\tif ($result['value']) {\n\t\t$has_unbalance = true;\n\t\techo $result['position_start'] . \" \" . $result['position_end'];\n\t\treturn;\n\t}\n}\n\nif (!$has_unbalance) {\n\techo \"-1 -1 \";\n}\n\n?>", "language": "PHP", "metadata": {"date": 1490895625, "filename_ext": "php", "original_language": "PHP (5.6.30)", "problem_description_relpath": "problem_descriptions/p04032.html", "problem_id": "p04032", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04032/input.txt", "sample_output_relpath": "derived/input_output/data/p04032/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04032/PHP/s308992803.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s308992803", "user_id": "u518282485"}, "prompt_components": {"gold_output": "2 5\n", "input_to_evaluate": " ($num_length/2)) {\n\t\t\t$result['value'] = true;\n\t\t\t$result['position_start'] = strpos($string, $char) + 1;\n\t\t\t$result['position_end'] = (strpos($string, $string_check) + 1) + ($num_length - 1);\n\t\t\treturn $result;\n\t\t}\n\t}\n\treturn $result;\n}\nfunction createAllSubStr($string, $array_char) \n{\n\t$array_sub_string = array();\n\t$count_letter = count($array_char);\n\tunset($array_char[0]);\n\tfor ($i = 2; $i < $count_letter; $i++) {\n\t\tfor ($j = 1; $j < $count_letter; $j++) {\n\t\t\t$str_string = substr($string, $j, $i);\n\t\t\tif (strlen($str_string) > 1) {\n\t\t\t\t$array_sub_string[] = $str_string;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $count_letter; $i++) {\n\t\tunset($array_char[$i]);\n\t\tif (count($array_char) >= 2) {\n\t\t\t$array_sub_string[] = implode(\"\", $array_char);\n\t\t}\n\t}\n\n\treturn $array_sub_string;\n}\n\n\nfscanf(STDIN, \"%s\", $string);\n$array_char = getArrayChar($string); \n$array_sub_string = createAllSubStr($string, $array_char);\n$count_sub_string = count($array_sub_string);\n$has_unbalance = false;\nfor ($i = 0; $i < $count_sub_string; $i++) {\n\t$result = checkIsUnbalance($string, $array_sub_string[$i]);\n\tif ($result['value']) {\n\t\t$has_unbalance = true;\n\t\techo $result['position_start'] . \" \" . $result['position_end'];\n\t\treturn;\n\t}\n}\n\nif (!$has_unbalance) {\n\techo \"-1 -1 \";\n}\n\n?>", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven a string t, we will call it unbalanced if and only if the length of t is at least 2, and more than half of the letters in t are the same. For example, both voodoo and melee are unbalanced, while neither noon nor a is.\n\nYou are given a string s consisting of lowercase letters. Determine if there exists a (contiguous) substring of s that is unbalanced. If the answer is positive, show a position where such a substring occurs in s.\n\nConstraints\n\n2 ≦ |s| ≦ 10^5\n\ns consists of lowercase letters.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 2 ≦ N ≦ 100.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf there exists no unbalanced substring of s, print -1 -1.\n\nIf there exists an unbalanced substring of s, let one such substring be s_a s_{a+1} ... s_{b} (1 ≦ a < b ≦ |s|), and print a b. If there exists more than one such substring, any of them will be accepted.\n\nSample Input 1\n\nneeded\n\nSample Output 1\n\n2 5\n\nThe string s_2 s_3 s_4 s_5 = eede is unbalanced. There are also other unbalanced substrings. For example, the output 2 6 will also be accepted.\n\nSample Input 2\n\natcoder\n\nSample Output 2\n\n-1 -1\n\nThe string atcoder contains no unbalanced substring.", "sample_input": "needed\n"}, "reference_outputs": ["2 5\n"], "source_document_id": "p04032", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven a string t, we will call it unbalanced if and only if the length of t is at least 2, and more than half of the letters in t are the same. For example, both voodoo and melee are unbalanced, while neither noon nor a is.\n\nYou are given a string s consisting of lowercase letters. Determine if there exists a (contiguous) substring of s that is unbalanced. If the answer is positive, show a position where such a substring occurs in s.\n\nConstraints\n\n2 ≦ |s| ≦ 10^5\n\ns consists of lowercase letters.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 2 ≦ N ≦ 100.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf there exists no unbalanced substring of s, print -1 -1.\n\nIf there exists an unbalanced substring of s, let one such substring be s_a s_{a+1} ... s_{b} (1 ≦ a < b ≦ |s|), and print a b. If there exists more than one such substring, any of them will be accepted.\n\nSample Input 1\n\nneeded\n\nSample Output 1\n\n2 5\n\nThe string s_2 s_3 s_4 s_5 = eede is unbalanced. There are also other unbalanced substrings. For example, the output 2 6 will also be accepted.\n\nSample Input 2\n\natcoder\n\nSample Output 2\n\n-1 -1\n\nThe string atcoder contains no unbalanced substring.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1833, "cpu_time_ms": 2162, "memory_kb": 928012}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s961898254", "group_id": "codeNet:p04033", "input_text": " 0 && $b > 0){\n echo \"Positive\\n\";\n}elseif($a * $b <= 0){\n echo \"Zero\\n\";\n}else{\n echo (($b - $a) % 2) == 0 ? \"Negative\\n\" : \"Positive\\n\";\n}", "language": "PHP", "metadata": {"date": 1555858254, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p04033.html", "problem_id": "p04033", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04033/input.txt", "sample_output_relpath": "derived/input_output/data/p04033/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04033/PHP/s961898254.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s961898254", "user_id": "u248209126"}, "prompt_components": {"gold_output": "Positive\n", "input_to_evaluate": " 0 && $b > 0){\n echo \"Positive\\n\";\n}elseif($a * $b <= 0){\n echo \"Zero\\n\";\n}else{\n echo (($b - $a) % 2) == 0 ? \"Negative\\n\" : \"Positive\\n\";\n}", "problem_context": "Problem Statement\n\nYou are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.\n\nConstraints\n\na and b are integers.\n\n-10^9≤a≤b≤10^9\n\nPartial Score\n\nIn test cases worth 100 points, -10≤a≤b≤10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nPositive\n\n1×2×3=6 is positive.\n\nSample Input 2\n\n-3 -1\n\nSample Output 2\n\nNegative\n\n(-3)×(-2)×(-1)=-6 is negative.\n\nSample Input 3\n\n-1 1\n\nSample Output 3\n\nZero\n\n(-1)×0×1=0.", "sample_input": "1 3\n"}, "reference_outputs": ["Positive\n"], "source_document_id": "p04033", "source_text": "Problem Statement\n\nYou are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.\n\nConstraints\n\na and b are integers.\n\n-10^9≤a≤b≤10^9\n\nPartial Score\n\nIn test cases worth 100 points, -10≤a≤b≤10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nPositive\n\n1×2×3=6 is positive.\n\nSample Input 2\n\n-3 -1\n\nSample Output 2\n\nNegative\n\n(-3)×(-2)×(-1)=-6 is negative.\n\nSample Input 3\n\n-1 1\n\nSample Output 3\n\nZero\n\n(-1)×0×1=0.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 211, "cpu_time_ms": 9, "memory_kb": 4604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s561355395", "group_id": "codeNet:p04039", "input_text": "= $count) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (count($args) >= $count) {\n\t\tbreak;\n\t}\n}\n\n$e_str = (string)$expend;\n$len = strlen($e_str);//桁数\n\nwhile (true) {\n\tif (validate($expend, $args)) {\n\t\techo $expend;\n\t\texit(0);\n\t}\n\t$expend = $expend + 1;\n}\n\n\nfunction validate($int, $not_usable){\n\t$str = (string)$int;\n\t$c = count($str);\n\tfor ($i=0; $i < $c; $i++) { \n\t\tif (in_array($str[$i], $not_usable)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "language": "PHP", "metadata": {"date": 1533142136, "filename_ext": "php", "original_language": "PHP7 (7.0.15)", "problem_description_relpath": "problem_descriptions/p04045.html", "problem_id": "p04045", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04045/input.txt", "sample_output_relpath": "derived/input_output/data/p04045/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04045/PHP/s871181688.php", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s871181688", "user_id": "u699888017"}, "prompt_components": {"gold_output": "2000\n", "input_to_evaluate": "= $count) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (count($args) >= $count) {\n\t\tbreak;\n\t}\n}\n\n$e_str = (string)$expend;\n$len = strlen($e_str);//桁数\n\nwhile (true) {\n\tif (validate($expend, $args)) {\n\t\techo $expend;\n\t\texit(0);\n\t}\n\t$expend = $expend + 1;\n}\n\n\nfunction validate($int, $not_usable){\n\t$str = (string)$int;\n\t$c = count($str);\n\tfor ($i=0; $i < $c; $i++) { \n\t\tif (in_array($str[$i], $not_usable)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "sample_input": "1000 8\n1 3 4 5 6 7 8 9\n"}, "reference_outputs": ["2000\n"], "source_document_id": "p04045", "source_text": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 698, "cpu_time_ms": 12, "memory_kb": 4728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:PHP:s347780468", "group_id": "codeNet:p04047", "input_text": "