{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s838884585", "group_id": "codeNet:p02534", "input_text": "say ACL x<>", "language": "Perl", "metadata": {"date": 1601174607, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02534.html", "problem_id": "p02534", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02534/input.txt", "sample_output_relpath": "derived/input_output/data/p02534/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02534/Perl/s838884585.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s838884585", "user_id": "u521712919"}, "prompt_components": {"gold_output": "ACLACLACL\n", "input_to_evaluate": "say ACL x<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer K.\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nFor example, if K = 3, print ACLACLACL.\n\nConstraints\n\n1 \\leq K \\leq 5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nACLACLACL", "sample_input": "3\n"}, "reference_outputs": ["ACLACLACL\n"], "source_document_id": "p02534", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer K.\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nFor example, if K = 3, print ACLACLACL.\n\nConstraints\n\n1 \\leq K \\leq 5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nACLACLACL", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 11, "cpu_time_ms": 2, "memory_kb": 4720}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s258339216", "group_id": "codeNet:p02547", "input_text": "$n=<>;\n@a=map{\n\t($a,$b)=glob<>;\n\t$a==$b?1:0\n}0..$n-1;\nfor$i(0..$n-3){\n\tif($a[$i]&&$a[$i+1]&&$a[$i+2]){\n\t\tprint \"Yes\";\n\t\texit;\n\t}\n}\nprint \"No\";", "language": "Perl", "metadata": {"date": 1600546047, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02547.html", "problem_id": "p02547", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02547/input.txt", "sample_output_relpath": "derived/input_output/data/p02547/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02547/Perl/s258339216.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s258339216", "user_id": "u172873334"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$n=<>;\n@a=map{\n\t($a,$b)=glob<>;\n\t$a==$b?1:0\n}0..$n-1;\nfor$i(0..$n-3){\n\tif($a[$i]&&$a[$i+1]&&$a[$i+2]){\n\t\tprint \"Yes\";\n\t\texit;\n\t}\n}\nprint \"No\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTak performed the following action N times: rolling two dice.\nThe result of the i-th roll is D_{i,1} and D_{i,2}.\n\nCheck if doublets occurred at least three times in a row.\nSpecifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1\\leq D_{i,j} \\leq 6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_{1,1} D_{1,2}\n\\vdots\nD_{N,1} D_{N,2}\n\nOutput\n\nPrint Yes if doublets occurred at least three times in a row. Print No otherwise.\n\nSample Input 1\n\n5\n1 2\n6 6\n4 4\n3 3\n3 2\n\nSample Output 1\n\nYes\n\nFrom the second roll to the fourth roll, three doublets occurred in a row.\n\nSample Input 2\n\n5\n1 1\n2 2\n3 4\n5 5\n6 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n1 1\n2 2\n3 3\n4 4\n5 5\n6 6\n\nSample Output 3\n\nYes", "sample_input": "5\n1 2\n6 6\n4 4\n3 3\n3 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02547", "source_text": "Score : 200 points\n\nProblem Statement\n\nTak performed the following action N times: rolling two dice.\nThe result of the i-th roll is D_{i,1} and D_{i,2}.\n\nCheck if doublets occurred at least three times in a row.\nSpecifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1\\leq D_{i,j} \\leq 6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_{1,1} D_{1,2}\n\\vdots\nD_{N,1} D_{N,2}\n\nOutput\n\nPrint Yes if doublets occurred at least three times in a row. Print No otherwise.\n\nSample Input 1\n\n5\n1 2\n6 6\n4 4\n3 3\n3 2\n\nSample Output 1\n\nYes\n\nFrom the second roll to the fourth roll, three doublets occurred in a row.\n\nSample Input 2\n\n5\n1 1\n2 2\n3 4\n5 5\n6 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n1 1\n2 2\n3 3\n4 4\n5 5\n6 6\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 14, "memory_kb": 5368}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s880454222", "group_id": "codeNet:p02549", "input_text": "@N=1..<>;@A=<>;@d=(1,-1);map{$s+=shift@d;$s%=998244353;$d[$`-/ /]+=$s,$d[$']-=$s for@A;}@N;print$s", "language": "Perl", "metadata": {"date": 1600548825, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02549.html", "problem_id": "p02549", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02549/input.txt", "sample_output_relpath": "derived/input_output/data/p02549/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02549/Perl/s880454222.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s880454222", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "@N=1..<>;@A=<>;@d=(1,-1);map{$s+=shift@d;$s%=998244353;$d[$`-/ /]+=$s,$d[$']-=$s for@A;}@N;print$s", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N cells arranged in a row, numbered 1, 2, \\ldots, N from left to right.\n\nTak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below.\n\nYou are given an integer K that is less than or equal to 10, and K non-intersecting segments [L_1, R_1], [L_2, R_2], \\ldots, [L_K, R_K].\nLet S be the union of these K segments.\nHere, the segment [l, r] denotes the set consisting of all integers i that satisfy l \\leq i \\leq r.\n\n\bWhen you are on Cell i, pick an integer d from S and move to Cell i + d. You cannot move out of the cells.\n\nTo help Tak, find the number of ways to go to Cell N, modulo 998244353.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\min(N, 10)\n\n1 \\leq L_i \\leq R_i \\leq N\n\n[L_i, R_i] and [L_j, R_j] do not intersect (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 K\nL_1 R_1\nL_2 R_2\n:\nL_K R_K\n\nOutput\n\nPrint the number of ways for Tak to go from Cell 1 to Cell N, modulo 998244353.\n\nSample Input 1\n\n5 2\n1 1\n3 4\n\nSample Output 1\n\n4\n\nThe set S is the union of the segment [1, 1] and the segment [3, 4], therefore S = \\{ 1, 3, 4 \\} holds.\n\nThere are 4 possible ways to get to Cell 5:\n\n1 \\to 2 \\to 3 \\to 4 \\to 5,\n\n1 \\to 2 \\to 5,\n\n1 \\to 4 \\to 5 and\n\n1 \\to 5.\n\nSample Input 2\n\n5 2\n3 3\n5 5\n\nSample Output 2\n\n0\n\nBecause S = \\{ 3, 5 \\} holds, you cannot reach to Cell 5.\nPrint 0.\n\nSample Input 3\n\n5 1\n1 2\n\nSample Output 3\n\n5\n\nSample Input 4\n\n60 3\n5 8\n1 3\n10 15\n\nSample Output 4\n\n221823067\n\nNote that you have to print the answer modulo 998244353.", "sample_input": "5 2\n1 1\n3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02549", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N cells arranged in a row, numbered 1, 2, \\ldots, N from left to right.\n\nTak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below.\n\nYou are given an integer K that is less than or equal to 10, and K non-intersecting segments [L_1, R_1], [L_2, R_2], \\ldots, [L_K, R_K].\nLet S be the union of these K segments.\nHere, the segment [l, r] denotes the set consisting of all integers i that satisfy l \\leq i \\leq r.\n\n\bWhen you are on Cell i, pick an integer d from S and move to Cell i + d. You cannot move out of the cells.\n\nTo help Tak, find the number of ways to go to Cell N, modulo 998244353.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\min(N, 10)\n\n1 \\leq L_i \\leq R_i \\leq N\n\n[L_i, R_i] and [L_j, R_j] do not intersect (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 K\nL_1 R_1\nL_2 R_2\n:\nL_K R_K\n\nOutput\n\nPrint the number of ways for Tak to go from Cell 1 to Cell N, modulo 998244353.\n\nSample Input 1\n\n5 2\n1 1\n3 4\n\nSample Output 1\n\n4\n\nThe set S is the union of the segment [1, 1] and the segment [3, 4], therefore S = \\{ 1, 3, 4 \\} holds.\n\nThere are 4 possible ways to get to Cell 5:\n\n1 \\to 2 \\to 3 \\to 4 \\to 5,\n\n1 \\to 2 \\to 5,\n\n1 \\to 4 \\to 5 and\n\n1 \\to 5.\n\nSample Input 2\n\n5 2\n3 3\n5 5\n\nSample Output 2\n\n0\n\nBecause S = \\{ 3, 5 \\} holds, you cannot reach to Cell 5.\nPrint 0.\n\nSample Input 3\n\n5 1\n1 2\n\nSample Output 3\n\n5\n\nSample Input 4\n\n60 3\n5 8\n1 3\n10 15\n\nSample Output 4\n\n221823067\n\nNote that you have to print the answer modulo 998244353.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 98, "cpu_time_ms": 739, "memory_kb": 23916}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s234018454", "group_id": "codeNet:p02552", "input_text": "#!/usr/bin/perl\n\nmy ($x) = map { $_ - 0 } split(/\\s+/,);\n\n$x = 1 - $x;\n\nprint \"$x\\n\";\n\n\n\n", "language": "Perl", "metadata": {"date": 1600023637, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02552.html", "problem_id": "p02552", "resource_group": "low_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/Perl/s234018454.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s234018454", "user_id": "u750383873"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($x) = map { $_ - 0 } split(/\\s+/,);\n\n$x = 1 - $x;\n\nprint \"$x\\n\";\n\n\n\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 4864}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s267411763", "group_id": "codeNet:p02554", "input_text": "#!/usr/bin/perl\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\n\nmy $md = 10 ** 9 + 7;\n\nmy $k1 = 1;\nmy $k2 = 1;\nmy $k3 = 1;\n\nfor(my $i=0;$i<$n;$i++){\n $k1 = ( $k1 * 10 ) % $md;\n $k2 = ( $k2 * 9 ) % $md;\n $k3 = ( $k3 * 8 ) % $md;\n}\n\nmy $r = (10*$md + $k1 - 2 * $k2 + $k3) % $md;\n\nprint \"$r\\n\";\n\n\n", "language": "Perl", "metadata": {"date": 1600024171, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02554.html", "problem_id": "p02554", "resource_group": "low_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/Perl/s267411763.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s267411763", "user_id": "u750383873"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\n\nmy $md = 10 ** 9 + 7;\n\nmy $k1 = 1;\nmy $k2 = 1;\nmy $k3 = 1;\n\nfor(my $i=0;$i<$n;$i++){\n $k1 = ( $k1 * 10 ) % $md;\n $k2 = ( $k2 * 9 ) % $md;\n $k3 = ( $k3 * 8 ) % $md;\n}\n\nmy $r = (10*$md + $k1 - 2 * $k2 + $k3) % $md;\n\nprint \"$r\\n\";\n\n\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 298, "cpu_time_ms": 165, "memory_kb": 4820}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s922261723", "group_id": "codeNet:p02557", "input_text": "#!/usr/bin/perl\nuse Data::Dumper;\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @A = map { $_ - 0 } split(/\\s+/,);\nmy @B = map { $_ - 0 } split(/\\s+/,);\n\nmy %cA = ();\nmy %cB = ();\nfor(my $i=0;$i<$n;$i++){\n $cA{$A[$i]}++;\n $cB{$B[$i]}++;\n}\n\nforeach my $v ( keys %cA ){\n if( exists($cB{$v}) ){\n my $c = $cA{$v} - 0;\n if( $cB{$v} - 0 > $n - $c ){\n print \"No\\n\"; exit(0);\n }\n }\n}\n\nmy @kB = map { +[$_ - 0, $cB{$_}] } keys %cB;\nmy $ik = $#kB;\n\nprint \"Yes\\n\";\nmy @r = (); $#r = $n - 1;\nfor(my $i=0;$i<$n;$i++){\n while( $kB[$ik]->[0] == $A[$i] ){\n $ik--;\n $ik = $#kB if $ik < 0;\n }\n $r[$i] = $kB[$ik]->[0];\n $kB[$ik]->[1] --;\n if( $kB[$ik]->[1] <= 0 ){\n $kB[$ik] = $kB[$#kB];\n $#kB --;\n $ik = 0 if $ik > $#kB;\n }\n}\nmy $rr = join(' ',@r);\nprint \"$rr\\n\";\n\n", "language": "Perl", "metadata": {"date": 1600110425, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02557.html", "problem_id": "p02557", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02557/input.txt", "sample_output_relpath": "derived/input_output/data/p02557/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02557/Perl/s922261723.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s922261723", "user_id": "u750383873"}, "prompt_components": {"gold_output": "Yes\n2 2 3 1 1 1\n", "input_to_evaluate": "#!/usr/bin/perl\nuse Data::Dumper;\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @A = map { $_ - 0 } split(/\\s+/,);\nmy @B = map { $_ - 0 } split(/\\s+/,);\n\nmy %cA = ();\nmy %cB = ();\nfor(my $i=0;$i<$n;$i++){\n $cA{$A[$i]}++;\n $cB{$B[$i]}++;\n}\n\nforeach my $v ( keys %cA ){\n if( exists($cB{$v}) ){\n my $c = $cA{$v} - 0;\n if( $cB{$v} - 0 > $n - $c ){\n print \"No\\n\"; exit(0);\n }\n }\n}\n\nmy @kB = map { +[$_ - 0, $cB{$_}] } keys %cB;\nmy $ik = $#kB;\n\nprint \"Yes\\n\";\nmy @r = (); $#r = $n - 1;\nfor(my $i=0;$i<$n;$i++){\n while( $kB[$ik]->[0] == $A[$i] ){\n $ik--;\n $ik = $#kB if $ik < 0;\n }\n $r[$i] = $kB[$ik]->[0];\n $kB[$ik]->[1] --;\n if( $kB[$ik]->[1] <= 0 ){\n $kB[$ik] = $kB[$#kB];\n $#kB --;\n $ik = 0 if $ik > $#kB;\n }\n}\nmy $rr = join(' ',@r);\nprint \"$rr\\n\";\n\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are two sequences A and B, both of length N.\nA and B are each sorted in the ascending order.\nCheck if it is possible to reorder the terms of B so that for each i (1 \\leq i \\leq N) A_i \\neq B_i holds, and if it is possible, output any of the reorderings that achieve it.\n\nConstraints\n\n1\\leq N \\leq 2 \\times 10^5\n\n1\\leq A_i,B_i \\leq N\n\nA and B are each sorted in the ascending order.\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 \\cdots A_N\nB_1 B_2 \\cdots B_N\n\nOutput\n\nIf there exist no reorderings that satisfy the condition, print No.\n\nIf there exists a reordering that satisfies the condition, print Yes on the first line.\nAfter that, print a reordering of B on the second line, separating terms with a whitespace.\n\nIf there are multiple reorderings that satisfy the condition, you can print any of them.\n\nSample Input 1\n\n6\n1 1 1 2 2 3\n1 1 1 2 2 3\n\nSample Output 1\n\nYes\n2 2 3 1 1 1\n\nSample Input 2\n\n3\n1 1 2\n1 1 3\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n1 1 2 3\n1 2 3 3\n\nSample Output 3\n\nYes\n3 3 1 2", "sample_input": "6\n1 1 1 2 2 3\n1 1 1 2 2 3\n"}, "reference_outputs": ["Yes\n2 2 3 1 1 1\n"], "source_document_id": "p02557", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are two sequences A and B, both of length N.\nA and B are each sorted in the ascending order.\nCheck if it is possible to reorder the terms of B so that for each i (1 \\leq i \\leq N) A_i \\neq B_i holds, and if it is possible, output any of the reorderings that achieve it.\n\nConstraints\n\n1\\leq N \\leq 2 \\times 10^5\n\n1\\leq A_i,B_i \\leq N\n\nA and B are each sorted in the ascending order.\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 \\cdots A_N\nB_1 B_2 \\cdots B_N\n\nOutput\n\nIf there exist no reorderings that satisfy the condition, print No.\n\nIf there exists a reordering that satisfies the condition, print Yes on the first line.\nAfter that, print a reordering of B on the second line, separating terms with a whitespace.\n\nIf there are multiple reorderings that satisfy the condition, you can print any of them.\n\nSample Input 1\n\n6\n1 1 1 2 2 3\n1 1 1 2 2 3\n\nSample Output 1\n\nYes\n2 2 3 1 1 1\n\nSample Input 2\n\n3\n1 1 2\n1 1 3\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n1 1 2 3\n1 2 3 3\n\nSample Output 3\n\nYes\n3 3 1 2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 805, "cpu_time_ms": 2207, "memory_kb": 136788}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s628839197", "group_id": "codeNet:p02558", "input_text": "package dsu;\nsub new{\n\treturn bless[(-1)x$_[1]],$_[0];\n}\nsub merge{\n\tmy$self=shift;\n\tmy$x=$self->leader($_[1]);\n\tmy$y=$self->leader($_[2]);\n\treturn$x if$x==$y;\n\t($x,$y)=($y,$x)if-$self->[$x]<-$self->[$y];\n\t$self->[$x]+=$self->[$y];\n\treturn$self->[$y]=$x;\n}\nsub same{\n\tmy$self=shift;\n\treturn$self->leader($_[1])==$self->leader($_[2]);\n}\nsub leader{\n\tmy$self=shift;\n\tmy$a=shift;\n\treturn$self->[$a]<0?$a:($self->[$a]=$self->leader($self->[$a]));\n}\nsub size{\n\treturn-$_[0]->[$_[1]];\n}\nsub groups{\n}\npackage main;\nmy($N,$Q)=split$\",<>;\nmy$dsu=dsu->new($N);\nfor(1..$Q){\n\tmy($t,$u,$v)=split$\",<>;\n\tif($t==0){\n\t\t$dsu->merge($u,$v);\n\t}\n\telse{\n\t\tprint $dsu->same($u,$v)?1:0,$/;\n\t}\n}", "language": "Perl", "metadata": {"date": 1599691050, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02558.html", "problem_id": "p02558", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02558/input.txt", "sample_output_relpath": "derived/input_output/data/p02558/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02558/Perl/s628839197.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s628839197", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0\n1\n0\n1\n", "input_to_evaluate": "package dsu;\nsub new{\n\treturn bless[(-1)x$_[1]],$_[0];\n}\nsub merge{\n\tmy$self=shift;\n\tmy$x=$self->leader($_[1]);\n\tmy$y=$self->leader($_[2]);\n\treturn$x if$x==$y;\n\t($x,$y)=($y,$x)if-$self->[$x]<-$self->[$y];\n\t$self->[$x]+=$self->[$y];\n\treturn$self->[$y]=$x;\n}\nsub same{\n\tmy$self=shift;\n\treturn$self->leader($_[1])==$self->leader($_[2]);\n}\nsub leader{\n\tmy$self=shift;\n\tmy$a=shift;\n\treturn$self->[$a]<0?$a:($self->[$a]=$self->leader($self->[$a]));\n}\nsub size{\n\treturn-$_[0]->[$_[1]];\n}\nsub groups{\n}\npackage main;\nmy($N,$Q)=split$\",<>;\nmy$dsu=dsu->new($N);\nfor(1..$Q){\n\tmy($t,$u,$v)=split$\",<>;\n\tif($t==0){\n\t\t$dsu->merge($u,$v);\n\t}\n\telse{\n\t\tprint $dsu->same($u,$v)?1:0,$/;\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an undirected graph with N vertices and 0 edges. Process Q queries of the following types.\n\n0 u v: Add an edge (u, v).\n\n1 u v: Print 1 if u and v are in the same connected component, 0 otherwise.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq Q \\leq 200,000\n\n0 \\leq u_i, v_i \\lt N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nt_1 u_1 v_1\nt_2 u_2 v_2\n:\nt_Q u_Q v_Q\n\n出力\n\nFor each query of the latter type, print the answer.\n\nSample Input 1\n\n4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n\nSample Output 1\n\n0\n1\n0\n1", "sample_input": "4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n"}, "reference_outputs": ["0\n1\n0\n1\n"], "source_document_id": "p02558", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an undirected graph with N vertices and 0 edges. Process Q queries of the following types.\n\n0 u v: Add an edge (u, v).\n\n1 u v: Print 1 if u and v are in the same connected component, 0 otherwise.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq Q \\leq 200,000\n\n0 \\leq u_i, v_i \\lt N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nt_1 u_1 v_1\nt_2 u_2 v_2\n:\nt_Q u_Q v_Q\n\n出力\n\nFor each query of the latter type, print the answer.\n\nSample Input 1\n\n4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n\nSample Output 1\n\n0\n1\n0\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 672, "cpu_time_ms": 721, "memory_kb": 15068}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s747124745", "group_id": "codeNet:p02559", "input_text": "sub f{($x,$=)=@_;$B[$=]+=$x,$=+=$=&-$=until$=>5e5}sub a{($=,$s)=@_;0while$s+=$B[$=],$=&=$=-1;$s}<>;f$_,++$-for glob<>;/ .* />$`?f$',$&+1:print$/,a($')-a$&for<>", "language": "Perl", "metadata": {"date": 1599582398, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02559.html", "problem_id": "p02559", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02559/input.txt", "sample_output_relpath": "derived/input_output/data/p02559/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02559/Perl/s747124745.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s747124745", "user_id": "u657913472"}, "prompt_components": {"gold_output": "15\n7\n25\n6\n", "input_to_evaluate": "sub f{($x,$=)=@_;$B[$=]+=$x,$=+=$=&-$=until$=>5e5}sub a{($=,$s)=@_;0while$s+=$B[$=],$=&=$=-1;$s}<>;f$_,++$-for glob<>;/ .* />$`?f$',$&+1:print$/,a($')-a$&for<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an array a_0, a_1, ..., a_{N-1} of length N. Process Q queries of the following types.\n\n0 p x: a_p \\gets a_p + x\n\n1 l r: Print \\sum_{i = l}^{r - 1}{a_i}.\n\nConstraints\n\n1 \\leq N, Q \\leq 500,000\n\n0 \\leq a_i, x \\leq 10^9\n\n0 \\leq p < N\n\n0 \\leq l_i < r_i \\leq N\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_0 a_1 ... a_{N - 1}\n\\textrm{Query}_0\n\\textrm{Query}_1\n:\n\\textrm{Query}_{Q - 1}\n\nOutput\n\nFor each query of the latter type, print the answer.\n\nSample Input 1\n\n5 5\n1 2 3 4 5\n1 0 5\n1 2 4\n0 3 10\n1 0 5\n1 0 3\n\nSample Output 1\n\n15\n7\n25\n6", "sample_input": "5 5\n1 2 3 4 5\n1 0 5\n1 2 4\n0 3 10\n1 0 5\n1 0 3\n"}, "reference_outputs": ["15\n7\n25\n6\n"], "source_document_id": "p02559", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an array a_0, a_1, ..., a_{N-1} of length N. Process Q queries of the following types.\n\n0 p x: a_p \\gets a_p + x\n\n1 l r: Print \\sum_{i = l}^{r - 1}{a_i}.\n\nConstraints\n\n1 \\leq N, Q \\leq 500,000\n\n0 \\leq a_i, x \\leq 10^9\n\n0 \\leq p < N\n\n0 \\leq l_i < r_i \\leq N\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_0 a_1 ... a_{N - 1}\n\\textrm{Query}_0\n\\textrm{Query}_1\n:\n\\textrm{Query}_{Q - 1}\n\nOutput\n\nFor each query of the latter type, print the answer.\n\nSample Input 1\n\n5 5\n1 2 3 4 5\n1 0 5\n1 2 4\n0 3 10\n1 0 5\n1 0 3\n\nSample Output 1\n\n15\n7\n25\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5523, "memory_kb": 215408}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s993358768", "group_id": "codeNet:p02563", "input_text": "use strict;\nuse warnings;\npackage Convolution;\nuse integer;\nsub MOD(){998244353};\nsub primitive_root(){3};\nsub bsf($){\n\tmy$x=shift;\n\tmy$c=0;\n\t$c++until$x>>$c&1;\n\treturn$c;\n}\nsub powermod($$){\n\tmy($v,$w)=@_;\n\tmy$r=1;\n\t$v%=MOD;\n\twhile($w>0){\n\t\t$r=$r*$v%MOD if$w&1;\n\t\t$v=$v*$v%MOD;\n\t\t$w>>=1;\n\t}\n\treturn$r;\n}\n\nmy(@es,@ies,@sum_e,@sum_ie);\n{\n\tmy$cnt2=bsf(MOD-1);\n\tmy$e=powermod(primitive_root,MOD-1>>$cnt2);\n\tmy$ie=powermod($e,MOD-2);\n\tfor(my$i=$cnt2;$i>=2;$i--){\n\t\t$es[$i-2]=$e;\n\t\t$ies[$i-2]=$ie;\n\t\t$e=$e*$e%MOD;\n\t\t$ie=$ie*$ie%MOD;\n\t}\n\tmy$now=1;\n\tmy$inow=1;\n\tfor(0..$cnt2-3){\n\t\t$sum_e[$_]=$es[$_]*$now%MOD;\n\t\t$now=$now*$ies[$_]%MOD;\n\t\t$sum_ie[$_]=$ies[$_]*$inow%MOD;\n\t\t$inow=$inow*$es[$_]%MOD;\n\t}\n}\n\nsub convolution(\\@\\@){\n\tmy@a=@{$_[0]};\n\tmy@b=@{$_[1]};\n\tmy$n=@a;\n\tmy$m=@b;\n\treturn()if$n==0||$m==0;\n\tmy$h=0;\n\t$h++while$n+$m-1>1<<$h;\n\tmy$z=1<<$h;\n\n\tmy@bsf;\n\tfor(0..$z/2-1){\n\t\t$bsf[$_]=bsf(~$_);\n\t}\n\n\t$#a=$z-1;\n\t$#b=$z-1;\n\n\t#butterfly @a,@b\n\tfor my$ph(1..$h){\n\t\tmy$w=1<<$ph-1;\n\t\tmy$p=1<<$h-$ph;\n\t\tmy$now=1;\n\t\tfor my$s(0..$w-1){\n\t\t\tmy$offset=$s<<$h-$ph+1;\n\t\t\tfor($offset..$offset+$p-1){\n\t\t\t\tmy$l=$a[$_];\n\t\t\t\tmy$r=$a[$_+$p]*$now%MOD;\n\t\t\t\t$a[$_]=($l+$r)%MOD;\n\t\t\t\t$a[$_+$p]=($l-$r+MOD)%MOD;\n\t\t\t\t$l=$b[$_];\n\t\t\t\t$r=$b[$_+$p]*$now%MOD;\n\t\t\t\t$b[$_]=($l+$r)%MOD;\n\t\t\t\t$b[$_+$p]=($l-$r+MOD)%MOD;\n\t\t\t}\n\t\t\t$now=$now*$sum_e[$bsf[$s]]%MOD;\n\t\t}\n\t}\n\n\t$a[$_]=$a[$_]*$b[$_]%MOD for 0..$z-1;\n\n\t#butterfly_inv @a\n\tfor(my$ph=$h;$ph>=1;$ph--){\n\t\tmy$w=1<<$ph-1;\n\t\tmy$p=1<<$h-$ph;\n\t\tmy$inow=1;\n\t\tfor my$s(0..$w-1){\n\t\t\tmy$offset=$s<<$h-$ph+1;\n\t\t\tfor($offset..$offset+$p-1){\n\t\t\t\tmy$l=$a[$_];\n\t\t\t\tmy$r=$a[$_+$p];\n\t\t\t\t$a[$_]=($l+$r)%MOD;\n\t\t\t\t$a[$_+$p]=($l-$r+MOD)*$inow%MOD;\n\t\t\t}\n\t\t\t$inow=$inow*$sum_ie[$bsf[$s]]%MOD;\n\t\t}\n\t}\n\n\t$#a=$n+$m-2;\n\tmy$iz=powermod($z,MOD-2);\n\t$_=$_*$iz%MOD for@a;\n\treturn@a;\n}\nno integer;\npackage main;\nmy($N,$M)=split$\",<>;\nmy@a=split$\",<>;\nmy@b=split$\",<>;\nprint$_,$/for Convolution::convolution(@a,@b);\n", "language": "Perl", "metadata": {"date": 1599846791, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02563.html", "problem_id": "p02563", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02563/input.txt", "sample_output_relpath": "derived/input_output/data/p02563/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02563/Perl/s993358768.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s993358768", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5 16 34 60 70 70 59 36\n", "input_to_evaluate": "use strict;\nuse warnings;\npackage Convolution;\nuse integer;\nsub MOD(){998244353};\nsub primitive_root(){3};\nsub bsf($){\n\tmy$x=shift;\n\tmy$c=0;\n\t$c++until$x>>$c&1;\n\treturn$c;\n}\nsub powermod($$){\n\tmy($v,$w)=@_;\n\tmy$r=1;\n\t$v%=MOD;\n\twhile($w>0){\n\t\t$r=$r*$v%MOD if$w&1;\n\t\t$v=$v*$v%MOD;\n\t\t$w>>=1;\n\t}\n\treturn$r;\n}\n\nmy(@es,@ies,@sum_e,@sum_ie);\n{\n\tmy$cnt2=bsf(MOD-1);\n\tmy$e=powermod(primitive_root,MOD-1>>$cnt2);\n\tmy$ie=powermod($e,MOD-2);\n\tfor(my$i=$cnt2;$i>=2;$i--){\n\t\t$es[$i-2]=$e;\n\t\t$ies[$i-2]=$ie;\n\t\t$e=$e*$e%MOD;\n\t\t$ie=$ie*$ie%MOD;\n\t}\n\tmy$now=1;\n\tmy$inow=1;\n\tfor(0..$cnt2-3){\n\t\t$sum_e[$_]=$es[$_]*$now%MOD;\n\t\t$now=$now*$ies[$_]%MOD;\n\t\t$sum_ie[$_]=$ies[$_]*$inow%MOD;\n\t\t$inow=$inow*$es[$_]%MOD;\n\t}\n}\n\nsub convolution(\\@\\@){\n\tmy@a=@{$_[0]};\n\tmy@b=@{$_[1]};\n\tmy$n=@a;\n\tmy$m=@b;\n\treturn()if$n==0||$m==0;\n\tmy$h=0;\n\t$h++while$n+$m-1>1<<$h;\n\tmy$z=1<<$h;\n\n\tmy@bsf;\n\tfor(0..$z/2-1){\n\t\t$bsf[$_]=bsf(~$_);\n\t}\n\n\t$#a=$z-1;\n\t$#b=$z-1;\n\n\t#butterfly @a,@b\n\tfor my$ph(1..$h){\n\t\tmy$w=1<<$ph-1;\n\t\tmy$p=1<<$h-$ph;\n\t\tmy$now=1;\n\t\tfor my$s(0..$w-1){\n\t\t\tmy$offset=$s<<$h-$ph+1;\n\t\t\tfor($offset..$offset+$p-1){\n\t\t\t\tmy$l=$a[$_];\n\t\t\t\tmy$r=$a[$_+$p]*$now%MOD;\n\t\t\t\t$a[$_]=($l+$r)%MOD;\n\t\t\t\t$a[$_+$p]=($l-$r+MOD)%MOD;\n\t\t\t\t$l=$b[$_];\n\t\t\t\t$r=$b[$_+$p]*$now%MOD;\n\t\t\t\t$b[$_]=($l+$r)%MOD;\n\t\t\t\t$b[$_+$p]=($l-$r+MOD)%MOD;\n\t\t\t}\n\t\t\t$now=$now*$sum_e[$bsf[$s]]%MOD;\n\t\t}\n\t}\n\n\t$a[$_]=$a[$_]*$b[$_]%MOD for 0..$z-1;\n\n\t#butterfly_inv @a\n\tfor(my$ph=$h;$ph>=1;$ph--){\n\t\tmy$w=1<<$ph-1;\n\t\tmy$p=1<<$h-$ph;\n\t\tmy$inow=1;\n\t\tfor my$s(0..$w-1){\n\t\t\tmy$offset=$s<<$h-$ph+1;\n\t\t\tfor($offset..$offset+$p-1){\n\t\t\t\tmy$l=$a[$_];\n\t\t\t\tmy$r=$a[$_+$p];\n\t\t\t\t$a[$_]=($l+$r)%MOD;\n\t\t\t\t$a[$_+$p]=($l-$r+MOD)*$inow%MOD;\n\t\t\t}\n\t\t\t$inow=$inow*$sum_ie[$bsf[$s]]%MOD;\n\t\t}\n\t}\n\n\t$#a=$n+$m-2;\n\tmy$iz=powermod($z,MOD-2);\n\t$_=$_*$iz%MOD for@a;\n\treturn@a;\n}\nno integer;\npackage main;\nmy($N,$M)=split$\",<>;\nmy@a=split$\",<>;\nmy@b=split$\",<>;\nprint$_,$/for Convolution::convolution(@a,@b);\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integer arrays a_0, a_1, ..., a_{N - 1} and b_0, b_1, ..., b_{M - 1}. Calculate the array c_0, c_1, ..., c_{(N - 1) + (M - 1)}, defined by c_i = \\sum_{j = 0}^i a_j b_{i - j} \\bmod 998244353.\n\nConstraints\n\n1 \\leq N, M \\leq 524288\n\n0 \\leq a_i, b_i < 998244353\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 a_1 ... a_{N-1}\nb_0 b_1 ... b_{M-1}\n\nOutput\n\nPrint the answer in the following format:\n\nc_0 c_1 ... c_{(N - 1) + (M - 1)}\n\nSample Input 1\n\n4 5\n1 2 3 4\n5 6 7 8 9\n\nSample Output 1\n\n5 16 34 60 70 70 59 36\n\nSample Input 2\n\n1 1\n10000000\n10000000\n\nSample Output 2\n\n871938225", "sample_input": "4 5\n1 2 3 4\n5 6 7 8 9\n"}, "reference_outputs": ["5 16 34 60 70 70 59 36\n"], "source_document_id": "p02563", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integer arrays a_0, a_1, ..., a_{N - 1} and b_0, b_1, ..., b_{M - 1}. Calculate the array c_0, c_1, ..., c_{(N - 1) + (M - 1)}, defined by c_i = \\sum_{j = 0}^i a_j b_{i - j} \\bmod 998244353.\n\nConstraints\n\n1 \\leq N, M \\leq 524288\n\n0 \\leq a_i, b_i < 998244353\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 a_1 ... a_{N-1}\nb_0 b_1 ... b_{M-1}\n\nOutput\n\nPrint the answer in the following format:\n\nc_0 c_1 ... c_{(N - 1) + (M - 1)}\n\nSample Input 1\n\n4 5\n1 2 3 4\n5 6 7 8 9\n\nSample Output 1\n\n5 16 34 60 70 70 59 36\n\nSample Input 2\n\n1 1\n10000000\n10000000\n\nSample Output 2\n\n871938225", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1896, "cpu_time_ms": 5519, "memory_kb": 232212}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s399957922", "group_id": "codeNet:p02564", "input_text": "package scc;\nsub new{\n\treturn bless[],$_[0];\n}\nsub add_edge{\n\tmy$self=shift;\n\tpush@{$self->[$_[0]]},$_[1];\n}\nsub scc{\n\tmy$self=shift;\n\tmy$now_ord=0,$group_num=0,@low,@ord=(-1)x@{$self},@ids;\n\tmy@visited;\n\tmy$dfs;\n\t$dfs=sub{\n\t\tmy$v=shift;\n\t\t$low[$v]=$ord[$v]=$now_ord++;\n\t\tpush@visited,$v;\n\t\tfor$to(@{$self->[$v]}){\n\t\t\tif($ord[$to]==-1){\n\t\t\t\t$dfs->($to);\n\t\t\t\t$low[$v]=$low[$to]if$low[$v]>$low[$to];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$low[$v]=$ord[$to]if$low[$v]>$ord[$to];\n\t\t\t}\n\t\t}\n\t\tif($low[$v]==$ord[$v]){\n\t\t\tmy$u=-1;\n\t\t\twhile($u!=$v){\n\t\t\t\t$u=pop@visited;\n\t\t\t\t$ord[$u]=@{$self};\n\t\t\t\t$ids[$u]=$group_num;\n\t\t\t}\n\t\t\t$group_num++;\n\t\t}\n\t};\n\tfor$i(0..$#ord){\n\t\t$dfs->($i)if$ord[$i]==-1;\n\t}\n\t$_=$group_num-1-$_ for@ids;\n\tmy@groups;\n\tfor$i(0..$#ids){\n\t\tpush@{$groups[$ids[$i]]},$i;\n\t}\n\treturn\\@groups;\n}\npackage main;\nmy($N,$M)=split$\",<>;\nmy$scc=scc->new($N);\nfor(1..$M){\n\tmy($a,$b)=split$\",<>;\n\t$scc->add_edge($a,$b);\n}\n$groups=$scc->scc();\nprint scalar(@{$groups}),$/;\nfor$L(@{$groups}){\n\tprint scalar(@{$L}),$\",\"@{$L}\",$/;\n}\n", "language": "Perl", "metadata": {"date": 1599698578, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02564.html", "problem_id": "p02564", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02564/input.txt", "sample_output_relpath": "derived/input_output/data/p02564/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02564/Perl/s399957922.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s399957922", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n1 5\n2 4 1\n1 2\n2 3 0\n", "input_to_evaluate": "package scc;\nsub new{\n\treturn bless[],$_[0];\n}\nsub add_edge{\n\tmy$self=shift;\n\tpush@{$self->[$_[0]]},$_[1];\n}\nsub scc{\n\tmy$self=shift;\n\tmy$now_ord=0,$group_num=0,@low,@ord=(-1)x@{$self},@ids;\n\tmy@visited;\n\tmy$dfs;\n\t$dfs=sub{\n\t\tmy$v=shift;\n\t\t$low[$v]=$ord[$v]=$now_ord++;\n\t\tpush@visited,$v;\n\t\tfor$to(@{$self->[$v]}){\n\t\t\tif($ord[$to]==-1){\n\t\t\t\t$dfs->($to);\n\t\t\t\t$low[$v]=$low[$to]if$low[$v]>$low[$to];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$low[$v]=$ord[$to]if$low[$v]>$ord[$to];\n\t\t\t}\n\t\t}\n\t\tif($low[$v]==$ord[$v]){\n\t\t\tmy$u=-1;\n\t\t\twhile($u!=$v){\n\t\t\t\t$u=pop@visited;\n\t\t\t\t$ord[$u]=@{$self};\n\t\t\t\t$ids[$u]=$group_num;\n\t\t\t}\n\t\t\t$group_num++;\n\t\t}\n\t};\n\tfor$i(0..$#ord){\n\t\t$dfs->($i)if$ord[$i]==-1;\n\t}\n\t$_=$group_num-1-$_ for@ids;\n\tmy@groups;\n\tfor$i(0..$#ids){\n\t\tpush@{$groups[$ids[$i]]},$i;\n\t}\n\treturn\\@groups;\n}\npackage main;\nmy($N,$M)=split$\",<>;\nmy$scc=scc->new($N);\nfor(1..$M){\n\tmy($a,$b)=split$\",<>;\n\t$scc->add_edge($a,$b);\n}\n$groups=$scc->scc();\nprint scalar(@{$groups}),$/;\nfor$L(@{$groups}){\n\tprint scalar(@{$L}),$\",\"@{$L}\",$/;\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a directed graph with N vertices and M edges, not necessarily simple. The i-th edge is oriented from the vertex a_i to the vertex b_i.\nDivide this graph into strongly connected components and print them in their topological order.\n\nConstraints\n\n1 \\leq N \\leq 500,000\n\n1 \\leq M \\leq 500,000\n\n0 \\leq a_i, b_i < N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 b_0\na_1 b_1\n:\na_{M - 1} b_{M - 1}\n\nOutput\n\nPrint 1+K lines, where K is the number of strongly connected components.\nPrint K on the first line.\nPrint the information of each strongly connected component in next K lines in the following format, where l is the number of vertices in the strongly connected component and v_i is the index of the vertex in it.\n\nl v_0 v_1 ... v_{l-1}\n\nHere, for each edge (a_i, b_i), b_i should not appear in earlier line than a_i.\n\nIf there are multiple correct output, print any of them.\n\nSample Input 1\n\n6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n\nSample Output 1\n\n4\n1 5\n2 4 1\n1 2\n2 3 0", "sample_input": "6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n"}, "reference_outputs": ["4\n1 5\n2 4 1\n1 2\n2 3 0\n"], "source_document_id": "p02564", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a directed graph with N vertices and M edges, not necessarily simple. The i-th edge is oriented from the vertex a_i to the vertex b_i.\nDivide this graph into strongly connected components and print them in their topological order.\n\nConstraints\n\n1 \\leq N \\leq 500,000\n\n1 \\leq M \\leq 500,000\n\n0 \\leq a_i, b_i < N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 b_0\na_1 b_1\n:\na_{M - 1} b_{M - 1}\n\nOutput\n\nPrint 1+K lines, where K is the number of strongly connected components.\nPrint K on the first line.\nPrint the information of each strongly connected component in next K lines in the following format, where l is the number of vertices in the strongly connected component and v_i is the index of the vertex in it.\n\nl v_0 v_1 ... v_{l-1}\n\nHere, for each edge (a_i, b_i), b_i should not appear in earlier line than a_i.\n\nIf there are multiple correct output, print any of them.\n\nSample Input 1\n\n6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n\nSample Output 1\n\n4\n1 5\n2 4 1\n1 2\n2 3 0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1005, "cpu_time_ms": 2847, "memory_kb": 283236}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s262359475", "group_id": "codeNet:p02564", "input_text": "package scc;\nsub new{\n\treturn bless[map[],1..$_[1]],$_[0];\n}\nsub add_edge{\n\tmy$self=shift;\n\tpush@{$self->[$_[0]]},$_[1];\n}\nsub scc{\n\t$self=shift;\n\t$now_ord=0;\n\t$group_num=0;\n\t@low=(0)x@{$self};\n\t@ord=(-1)x@{$self};\n\t@ids=(0)x@{$self};\n\t@visited;\n\tsub dfs{\n\t\tmy$v=shift;\n\t\t$low[$v]=$ord[$v]=$now_ord++;\n\t\tpush@visited,$v;\n\t\tfor$to(@{$self->[$v]}){\n\t\t\tif($ord[$to]==-1){\n\t\t\t\tdfs($to);\n\t\t\t\t$low[$v]=$low[$to]if$low[$v]>$low[$to];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$low[$v]=$ord[$to]if$low[$v]>$ord[$to];\n\t\t\t}\n\t\t}\n\t\tif($low[$v]==$ord[$v]){\n\t\t\tmy$u=undef;\n\t\t\twhile($u!=$v){\n\t\t\t\t$u=pop@visited;\n\t\t\t\t$ord[$u]=@{$self};\n\t\t\t\t$ids[$u]=$group_num;\n\t\t\t}\n\t\t\t$group_num++;\n\t\t}\n\t};\n\tfor$i(0..$#ord){\n\t\tdfs($i)if$ord[$i]==-1;\n\t}\n\t$_=$group_num-1-$_ for@ids;\n\t@groups=map[],1..$group_num;\n\tfor$i(0..$#ids){\n\t\tpush@{$groups[$ids[$i]]},$i;\n\t}\n\treturn\\@groups;\n}\npackage main;\nmy($N,$M)=split$\",<>;\nmy$scc=scc->new($N);\nfor(1..$M){\n\tmy($a,$b)=split$\",<>;\n\t$scc->add_edge($a,$b);\n}\n$groups=$scc->scc();\nprint scalar(@{$groups}),$/;\nfor$L(@{$groups}){\n\tprint scalar(@{$L}),$\",\"@{$L}\",$/;\n}\n", "language": "Perl", "metadata": {"date": 1599698118, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02564.html", "problem_id": "p02564", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02564/input.txt", "sample_output_relpath": "derived/input_output/data/p02564/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02564/Perl/s262359475.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s262359475", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n1 5\n2 4 1\n1 2\n2 3 0\n", "input_to_evaluate": "package scc;\nsub new{\n\treturn bless[map[],1..$_[1]],$_[0];\n}\nsub add_edge{\n\tmy$self=shift;\n\tpush@{$self->[$_[0]]},$_[1];\n}\nsub scc{\n\t$self=shift;\n\t$now_ord=0;\n\t$group_num=0;\n\t@low=(0)x@{$self};\n\t@ord=(-1)x@{$self};\n\t@ids=(0)x@{$self};\n\t@visited;\n\tsub dfs{\n\t\tmy$v=shift;\n\t\t$low[$v]=$ord[$v]=$now_ord++;\n\t\tpush@visited,$v;\n\t\tfor$to(@{$self->[$v]}){\n\t\t\tif($ord[$to]==-1){\n\t\t\t\tdfs($to);\n\t\t\t\t$low[$v]=$low[$to]if$low[$v]>$low[$to];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$low[$v]=$ord[$to]if$low[$v]>$ord[$to];\n\t\t\t}\n\t\t}\n\t\tif($low[$v]==$ord[$v]){\n\t\t\tmy$u=undef;\n\t\t\twhile($u!=$v){\n\t\t\t\t$u=pop@visited;\n\t\t\t\t$ord[$u]=@{$self};\n\t\t\t\t$ids[$u]=$group_num;\n\t\t\t}\n\t\t\t$group_num++;\n\t\t}\n\t};\n\tfor$i(0..$#ord){\n\t\tdfs($i)if$ord[$i]==-1;\n\t}\n\t$_=$group_num-1-$_ for@ids;\n\t@groups=map[],1..$group_num;\n\tfor$i(0..$#ids){\n\t\tpush@{$groups[$ids[$i]]},$i;\n\t}\n\treturn\\@groups;\n}\npackage main;\nmy($N,$M)=split$\",<>;\nmy$scc=scc->new($N);\nfor(1..$M){\n\tmy($a,$b)=split$\",<>;\n\t$scc->add_edge($a,$b);\n}\n$groups=$scc->scc();\nprint scalar(@{$groups}),$/;\nfor$L(@{$groups}){\n\tprint scalar(@{$L}),$\",\"@{$L}\",$/;\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a directed graph with N vertices and M edges, not necessarily simple. The i-th edge is oriented from the vertex a_i to the vertex b_i.\nDivide this graph into strongly connected components and print them in their topological order.\n\nConstraints\n\n1 \\leq N \\leq 500,000\n\n1 \\leq M \\leq 500,000\n\n0 \\leq a_i, b_i < N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 b_0\na_1 b_1\n:\na_{M - 1} b_{M - 1}\n\nOutput\n\nPrint 1+K lines, where K is the number of strongly connected components.\nPrint K on the first line.\nPrint the information of each strongly connected component in next K lines in the following format, where l is the number of vertices in the strongly connected component and v_i is the index of the vertex in it.\n\nl v_0 v_1 ... v_{l-1}\n\nHere, for each edge (a_i, b_i), b_i should not appear in earlier line than a_i.\n\nIf there are multiple correct output, print any of them.\n\nSample Input 1\n\n6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n\nSample Output 1\n\n4\n1 5\n2 4 1\n1 2\n2 3 0", "sample_input": "6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n"}, "reference_outputs": ["4\n1 5\n2 4 1\n1 2\n2 3 0\n"], "source_document_id": "p02564", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a directed graph with N vertices and M edges, not necessarily simple. The i-th edge is oriented from the vertex a_i to the vertex b_i.\nDivide this graph into strongly connected components and print them in their topological order.\n\nConstraints\n\n1 \\leq N \\leq 500,000\n\n1 \\leq M \\leq 500,000\n\n0 \\leq a_i, b_i < N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 b_0\na_1 b_1\n:\na_{M - 1} b_{M - 1}\n\nOutput\n\nPrint 1+K lines, where K is the number of strongly connected components.\nPrint K on the first line.\nPrint the information of each strongly connected component in next K lines in the following format, where l is the number of vertices in the strongly connected component and v_i is the index of the vertex in it.\n\nl v_0 v_1 ... v_{l-1}\n\nHere, for each edge (a_i, b_i), b_i should not appear in earlier line than a_i.\n\nIf there are multiple correct output, print any of them.\n\nSample Input 1\n\n6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n\nSample Output 1\n\n4\n1 5\n2 4 1\n1 2\n2 3 0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1052, "cpu_time_ms": 2932, "memory_kb": 288316}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s877316059", "group_id": "codeNet:p02565", "input_text": "use strict;\nuse warnings;\npackage Scc;\nsub new{\n\treturn bless[map[],1..$_[1]],$_[0];\n}\nsub add_edge{\n\tmy$self=shift;\n\tpush@{$self->[$_[0]]},$_[1];\n}\nsub scc_ids{\n\tmy$self=shift;\n\tmy$now_ord=0;\n\tmy$group_num=0;\n\tmy@low;\n\tmy@ord=(-1)x@{$self};\n\tmy@ids;\n\tmy@visited;\n\tmy$dfs;\n\t$dfs=sub{\n\t\tmy$v=shift;\n\t\t$low[$v]=$ord[$v]=$now_ord++;\n\t\tpush@visited,$v;\n\t\tfor my$to(@{$self->[$v]}){\n\t\t\tif($ord[$to]==-1){\n\t\t\t\t$dfs->($to);\n\t\t\t\t$low[$v]=$low[$to]if$low[$v]>$low[$to];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$low[$v]=$ord[$to]if$low[$v]>$ord[$to];\n\t\t\t}\n\t\t}\n\t\tif($low[$v]==$ord[$v]){\n\t\t\tmy$u=-1;\n\t\t\twhile($u!=$v){\n\t\t\t\t$u=pop@visited;\n\t\t\t\t$ord[$u]=@{$self};\n\t\t\t\t$ids[$u]=$group_num;\n\t\t\t}\n\t\t\t$group_num++;\n\t\t}\n\t};\n\tfor(0..$#ord){\n\t\t$dfs->($_)if$ord[$_]==-1;\n\t}\n\t$_=$group_num-1-$_ for@ids;\n\treturn($group_num,\\@ids);\n}\nsub scc{\n\tmy$self=shift;\n\tmy($group_num,$ids)=$self->scc_ids();\n\tmy@groups=map[],1..$group_num;\n\tfor(0..$#{$ids}){\n\t\tpush@{$groups[$ids->[$_]]},$_;\n\t}\n\treturn\\@groups;\n}\npackage TwoSat;\n@TwoSat::ISA=qw(Scc);\nsub new{\n\treturn$_[0]->SUPER::new($_[1]*2);\n}\nsub add_clause{\n\tmy$self=shift;\n\t$self->add_edge(2*$_[0]+!$_[1],2*$_[2]+!!$_[3]);\n\t$self->add_edge(2*$_[2]+!$_[3],2*$_[0]+!!$_[1]);\n}\nsub satisfiable{\n\tmy$self=shift;\n\tmy$ids=($self->scc_ids())[1];\n\tmy@answer;\n\tfor(0..@{$ids}/2-1){\n\t\treturn 0 if$ids->[2*$_]==$ids->[2*$_+1];\n\t\t$answer[$_]=$ids->[2*$_]<$ids->[2*$_+1];\n\t}\n\treturn(1,\\@answer);\n}\npackage main;\nmy($N,$D)=split$\",<>;\nmy$twosat=TwoSat->new($N);\nmy@p;\nfor(1..$N){\n\tmy($x,$y)=split$\",<>;\n\tpush@p,[$x,$y];\n}\nfor my$i(0..$N-1){\n\tfor my$j($i+1..$N-1){\n\t\t$twosat->add_clause($i,1,$j,1)if abs$p[$i][0]-$p[$j][0]<$D;\n\t\t$twosat->add_clause($i,1,$j,0)if abs$p[$i][0]-$p[$j][1]<$D;\n\t\t$twosat->add_clause($i,0,$j,1)if abs$p[$i][1]-$p[$j][0]<$D;\n\t\t$twosat->add_clause($i,0,$j,0)if abs$p[$i][1]-$p[$j][1]<$D;\n\t}\n}\nmy($isok,$answer)=$twosat->satisfiable();\nif($isok){\n\tprint\"Yes\",$/;\n\tfor(0..$N-1){\n\t\tprint$p[$_][$answer->[$_]],$/;\n\t}\n}\nelse{\n\tprint\"No\",$/;\n}\n", "language": "Perl", "metadata": {"date": 1599710386, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02565.html", "problem_id": "p02565", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02565/input.txt", "sample_output_relpath": "derived/input_output/data/p02565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02565/Perl/s877316059.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s877316059", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n4\n2\n0\n", "input_to_evaluate": "use strict;\nuse warnings;\npackage Scc;\nsub new{\n\treturn bless[map[],1..$_[1]],$_[0];\n}\nsub add_edge{\n\tmy$self=shift;\n\tpush@{$self->[$_[0]]},$_[1];\n}\nsub scc_ids{\n\tmy$self=shift;\n\tmy$now_ord=0;\n\tmy$group_num=0;\n\tmy@low;\n\tmy@ord=(-1)x@{$self};\n\tmy@ids;\n\tmy@visited;\n\tmy$dfs;\n\t$dfs=sub{\n\t\tmy$v=shift;\n\t\t$low[$v]=$ord[$v]=$now_ord++;\n\t\tpush@visited,$v;\n\t\tfor my$to(@{$self->[$v]}){\n\t\t\tif($ord[$to]==-1){\n\t\t\t\t$dfs->($to);\n\t\t\t\t$low[$v]=$low[$to]if$low[$v]>$low[$to];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$low[$v]=$ord[$to]if$low[$v]>$ord[$to];\n\t\t\t}\n\t\t}\n\t\tif($low[$v]==$ord[$v]){\n\t\t\tmy$u=-1;\n\t\t\twhile($u!=$v){\n\t\t\t\t$u=pop@visited;\n\t\t\t\t$ord[$u]=@{$self};\n\t\t\t\t$ids[$u]=$group_num;\n\t\t\t}\n\t\t\t$group_num++;\n\t\t}\n\t};\n\tfor(0..$#ord){\n\t\t$dfs->($_)if$ord[$_]==-1;\n\t}\n\t$_=$group_num-1-$_ for@ids;\n\treturn($group_num,\\@ids);\n}\nsub scc{\n\tmy$self=shift;\n\tmy($group_num,$ids)=$self->scc_ids();\n\tmy@groups=map[],1..$group_num;\n\tfor(0..$#{$ids}){\n\t\tpush@{$groups[$ids->[$_]]},$_;\n\t}\n\treturn\\@groups;\n}\npackage TwoSat;\n@TwoSat::ISA=qw(Scc);\nsub new{\n\treturn$_[0]->SUPER::new($_[1]*2);\n}\nsub add_clause{\n\tmy$self=shift;\n\t$self->add_edge(2*$_[0]+!$_[1],2*$_[2]+!!$_[3]);\n\t$self->add_edge(2*$_[2]+!$_[3],2*$_[0]+!!$_[1]);\n}\nsub satisfiable{\n\tmy$self=shift;\n\tmy$ids=($self->scc_ids())[1];\n\tmy@answer;\n\tfor(0..@{$ids}/2-1){\n\t\treturn 0 if$ids->[2*$_]==$ids->[2*$_+1];\n\t\t$answer[$_]=$ids->[2*$_]<$ids->[2*$_+1];\n\t}\n\treturn(1,\\@answer);\n}\npackage main;\nmy($N,$D)=split$\",<>;\nmy$twosat=TwoSat->new($N);\nmy@p;\nfor(1..$N){\n\tmy($x,$y)=split$\",<>;\n\tpush@p,[$x,$y];\n}\nfor my$i(0..$N-1){\n\tfor my$j($i+1..$N-1){\n\t\t$twosat->add_clause($i,1,$j,1)if abs$p[$i][0]-$p[$j][0]<$D;\n\t\t$twosat->add_clause($i,1,$j,0)if abs$p[$i][0]-$p[$j][1]<$D;\n\t\t$twosat->add_clause($i,0,$j,1)if abs$p[$i][1]-$p[$j][0]<$D;\n\t\t$twosat->add_clause($i,0,$j,0)if abs$p[$i][1]-$p[$j][1]<$D;\n\t}\n}\nmy($isok,$answer)=$twosat->satisfiable();\nif($isok){\n\tprint\"Yes\",$/;\n\tfor(0..$N-1){\n\t\tprint$p[$_][$answer->[$_]],$/;\n\t}\n}\nelse{\n\tprint\"No\",$/;\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nConsider placing N flags on a line. Flags are numbered through 1 to N.\n\nFlag i can be placed on the coordinate X_i or Y_i.\nFor any two different flags, the distance between them should be at least D.\n\nDecide whether it is possible to place all N flags. If it is possible, print such a configulation.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq D \\leq 10^9\n\n0 \\leq X_i < Y_i \\leq 10^9\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\nX_2 Y_2\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint No if it is impossible to place N flags.\n\nIf it is possible, print Yes first.\nAfter that, print N lines. i-th line of them should contain the coodinate of flag i.\n\nSample Input 1\n\n3 2\n1 4\n2 5\n0 6\n\nSample Output 1\n\nYes\n4\n2\n0\n\nSample Input 2\n\n3 3\n1 4\n2 5\n0 6\n\nSample Output 2\n\nNo", "sample_input": "3 2\n1 4\n2 5\n0 6\n"}, "reference_outputs": ["Yes\n4\n2\n0\n"], "source_document_id": "p02565", "source_text": "Score : 100 points\n\nProblem Statement\n\nConsider placing N flags on a line. Flags are numbered through 1 to N.\n\nFlag i can be placed on the coordinate X_i or Y_i.\nFor any two different flags, the distance between them should be at least D.\n\nDecide whether it is possible to place all N flags. If it is possible, print such a configulation.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq D \\leq 10^9\n\n0 \\leq X_i < Y_i \\leq 10^9\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\nX_2 Y_2\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint No if it is impossible to place N flags.\n\nIf it is possible, print Yes first.\nAfter that, print N lines. i-th line of them should contain the coodinate of flag i.\n\nSample Input 1\n\n3 2\n1 4\n2 5\n0 6\n\nSample Output 1\n\nYes\n4\n2\n0\n\nSample Input 2\n\n3 3\n1 4\n2 5\n0 6\n\nSample Output 2\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1948, "cpu_time_ms": 185, "memory_kb": 6172}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s272914133", "group_id": "codeNet:p02566", "input_text": "use strict;\nuse warnings;\npackage SuffixArray;\nsub sa_is(\\@$);\nsub sa_is(\\@$){\n\tmy@s=@{$_[0]};\n\tmy$upper=$_[1];\n\tmy$n=@s;\n\tif($n==0){\n\t\treturn();\n\t}\n\telsif($n==1){\n\t\treturn(0);\n\t}\n\tmy@sa;\n\tmy@ls;\n\tfor(my$i=$n-2;$i>=0;$i--){\n\t\t$ls[$i]=$s[$i]==$s[$i+1]?$ls[$i+1]:$s[$i]<$s[$i+1];\n\t}\n\tmy@sum_l=(0)x($upper+1);\n\tmy@sum_s=(0)x($upper+1);\n\t$ls[$_]?$sum_l[$s[$_]+1]++:$sum_s[$s[$_]]++for 0..$n-1;\n\tfor(0..$upper){\n\t\t$sum_s[$_]+=$sum_l[$_];\n\t\t$sum_l[$_+1]+=$sum_s[$_]if$_<$upper;\n\t}\n\tmy$induce;\n\t$induce=sub{\n\t\tmy@sa=(-1)x$n;\n\t\tmy@buf=@sum_s;\n\t\tfor(@_){\n\t\t\tnext if$_==$n;\n\t\t\t$sa[$buf[$s[$_]]++]=$_;\n\t\t}\n\t\t@buf=@sum_l;\n\t\t$sa[$buf[$s[$n-1]]++]=$n-1;\n\t\tfor(@sa){\n\t\t\t$sa[$buf[$s[$_-1]]++]=$_-1if$_>=1&&!$ls[$_-1];\n\t\t}\n\t\t@buf=@sum_l;\n\t\tfor(my$i=$n-1;$i>=0;$i--){\n\t\t\tmy$v=$sa[$i];\n\t\t\t$sa[--$buf[$s[$v-1]+1]]=$v-1if$v>=1&&$ls[$v-1];\n\t\t}\n\t\treturn@sa;\n\t};\n\tmy@lms=grep!$ls[$_-1]&&$ls[$_],1..$n-1;\n\tmy@lms_map=(-1)x($n+1);\n\tmy$m=@lms;\n\tfor(0..$m-1){\n\t\t$lms_map[$lms[$_]]=$_;\n\t}\n\t@sa=$induce->(@lms);\n\tif($m){\n\t\tmy@sorted_lms=grep$lms_map[$_]!=-1,@sa;\n\t\tmy@rec_s;\n\t\tmy$rec_upper=0;\n\t\t$rec_s[$lms_map[$sorted_lms[0]]]=0;\n\t\tfor(1..$m-1){\n\t\t\tmy$l=$sorted_lms[$_-1];\n\t\t\tmy$r=$sorted_lms[$_];\n\t\t\tmy$end_l=$lms[$lms_map[$l]+1]//$n;\n\t\t\tmy$end_r=$lms[$lms_map[$r]+1]//$n;\n\t\t\tmy$different;\n\t\t\tif($end_l-$l!=$end_r-$r){\n\t\t\t\t$different=1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$l++,$r++while$l<$end_l&&$s[$l]==$s[$r];\n\t\t\t\t$different=$l==$n||$s[$l]!=$s[$r];\n\t\t\t}\n\t\t\t$rec_s[$lms_map[$sorted_lms[$_]]]=$rec_upper+=$different;\n\t\t}\n\t\tmy@rec_sa=sa_is(@rec_s,$rec_upper);\n\t\t$sorted_lms[$_]=$lms[$rec_sa[$_]]for 0..$m-1;\n\t\t@sa=$induce->(@sorted_lms);\n\t}\n\treturn@sa;\n}\nsub suffix_array(\\$){\n\tmy@s=map ord,split\"\",${$_[0]};\n\treturn sa_is(@s,255);\n}\npackage LcpArray;\nsub lcp(\\@\\@){\n\tmy@s=@{$_[0]};\n\tmy$n=@s;\n\tmy@sa=@{$_[1]};\n\tmy@rnk;\n\t$rnk[$sa[$_]]=$_ for 0..$n-1;\n\tmy@lcp;\n\tmy$h=0;\n\tfor(0..$n-1){\n\t\t$h--if$h>0;\n\t\tnext if$rnk[$_]==0;\n\t\tmy$j=$sa[$rnk[$_]-1];\n\t\t$h++while$j+$h<$n&&$_+$h<$n&&$s[$j+$h]==$s[$_+$h];\n\t\t$lcp[$rnk[$_]-1]=$h;\n\t}\n\treturn@lcp;\n}\nsub lcp_array(\\$\\@){\n\tmy@s=map ord,split\"\",${$_[0]};\n\treturn lcp(@s,@{$_[1]});\n}\npackage main;\nmy$s=<>;\nchomp$s;\nmy@sa=SuffixArray::suffix_array($s);\nmy@lcp=LcpArray::lcp_array($s,@sa);\nmy$ans=@sa*(@sa+1)/2;\n$ans-=$_ for@lcp;\nprint$ans,$/;\n", "language": "Perl", "metadata": {"date": 1599785428, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02566.html", "problem_id": "p02566", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02566/input.txt", "sample_output_relpath": "derived/input_output/data/p02566/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02566/Perl/s272914133.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272914133", "user_id": "u657913472"}, "prompt_components": {"gold_output": "21\n", "input_to_evaluate": "use strict;\nuse warnings;\npackage SuffixArray;\nsub sa_is(\\@$);\nsub sa_is(\\@$){\n\tmy@s=@{$_[0]};\n\tmy$upper=$_[1];\n\tmy$n=@s;\n\tif($n==0){\n\t\treturn();\n\t}\n\telsif($n==1){\n\t\treturn(0);\n\t}\n\tmy@sa;\n\tmy@ls;\n\tfor(my$i=$n-2;$i>=0;$i--){\n\t\t$ls[$i]=$s[$i]==$s[$i+1]?$ls[$i+1]:$s[$i]<$s[$i+1];\n\t}\n\tmy@sum_l=(0)x($upper+1);\n\tmy@sum_s=(0)x($upper+1);\n\t$ls[$_]?$sum_l[$s[$_]+1]++:$sum_s[$s[$_]]++for 0..$n-1;\n\tfor(0..$upper){\n\t\t$sum_s[$_]+=$sum_l[$_];\n\t\t$sum_l[$_+1]+=$sum_s[$_]if$_<$upper;\n\t}\n\tmy$induce;\n\t$induce=sub{\n\t\tmy@sa=(-1)x$n;\n\t\tmy@buf=@sum_s;\n\t\tfor(@_){\n\t\t\tnext if$_==$n;\n\t\t\t$sa[$buf[$s[$_]]++]=$_;\n\t\t}\n\t\t@buf=@sum_l;\n\t\t$sa[$buf[$s[$n-1]]++]=$n-1;\n\t\tfor(@sa){\n\t\t\t$sa[$buf[$s[$_-1]]++]=$_-1if$_>=1&&!$ls[$_-1];\n\t\t}\n\t\t@buf=@sum_l;\n\t\tfor(my$i=$n-1;$i>=0;$i--){\n\t\t\tmy$v=$sa[$i];\n\t\t\t$sa[--$buf[$s[$v-1]+1]]=$v-1if$v>=1&&$ls[$v-1];\n\t\t}\n\t\treturn@sa;\n\t};\n\tmy@lms=grep!$ls[$_-1]&&$ls[$_],1..$n-1;\n\tmy@lms_map=(-1)x($n+1);\n\tmy$m=@lms;\n\tfor(0..$m-1){\n\t\t$lms_map[$lms[$_]]=$_;\n\t}\n\t@sa=$induce->(@lms);\n\tif($m){\n\t\tmy@sorted_lms=grep$lms_map[$_]!=-1,@sa;\n\t\tmy@rec_s;\n\t\tmy$rec_upper=0;\n\t\t$rec_s[$lms_map[$sorted_lms[0]]]=0;\n\t\tfor(1..$m-1){\n\t\t\tmy$l=$sorted_lms[$_-1];\n\t\t\tmy$r=$sorted_lms[$_];\n\t\t\tmy$end_l=$lms[$lms_map[$l]+1]//$n;\n\t\t\tmy$end_r=$lms[$lms_map[$r]+1]//$n;\n\t\t\tmy$different;\n\t\t\tif($end_l-$l!=$end_r-$r){\n\t\t\t\t$different=1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$l++,$r++while$l<$end_l&&$s[$l]==$s[$r];\n\t\t\t\t$different=$l==$n||$s[$l]!=$s[$r];\n\t\t\t}\n\t\t\t$rec_s[$lms_map[$sorted_lms[$_]]]=$rec_upper+=$different;\n\t\t}\n\t\tmy@rec_sa=sa_is(@rec_s,$rec_upper);\n\t\t$sorted_lms[$_]=$lms[$rec_sa[$_]]for 0..$m-1;\n\t\t@sa=$induce->(@sorted_lms);\n\t}\n\treturn@sa;\n}\nsub suffix_array(\\$){\n\tmy@s=map ord,split\"\",${$_[0]};\n\treturn sa_is(@s,255);\n}\npackage LcpArray;\nsub lcp(\\@\\@){\n\tmy@s=@{$_[0]};\n\tmy$n=@s;\n\tmy@sa=@{$_[1]};\n\tmy@rnk;\n\t$rnk[$sa[$_]]=$_ for 0..$n-1;\n\tmy@lcp;\n\tmy$h=0;\n\tfor(0..$n-1){\n\t\t$h--if$h>0;\n\t\tnext if$rnk[$_]==0;\n\t\tmy$j=$sa[$rnk[$_]-1];\n\t\t$h++while$j+$h<$n&&$_+$h<$n&&$s[$j+$h]==$s[$_+$h];\n\t\t$lcp[$rnk[$_]-1]=$h;\n\t}\n\treturn@lcp;\n}\nsub lcp_array(\\$\\@){\n\tmy@s=map ord,split\"\",${$_[0]};\n\treturn lcp(@s,@{$_[1]});\n}\npackage main;\nmy$s=<>;\nchomp$s;\nmy@sa=SuffixArray::suffix_array($s);\nmy@lcp=LcpArray::lcp_array($s,@sa);\nmy$ans=@sa*(@sa+1)/2;\n$ans-=$_ for@lcp;\nprint$ans,$/;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string of length N. Calculate the number of distinct substrings of S.\n\nConstraints\n\n1 \\leq N \\leq 500,000\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 answer.\n\nSample Input 1\n\nabcbcba\n\nSample Output 1\n\n21\n\nSample Input 2\n\nmississippi\n\nSample Output 2\n\n53\n\nSample Input 3\n\nababacaca\n\nSample Output 3\n\n33\n\nSample Input 4\n\naaaaa\n\nSample Output 4\n\n5", "sample_input": "abcbcba\n"}, "reference_outputs": ["21\n"], "source_document_id": "p02566", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string of length N. Calculate the number of distinct substrings of S.\n\nConstraints\n\n1 \\leq N \\leq 500,000\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 answer.\n\nSample Input 1\n\nabcbcba\n\nSample Output 1\n\n21\n\nSample Input 2\n\nmississippi\n\nSample Output 2\n\n53\n\nSample Input 3\n\nababacaca\n\nSample Output 3\n\n33\n\nSample Input 4\n\naaaaa\n\nSample Output 4\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2232, "cpu_time_ms": 3264, "memory_kb": 251816}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s337530400", "group_id": "codeNet:p02570", "input_text": "my ($D,$T,$S)= split(/ /,<>);\n\n\nif($S*$T>=$D){\n print\"Yes\";\n}else{\n print\"No\";\n}", "language": "Perl", "metadata": {"date": 1598727728, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02570.html", "problem_id": "p02570", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02570/input.txt", "sample_output_relpath": "derived/input_output/data/p02570/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02570/Perl/s337530400.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s337530400", "user_id": "u464700044"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my ($D,$T,$S)= split(/ /,<>);\n\n\nif($S*$T>=$D){\n print\"Yes\";\n}else{\n print\"No\";\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "sample_input": "1000 15 80\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02570", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 4756}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s886826807", "group_id": "codeNet:p02571", "input_text": "my $in = ;\nmy $in2 = ;\nchomp($in);\nchomp($in2);\nmy @S = split(//,$in);\nmy @T = split(//,$in2);\nmy $min = @T;\nmy $len = @S - $min + 1;\nfor (my $i=0; $i<$len; $i++) {\n my $sum = 0;\n for (my $j=0; $j<@T; $j++) {\n $sum++ if ($S[$i+$j] ne $T[$j]);\n }\n if ($sum < $min) {\n $min = $sum;\n }\n}\nprint $min;\n", "language": "Perl", "metadata": {"date": 1598730111, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02571.html", "problem_id": "p02571", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02571/input.txt", "sample_output_relpath": "derived/input_output/data/p02571/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02571/Perl/s886826807.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s886826807", "user_id": "u770187842"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "my $in = ;\nmy $in2 = ;\nchomp($in);\nchomp($in2);\nmy @S = split(//,$in);\nmy @T = split(//,$in2);\nmy $min = @T;\nmy $len = @S - $min + 1;\nfor (my $i=0; $i<$len; $i++) {\n my $sum = 0;\n for (my $j=0; $j<@T; $j++) {\n $sum++ if ($S[$i+$j] ne $T[$j]);\n }\n if ($sum < $min) {\n $min = $sum;\n }\n}\nprint $min;\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "sample_input": "cabacc\nabc\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02571", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 42, "memory_kb": 4888}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s199864434", "group_id": "codeNet:p02573", "input_text": "sub f{$v[$_]++||$s++*map&f,@$_}f$s=$_[$s]=grep{push@$_,$_[--$|]for@_=glob}<>for 1..<>;print$#_", "language": "Perl", "metadata": {"date": 1598764087, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02573.html", "problem_id": "p02573", "resource_group": "low_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/Perl/s199864434.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s199864434", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "sub f{$v[$_]++||$s++*map&f,@$_}f$s=$_[$s]=grep{push@$_,$_[--$|]for@_=glob}<>for 1..<>;print$#_", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1948, "memory_kb": 336112}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s673371273", "group_id": "codeNet:p02577", "input_text": "print`echo $_%9|bc`+0?No:Yes for<>+0", "language": "Perl", "metadata": {"date": 1598133823, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02577.html", "problem_id": "p02577", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02577/input.txt", "sample_output_relpath": "derived/input_output/data/p02577/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02577/Perl/s673371273.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s673371273", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print`echo $_%9|bc`+0?No:Yes for<>+0", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\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 multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "sample_input": "123456789\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02577", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\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 multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 14, "memory_kb": 4928}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s540545394", "group_id": "codeNet:p02578", "input_text": "get;my @a=words;say sum ([\\max] @a) Z- @a", "language": "Perl", "metadata": {"date": 1598123826, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02578.html", "problem_id": "p02578", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02578/input.txt", "sample_output_relpath": "derived/input_output/data/p02578/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02578/Perl/s540545394.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s540545394", "user_id": "u032223772"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "get;my @a=words;say sum ([\\max] @a) Z- @a", "problem_context": "Score : 300 points\n\nProblem Statement\n\nN persons are standing in a row. The height of the i-th person from the front is A_i.\n\nWe want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person:\n\nCondition: Nobody in front of the person is taller than the person. Here, the height of a person includes the stool.\n\nFind the minimum total height of the stools needed to meet this goal.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq A_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\nA_1 \\ldots A_N\n\nOutput\n\nPrint the minimum total height of the stools needed to meet the goal.\n\nSample Input 1\n\n5\n2 1 5 4 3\n\nSample Output 1\n\n4\n\nIf the persons stand on stools of heights 0, 1, 0, 1, and 2, respectively, their heights will be 2, 2, 5, 5, and 5, satisfying the condition.\n\nWe cannot meet the goal with a smaller total height of the stools.\n\nSample Input 2\n\n5\n3 3 3 3 3\n\nSample Output 2\n\n0\n\nGiving a stool of height 0 to everyone will work.", "sample_input": "5\n2 1 5 4 3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02578", "source_text": "Score : 300 points\n\nProblem Statement\n\nN persons are standing in a row. The height of the i-th person from the front is A_i.\n\nWe want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person:\n\nCondition: Nobody in front of the person is taller than the person. Here, the height of a person includes the stool.\n\nFind the minimum total height of the stools needed to meet this goal.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq A_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\nA_1 \\ldots A_N\n\nOutput\n\nPrint the minimum total height of the stools needed to meet the goal.\n\nSample Input 1\n\n5\n2 1 5 4 3\n\nSample Output 1\n\n4\n\nIf the persons stand on stools of heights 0, 1, 0, 1, and 2, respectively, their heights will be 2, 2, 5, 5, and 5, satisfying the condition.\n\nWe cannot meet the goal with a smaller total height of the stools.\n\nSample Input 2\n\n5\n3 3 3 3 3\n\nSample Output 2\n\n0\n\nGiving a stool of height 0 to everyone will work.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 41, "cpu_time_ms": 2213, "memory_kb": 260008}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s296041634", "group_id": "codeNet:p02579", "input_text": "#!/usr/bin/perl\nuse Data::Dumper;\n\nmy ($h,$w) = map { $_ - 0 } split(/\\s+/,);\nmy ($ch,$cw) = map { $_ - 1 } split(/\\s+/,);\nmy ($dh,$dw) = map { $_ - 1 } split(/\\s+/,);\n\nmy @pos = (); $#pos = 4 * (10 ** 6);\nmy @spos = (); $#spos = 2 * (10 ** 6);\n\nmy @mp = (); $#mp = $h - 1;\n\nmy @ss = (); $#ss = $h - 1;\nfor(my $i=0;$i<$h;$i++){\n $ss[$i] = scalar();\n my @dum2 = (); $#dum2 = $w - 1;\n $mp[$i] = \\@dum2;\n}\n\nmy $ph = 1;\n\n$pos[0] = $ch;\n$pos[1] = $cw;\n$mp[$ch]->[$cw] = $ph;\n\nmy $n_pos = 2;\n\nwhile(1){\n my $cn1 = &f2($ph,\\$n_pos); # 現在のフェーズの縦横のみで埋める\n $ph ++;\n my $ii = 0;\n my $jj = 0;\n while( $ii < $cn1 ){\n my $yy = $spos[$ii++];\n my $xx = $spos[$ii++];\n &f1($yy,$xx,$ph,\\$jj);\n }\n if( $jj <= 0 ){\n print \"-1\\n\"; exit(0);\n }\n $n_pos = $jj\n}\nexit(0);\n\n\nsub f1 {\n my $y = shift; my $x = shift; my $v = shift; my $ii = shift;\n for(my $i=-2;$i<=2;$i++){\n my $yy = $y + $i;\n next if $yy<0 or $yy>=$h;\n for(my $j=-2;$j<=2;$j++){\n my $xx = $x + $j;\n next if $xx<0 or $xx>=$w;\n next if substr($ss[$yy],$xx,1) ne '.';\n if( $mp[$yy]->[$xx] == 0 ){\n $mp[$yy]->[$xx] = $v;\n $pos[${$ii}++] = $yy;\n $pos[${$ii}++] = $xx;\n if( $yy == $dh and $xx = $dw ){\n my $vv = $v - 1;\n print \"$vv\\n\"; exit(0);\n }\n }\n }\n }\n}\n\nsub f2 {\n my $v = shift; my $n_pos = shift;\n \n my $o1 = 0;\n my $o2 = 2 * (10**6);\n \n my $n_spos = 0;\n \n while($$n_pos > 0){\n my $ii = 0;\n my $nx_pos = 0;\n while( $ii < $$n_pos ){\n my $yy = $pos[$o1+($ii++)];\n my $xx = $pos[$o1+($ii++)];\n if( $yy == $dh and $xx == $dw ){\n my $vv = $v - 1;\n print \"$vv\\n\"; exit(0);\n }\n $spos[$n_spos++] = $yy;\n $spos[$n_spos++] = $xx;\n if( $yy > 0 and substr($ss[$yy-1],$xx,1) eq '.' and $mp[$yy-1]->[$xx] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy - 1;\n $pos[$o2 + ($nx_pos++)] = $xx;\n $mp[$yy-1]->[$xx] = $v;\n }\n if( $yy < $h - 1 and substr($ss[$yy+1],$xx,1) eq '.' and $mp[$yy+1]->[$xx] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy + 1;\n $pos[$o2 + ($nx_pos++)] = $xx;\n $mp[$yy+1]->[$xx] = $v;\n }\n if( $xx > 0 and substr($ss[$yy],$xx-1,1) eq '.' and $mp[$yy]->[$xx-1] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy;\n $pos[$o2 + ($nx_pos++)] = $xx - 1;\n $mp[$yy]->[$xx-1] = $v;\n }\n if( $xx < $w - 1 and substr($ss[$yy],$xx+1,1) eq '.' and $mp[$yy]->[$xx+1] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy;\n $pos[$o2 + ($nx_pos++)] = $xx + 1;\n $mp[$yy]->[$xx+1] = $v;\n }\n }\n $$n_pos = $nx_pos;\n my $tmp = $o2;\n $o2 = $o1;\n $o1 = $tmp;\n }\n return $n_spos;\n}\n\n", "language": "Perl", "metadata": {"date": 1598178330, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02579.html", "problem_id": "p02579", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02579/input.txt", "sample_output_relpath": "derived/input_output/data/p02579/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02579/Perl/s296041634.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s296041634", "user_id": "u750383873"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\nuse Data::Dumper;\n\nmy ($h,$w) = map { $_ - 0 } split(/\\s+/,);\nmy ($ch,$cw) = map { $_ - 1 } split(/\\s+/,);\nmy ($dh,$dw) = map { $_ - 1 } split(/\\s+/,);\n\nmy @pos = (); $#pos = 4 * (10 ** 6);\nmy @spos = (); $#spos = 2 * (10 ** 6);\n\nmy @mp = (); $#mp = $h - 1;\n\nmy @ss = (); $#ss = $h - 1;\nfor(my $i=0;$i<$h;$i++){\n $ss[$i] = scalar();\n my @dum2 = (); $#dum2 = $w - 1;\n $mp[$i] = \\@dum2;\n}\n\nmy $ph = 1;\n\n$pos[0] = $ch;\n$pos[1] = $cw;\n$mp[$ch]->[$cw] = $ph;\n\nmy $n_pos = 2;\n\nwhile(1){\n my $cn1 = &f2($ph,\\$n_pos); # 現在のフェーズの縦横のみで埋める\n $ph ++;\n my $ii = 0;\n my $jj = 0;\n while( $ii < $cn1 ){\n my $yy = $spos[$ii++];\n my $xx = $spos[$ii++];\n &f1($yy,$xx,$ph,\\$jj);\n }\n if( $jj <= 0 ){\n print \"-1\\n\"; exit(0);\n }\n $n_pos = $jj\n}\nexit(0);\n\n\nsub f1 {\n my $y = shift; my $x = shift; my $v = shift; my $ii = shift;\n for(my $i=-2;$i<=2;$i++){\n my $yy = $y + $i;\n next if $yy<0 or $yy>=$h;\n for(my $j=-2;$j<=2;$j++){\n my $xx = $x + $j;\n next if $xx<0 or $xx>=$w;\n next if substr($ss[$yy],$xx,1) ne '.';\n if( $mp[$yy]->[$xx] == 0 ){\n $mp[$yy]->[$xx] = $v;\n $pos[${$ii}++] = $yy;\n $pos[${$ii}++] = $xx;\n if( $yy == $dh and $xx = $dw ){\n my $vv = $v - 1;\n print \"$vv\\n\"; exit(0);\n }\n }\n }\n }\n}\n\nsub f2 {\n my $v = shift; my $n_pos = shift;\n \n my $o1 = 0;\n my $o2 = 2 * (10**6);\n \n my $n_spos = 0;\n \n while($$n_pos > 0){\n my $ii = 0;\n my $nx_pos = 0;\n while( $ii < $$n_pos ){\n my $yy = $pos[$o1+($ii++)];\n my $xx = $pos[$o1+($ii++)];\n if( $yy == $dh and $xx == $dw ){\n my $vv = $v - 1;\n print \"$vv\\n\"; exit(0);\n }\n $spos[$n_spos++] = $yy;\n $spos[$n_spos++] = $xx;\n if( $yy > 0 and substr($ss[$yy-1],$xx,1) eq '.' and $mp[$yy-1]->[$xx] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy - 1;\n $pos[$o2 + ($nx_pos++)] = $xx;\n $mp[$yy-1]->[$xx] = $v;\n }\n if( $yy < $h - 1 and substr($ss[$yy+1],$xx,1) eq '.' and $mp[$yy+1]->[$xx] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy + 1;\n $pos[$o2 + ($nx_pos++)] = $xx;\n $mp[$yy+1]->[$xx] = $v;\n }\n if( $xx > 0 and substr($ss[$yy],$xx-1,1) eq '.' and $mp[$yy]->[$xx-1] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy;\n $pos[$o2 + ($nx_pos++)] = $xx - 1;\n $mp[$yy]->[$xx-1] = $v;\n }\n if( $xx < $w - 1 and substr($ss[$yy],$xx+1,1) eq '.' and $mp[$yy]->[$xx+1] == 0 ){\n $pos[$o2 + ($nx_pos++)] = $yy;\n $pos[$o2 + ($nx_pos++)] = $xx + 1;\n $mp[$yy]->[$xx+1] = $v;\n }\n }\n $$n_pos = $nx_pos;\n my $tmp = $o2;\n $o2 = $o1;\n $o1 = $tmp;\n }\n return $n_spos;\n}\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "sample_input": "4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02579", "source_text": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2737, "cpu_time_ms": 2207, "memory_kb": 69860}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s694795113", "group_id": "codeNet:p02582", "input_text": "my $s=<>;chomp $s;\nif ($s eq \"SSS\"){print \"0\";}\nelsif($s eq \"RRR\"){print\"3\";}\nelsif($s eq \"SRR\"||$s eq \"RRS\"){print\"2\";}\nelsif($s eq \"RRR\"||$s eq \"SRS\"||$s eq \"RSS\"||$s eq \"RSR\"){print\"1\";}\n", "language": "Perl", "metadata": {"date": 1597521074, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02582.html", "problem_id": "p02582", "resource_group": "low_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/Perl/s694795113.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s694795113", "user_id": "u853130993"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my $s=<>;chomp $s;\nif ($s eq \"SSS\"){print \"0\";}\nelsif($s eq \"RRR\"){print\"3\";}\nelsif($s eq \"SRR\"||$s eq \"RRS\"){print\"2\";}\nelsif($s eq \"RRR\"||$s eq \"SRS\"||$s eq \"RSS\"||$s eq \"RSR\"){print\"1\";}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 4644}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s941664845", "group_id": "codeNet:p02582", "input_text": "#!/usr/bin/perl\n\nmy $s = scalar();\nmy $r = 0;\n\nif( $s =~ /^RRR/o ){\n $r = 3;\n} elsif( $s =~ /^(?:RRS|SRR)/o ){\n $r = 2;\n} elsif( $s =~ /R/o ){\n $r = 1;\n}\nprint \"$r\\n\";\n\n", "language": "Perl", "metadata": {"date": 1597518153, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02582.html", "problem_id": "p02582", "resource_group": "low_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/Perl/s941664845.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s941664845", "user_id": "u750383873"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy $s = scalar();\nmy $r = 0;\n\nif( $s =~ /^RRR/o ){\n $r = 3;\n} elsif( $s =~ /^(?:RRS|SRR)/o ){\n $r = 2;\n} elsif( $s =~ /R/o ){\n $r = 1;\n}\nprint \"$r\\n\";\n\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 4824}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s178856870", "group_id": "codeNet:p02583", "input_text": "get;say +grep {.sum>.max*2},(sort +<.max*2},(sort +<;\nmy $input = ;\nchomp $input;\n\nmy $array = [split / /, $input];\n$array = [sort { $a <=> $b } @$array];\n\nmy $count = 0;\n\nfor (my $i = 0; $i < $n; $i++) {\n my $num = $array->[$i];\n for (my $second_index = $i+1; $second_index < $n; $second_index++) {\n my $second_num = $array->[$second_index];\n for (my $third_index = $second_index+1; $third_index < $n; $third_index++) {\n my $third_num = $array->[$third_index];\n\n if ($num + $second_num > $third_num && $num != $second_num && $second_num != $third_num) {\n $count++;\n }\n }\n }\n}\n\nsay $count;", "language": "Perl", "metadata": {"date": 1597519033, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02583.html", "problem_id": "p02583", "resource_group": "low_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/Perl/s629380031.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s629380031", "user_id": "u263798811"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\n\nuse feature qw(say);\nuse Data::Dumper;\n\nmy $n = ;\nmy $input = ;\nchomp $input;\n\nmy $array = [split / /, $input];\n$array = [sort { $a <=> $b } @$array];\n\nmy $count = 0;\n\nfor (my $i = 0; $i < $n; $i++) {\n my $num = $array->[$i];\n for (my $second_index = $i+1; $second_index < $n; $second_index++) {\n my $second_num = $array->[$second_index];\n for (my $third_index = $second_index+1; $third_index < $n; $third_index++) {\n my $third_num = $array->[$third_index];\n\n if ($num + $second_num > $third_num && $num != $second_num && $second_num != $third_num) {\n $count++;\n }\n }\n }\n}\n\nsay $count;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 714, "cpu_time_ms": 55, "memory_kb": 6424}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s967836541", "group_id": "codeNet:p02584", "input_text": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\nuse POSIX qw/floor ceil/;\n\n\nsub main {\n chomp(my $line = <>);\n my ($x, $k, $d) = split(/ /, $line);\n say calc($x, $k, $d);\n}\n\nsub calc {\n my ($x, $k, $d) = @_;\n\n if ($x > 0) {\n my $ret = $x - $k * $d;\n return $ret if $ret > 0;\n } else {\n my $ret = $x + $k * $d;\n return -$ret if $ret < 0;\n }\n\n if ($x > 0) {\n my $dd = floor($x / $d);\n my $r = $x%$dd;\n \n if ($dd%2 == $k%2) {\n return $r;\n } else {\n return abs($r - $d);\n }\n } else {\n my $dd = ceil($x / $d);\n my $r = $x%$d;\n \n if ($dd%2 == $k%2) {\n return $r;\n } else {\n return abs($r - $d);\n }\n }\n}\n\nmain();\n\n1;", "language": "Perl", "metadata": {"date": 1597522784, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02584.html", "problem_id": "p02584", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02584/input.txt", "sample_output_relpath": "derived/input_output/data/p02584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02584/Perl/s967836541.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s967836541", "user_id": "u566924053"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\nuse POSIX qw/floor ceil/;\n\n\nsub main {\n chomp(my $line = <>);\n my ($x, $k, $d) = split(/ /, $line);\n say calc($x, $k, $d);\n}\n\nsub calc {\n my ($x, $k, $d) = @_;\n\n if ($x > 0) {\n my $ret = $x - $k * $d;\n return $ret if $ret > 0;\n } else {\n my $ret = $x + $k * $d;\n return -$ret if $ret < 0;\n }\n\n if ($x > 0) {\n my $dd = floor($x / $d);\n my $r = $x%$dd;\n \n if ($dd%2 == $k%2) {\n return $r;\n } else {\n return abs($r - $d);\n }\n } else {\n my $dd = ceil($x / $d);\n my $r = $x%$d;\n \n if ($dd%2 == $k%2) {\n return $r;\n } else {\n return abs($r - $d);\n }\n }\n}\n\nmain();\n\n1;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "sample_input": "6 2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02584", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 790, "cpu_time_ms": 30, "memory_kb": 6564}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s247532103", "group_id": "codeNet:p02585", "input_text": "use strict;\nuse warnings;\nuse utf8;\n\nuse feature qw(say);\nuse Data::Dumper;\n\nmy $input = ;\nchomp $input;\nmy ($n, $k) = split / /, $input;\n\nmy $p_list = ;\nchomp $p_list;\nmy $p_lists = [split / /, $p_list];\n\nmy $score_list = ;\nchomp $score_list;\nmy $score_lists = [split / /, $score_list];\n\nmy $max_of_total;\nfor (my $first_step = 1; $first_step <= $n; $first_step++) {\n my $score = 0;\n my $loop = [];\n my $next_step = $p_lists->[$first_step - 1];\n\n while (1) {\n # stepに到着\n my $index = $next_step -1;\n my $score_of_step = $score_lists->[$index];\n $score += $score_of_step;\n push @$loop, $score;\n last if $next_step == $first_step;\n\n $next_step = $p_lists->[$index];\n }\n\n my $loop_count = scalar @$loop;\n my $nth = 1;\n my $max;\n while (1) {\n last if $nth > $k;\n last if $nth > $loop_count;\n\n my $score_without_loop = $loop->[$nth - 1];\n my $extra = $k - $nth;\n my $loop_num = int($extra/$loop_count) || 0;\n my $score_in_loop = $score_without_loop + $loop_num * $score;\n $nth++;\n\n $max = defined($max) && $max > $score_in_loop ? $max : $score_in_loop;\n }\n $max_of_total = defined($max_of_total) && $max_of_total > $max ? $max_of_total : $max;\n}\nsay $max_of_total;", "language": "Perl", "metadata": {"date": 1597737951, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02585.html", "problem_id": "p02585", "resource_group": "low_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/Perl/s247532103.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s247532103", "user_id": "u263798811"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\n\nuse feature qw(say);\nuse Data::Dumper;\n\nmy $input = ;\nchomp $input;\nmy ($n, $k) = split / /, $input;\n\nmy $p_list = ;\nchomp $p_list;\nmy $p_lists = [split / /, $p_list];\n\nmy $score_list = ;\nchomp $score_list;\nmy $score_lists = [split / /, $score_list];\n\nmy $max_of_total;\nfor (my $first_step = 1; $first_step <= $n; $first_step++) {\n my $score = 0;\n my $loop = [];\n my $next_step = $p_lists->[$first_step - 1];\n\n while (1) {\n # stepに到着\n my $index = $next_step -1;\n my $score_of_step = $score_lists->[$index];\n $score += $score_of_step;\n push @$loop, $score;\n last if $next_step == $first_step;\n\n $next_step = $p_lists->[$index];\n }\n\n my $loop_count = scalar @$loop;\n my $nth = 1;\n my $max;\n while (1) {\n last if $nth > $k;\n last if $nth > $loop_count;\n\n my $score_without_loop = $loop->[$nth - 1];\n my $extra = $k - $nth;\n my $loop_num = int($extra/$loop_count) || 0;\n my $score_in_loop = $score_without_loop + $loop_num * $score;\n $nth++;\n\n $max = defined($max) && $max > $score_in_loop ? $max : $score_in_loop;\n }\n $max_of_total = defined($max_of_total) && $max_of_total > $max ? $max_of_total : $max;\n}\nsay $max_of_total;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1324, "cpu_time_ms": 3308, "memory_kb": 7664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s176366963", "group_id": "codeNet:p02594", "input_text": "print<><30?No:Yes", "language": "Perl", "metadata": {"date": 1596416960, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02594.html", "problem_id": "p02594", "resource_group": "low_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/Perl/s176366963.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s176366963", "user_id": "u832039789"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "print<><30?No:Yes", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 17, "cpu_time_ms": 3, "memory_kb": 4668}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s439587921", "group_id": "codeNet:p02595", "input_text": "my ($N,$D) =split(/ /,<>);\n\nmy $count =0;\nfor(my $i=0;$i<$N;$i++){\n my ($x,$y) =split(/ /,<>);\n my $L = sqrt($x*$x+$y*$y);\n if($D>=$L){ $count++;}\n}\n\nprint \"$count\";", "language": "Perl", "metadata": {"date": 1596416758, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02595.html", "problem_id": "p02595", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02595/input.txt", "sample_output_relpath": "derived/input_output/data/p02595/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02595/Perl/s439587921.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s439587921", "user_id": "u464700044"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my ($N,$D) =split(/ /,<>);\n\nmy $count =0;\nfor(my $i=0;$i<$N;$i++){\n my ($x,$y) =split(/ /,<>);\n my $L = sqrt($x*$x+$y*$y);\n if($D>=$L){ $count++;}\n}\n\nprint \"$count\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\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 D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "sample_input": "4 5\n0 5\n-2 4\n3 4\n4 -4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02595", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\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 D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 132, "memory_kb": 4772}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s620916987", "group_id": "codeNet:p02595", "input_text": "#!/usr/bin/perl\nuse POSIX qw(floor);\n\nmy ($n,$d) = map { $_ - 0 } split(/\\s+/,);\n\nmy $d2 = $d * $d;\nmy $cnt = 0;\nfor(my $i=0;$i<$n;$i++){\n my ($x,$y) = map { $_ - 0 } split(/\\s+/,);\n $cnt++ if $x * $x + $y * $y <= $d2;\n}\n\nprint \"$cnt\\n\";\n\n", "language": "Perl", "metadata": {"date": 1596416545, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02595.html", "problem_id": "p02595", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02595/input.txt", "sample_output_relpath": "derived/input_output/data/p02595/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02595/Perl/s620916987.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s620916987", "user_id": "u750383873"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\nuse POSIX qw(floor);\n\nmy ($n,$d) = map { $_ - 0 } split(/\\s+/,);\n\nmy $d2 = $d * $d;\nmy $cnt = 0;\nfor(my $i=0;$i<$n;$i++){\n my ($x,$y) = map { $_ - 0 } split(/\\s+/,);\n $cnt++ if $x * $x + $y * $y <= $d2;\n}\n\nprint \"$cnt\\n\";\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\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 D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "sample_input": "4 5\n0 5\n-2 4\n3 4\n4 -4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02595", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\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 D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 218, "memory_kb": 6616}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s446677375", "group_id": "codeNet:p02596", "input_text": "$%=<>;0while$i++<$%and$t=($t*10+7)%$%;print$t?-1:$i", "language": "Perl", "metadata": {"date": 1596453859, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02596.html", "problem_id": "p02596", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02596/input.txt", "sample_output_relpath": "derived/input_output/data/p02596/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02596/Perl/s446677375.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s446677375", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$%=<>;0while$i++<$%and$t=($t*10+7)%$%;print$t?-1:$i", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "sample_input": "101\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02596", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 158, "memory_kb": 4700}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s500402530", "group_id": "codeNet:p02596", "input_text": "my $k=<>;\nmy $a=0;\nmy $b=7;\nmy $count=0;\nif($k%2==0||$k%5==0){print \"-1\";}else{while($a==0){$count=$count+1;if($b%$k==0){$a=1;}else{$b=(($b%$k)*10)+7}}\nprint \"$count\";}", "language": "Perl", "metadata": {"date": 1596418312, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02596.html", "problem_id": "p02596", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02596/input.txt", "sample_output_relpath": "derived/input_output/data/p02596/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02596/Perl/s500402530.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s500402530", "user_id": "u853130993"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "my $k=<>;\nmy $a=0;\nmy $b=7;\nmy $count=0;\nif($k%2==0||$k%5==0){print \"-1\";}else{while($a==0){$count=$count+1;if($b%$k==0){$a=1;}else{$b=(($b%$k)*10)+7}}\nprint \"$count\";}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "sample_input": "101\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02596", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 140, "memory_kb": 4720}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s160495539", "group_id": "codeNet:p02598", "input_text": "#!/usr/bin/perl\n\nmy ($n,$k) = map { $_ - 0 } split(/\\s+/,);\nmy @aa = map { $_ - 0 } split(/\\s+/,);\n\nmy @sa = sort { $a <=> $b } @aa;\n\nmy $sum1 = 0;\nfor(my $i=0;$i<$n;$i++){\n $sum1 += $aa[$i];\n}\n\nif( $k == 0 ){\n print \"$sa[$#sa]\\n\"; exit(0);\n}\nif( $k == 1 ){\n my $d2 = int( ($sa[$#sa] + 1)/2 );\n if( $n==1 ){\n print \"$d2\\n\";\n } else {\n $d2 = $sa[0] if $sa[0] > $d2;\n print \"$d2\\n\";\n }\n exit(0);\n}\n\nmy $mx = 10 ** 9;\nmy $mn = 1;\n\nmy $mx_c = &chk($mx);\nmy $mn_c = &chk($mn);\n\n#print \"mx,mn_c = $mx_c , $mn_c \\n\";\n\nwhile( $mx - $mn > 1 ){\n my $md = int( ($mx + $mn)/2 );\n my $md_c = &chk($md);\n if( $md_c <= $k and $k <= $mn_c ){\n $mx = $md;\n $mx_c = $md_c;\n } else { #( $mx_c <= $k < $md_c ){\n $mn = $md;\n $mn_c = $md_c;\n }\n #print \"mx,mn_c = $mx_c , $mn_c \\n\";\n}\n\nif( $mn_c == $k ){\n print \"$mn\\n\";\n} elsif( $mx_c == $k ){\n print \"$mx\\n\";\n} else {\n if( $mx_c < $k and $k < $mn_c ){\n print \"$mx\\n\";\n } elsif( $mn_c < $k ){\n print \"$mn\\n\";\n } else {\n print \"$mx\\n\";\n }\n}\n\nexit(0);\n\nsub chk {\n my $v = shift;\n my $s = 0;\n for(my $i=0;$i<$n;$i++){\n my $vv = int((( $v - 1 ) + $aa[$i]) / $v) - 1;\n $s += $vv;\n }\n return $s;\n}\n", "language": "Perl", "metadata": {"date": 1596422144, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02598.html", "problem_id": "p02598", "resource_group": "low_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/Perl/s160495539.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s160495539", "user_id": "u750383873"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n,$k) = map { $_ - 0 } split(/\\s+/,);\nmy @aa = map { $_ - 0 } split(/\\s+/,);\n\nmy @sa = sort { $a <=> $b } @aa;\n\nmy $sum1 = 0;\nfor(my $i=0;$i<$n;$i++){\n $sum1 += $aa[$i];\n}\n\nif( $k == 0 ){\n print \"$sa[$#sa]\\n\"; exit(0);\n}\nif( $k == 1 ){\n my $d2 = int( ($sa[$#sa] + 1)/2 );\n if( $n==1 ){\n print \"$d2\\n\";\n } else {\n $d2 = $sa[0] if $sa[0] > $d2;\n print \"$d2\\n\";\n }\n exit(0);\n}\n\nmy $mx = 10 ** 9;\nmy $mn = 1;\n\nmy $mx_c = &chk($mx);\nmy $mn_c = &chk($mn);\n\n#print \"mx,mn_c = $mx_c , $mn_c \\n\";\n\nwhile( $mx - $mn > 1 ){\n my $md = int( ($mx + $mn)/2 );\n my $md_c = &chk($md);\n if( $md_c <= $k and $k <= $mn_c ){\n $mx = $md;\n $mx_c = $md_c;\n } else { #( $mx_c <= $k < $md_c ){\n $mn = $md;\n $mn_c = $md_c;\n }\n #print \"mx,mn_c = $mx_c , $mn_c \\n\";\n}\n\nif( $mn_c == $k ){\n print \"$mn\\n\";\n} elsif( $mx_c == $k ){\n print \"$mx\\n\";\n} else {\n if( $mx_c < $k and $k < $mn_c ){\n print \"$mx\\n\";\n } elsif( $mn_c < $k ){\n print \"$mn\\n\";\n } else {\n print \"$mx\\n\";\n }\n}\n\nexit(0);\n\nsub chk {\n my $v = shift;\n my $s = 0;\n for(my $i=0;$i<$n;$i++){\n my $vv = int((( $v - 1 ) + $aa[$i]) / $v) - 1;\n $s += $vv;\n }\n return $s;\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;\nsay( 8 - int( ($x - 400) / 200 ) );", "language": "Perl", "metadata": {"date": 1598313448, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02600.html", "problem_id": "p02600", "resource_group": "low_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/Perl/s314933458.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s314933458", "user_id": "u376692089"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "use v5.18;\nmy $x = <>;\nsay( 8 - int( ($x - 400) / 200 ) );", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 11, "memory_kb": 4692}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s671657353", "group_id": "codeNet:p02601", "input_text": "use v5.26;\nuse POSIX qw/ ceil /;\nuse List::Util qw/ max /;\nmy @cards = glob <>;\nmy $k = <>;\nmy @ideals = (\n $cards[0],\n max($cards[0] + 1, $cards[1]),\n max($cards[0] + 2, $cards[1] + 1, $cards[2])\n);\nmy $count = 0;\nfor my $i (1 .. $#cards) {\n if ($cards[$i - 1] >= $cards[$i]) {\n $count += ceil( $ideals[$i] / $cards[$i] ) - 1;\n }\n}\nsay $k - $count >= 0 ? 'Yes' : 'No';", "language": "Perl", "metadata": {"date": 1598314874, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02601.html", "problem_id": "p02601", "resource_group": "low_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/Perl/s671657353.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s671657353", "user_id": "u376692089"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use v5.26;\nuse POSIX qw/ ceil /;\nuse List::Util qw/ max /;\nmy @cards = glob <>;\nmy $k = <>;\nmy @ideals = (\n $cards[0],\n max($cards[0] + 1, $cards[1]),\n max($cards[0] + 2, $cards[1] + 1, $cards[2])\n);\nmy $count = 0;\nfor my $i (1 .. $#cards) {\n if ($cards[$i - 1] >= $cards[$i]) {\n $count += ceil( $ideals[$i] / $cards[$i] ) - 1;\n }\n}\nsay $k - $count >= 0 ? 'Yes' : 'No';", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 377, "cpu_time_ms": 26, "memory_kb": 6808}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s553037895", "group_id": "codeNet:p02603", "input_text": "$money = 1000;\n$buy = 0;\nchomp($n = <>);\nchomp($line = <>);\n@kabu = split(/ /, $line);\n\nfor $i (0 .. $n - 2){\n\tnext if($kabu[$i] > $kabu[$i + 1]);\n\tif($kabu[$i] == $kabu[$i + 1]){\n\t\tif($buy != 0){\n\t\t\t$money += $buy * $kabu[$i];\n\t\t\t$buy = 0;\n\t\t}\n\t}else{\n\t\t$now = int($money / $kabu[$i]);\n\t\t$buy += $now;\n\t\t$money -= $now * $kabu[$i];\n\t}\n}\n\n$money += $kabu[$#kabu] * $buy;\n\nprint \"$money\\n\";\n", "language": "Perl", "metadata": {"date": 1595730359, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02603.html", "problem_id": "p02603", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02603/input.txt", "sample_output_relpath": "derived/input_output/data/p02603/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02603/Perl/s553037895.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s553037895", "user_id": "u749022615"}, "prompt_components": {"gold_output": "1685\n", "input_to_evaluate": "$money = 1000;\n$buy = 0;\nchomp($n = <>);\nchomp($line = <>);\n@kabu = split(/ /, $line);\n\nfor $i (0 .. $n - 2){\n\tnext if($kabu[$i] > $kabu[$i + 1]);\n\tif($kabu[$i] == $kabu[$i + 1]){\n\t\tif($buy != 0){\n\t\t\t$money += $buy * $kabu[$i];\n\t\t\t$buy = 0;\n\t\t}\n\t}else{\n\t\t$now = int($money / $kabu[$i]);\n\t\t$buy += $now;\n\t\t$money -= $now * $kabu[$i];\n\t}\n}\n\n$money += $kabu[$#kabu] * $buy;\n\nprint \"$money\\n\";\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\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 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "sample_input": "7\n100 130 130 130 115 115 150\n"}, "reference_outputs": ["1685\n"], "source_document_id": "p02603", "source_text": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\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 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 4772}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s287721099", "group_id": "codeNet:p02613", "input_text": "$/=lines.Bag;say \"$_ x $/{$_}\"for ", "language": "Perl", "metadata": {"date": 1593998015, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02613.html", "problem_id": "p02613", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02613/input.txt", "sample_output_relpath": "derived/input_output/data/p02613/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02613/Perl/s287721099.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287721099", "user_id": "u032223772"}, "prompt_components": {"gold_output": "AC x 3\nWA x 1\nTLE x 2\nRE x 0\n", "input_to_evaluate": "$/=lines.Bag;say \"$_ x $/{$_}\"for ", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "sample_input": "6\nAC\nTLE\nAC\nAC\nWA\nTLE\n"}, "reference_outputs": ["AC x 3\nWA x 1\nTLE x 2\nRE x 0\n"], "source_document_id": "p02613", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 48, "cpu_time_ms": 341, "memory_kb": 98356}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s628081439", "group_id": "codeNet:p02620", "input_text": "use List::Util qw(max min sum);\nuse Time::HiRes qw(gettimeofday tv_interval);\n\nmy ($ssec, $smsec) = gettimeofday();\n\nmy ($d) = split(/\\s+/, <>);\nmy (@c) = (-1, split(/\\s+/, <>));\n\nmy @s = ();\nfor my $i (1..$d) {\n $s[$i] = [-1, split(/\\s+/, <>)];\n}\n\nsub score {\n my (@contest) = @_;\n my $ret = 0;\n my @last = (-1); for (1..26) { push @last, 0; }\n my $j = 1;\n\n for my $i (@contest) {\n\t$ret += $s[$j][$i];\n\t$last[$i] = $j;\n\tfor (1..26) {\n\t $ret -= $c[$_] * ($j-$last[$_]);\n\t}\n\t$j++;\n }\n return $ret;\n}\n\nsub max_index {\n my (@list) = @_;\n my $maxi = 0;\n for (my $i=0; $i $val;\n }\n return @ret;\n}\n\nmy @last = (-1); for (1..26) { push @last, 0; }\nmy @cont = ();\nfor my $j (1..$d) {\n my $max = max(@{$s[$j]});\n my @can = (1..26);\n #my @can = over_index($max*0.9, @{$s[$j]});\n #print \"$j: \", join(\",\", @can), \"\\n\";\n \n my $index = -1;\n my $maxre = 0;\n for my $i (@can) {\n\tmy $re = $s[$j][$i] + $c[$i] * ($j-$last[$i]);\n\tif ($maxre < $re) { $maxre=$re; $index = $i; }\n }\n #push @cont, max_index(@{$s[$j]});\n push @cont, $index;\n $last[$index] = $j;\n}\n\nmy $score = score(@cont);\nwhile (1) {\n my ($sec, $msec) = gettimeofday();\n #print \"$score : $sec $msec\\n\";\n last if ($sec+$msec/1000000 - $ssec-$smsec/1000000 > 1.7);\n my @new = @cont;\n $new[int(1+rand($d))] = int(1+rand(26));\n my $new_score = score(@new);\n if ($new_score > $score) {\n\t$score = $new_score;\n\t@cont = @new;\n }\n}\n\n\nprint join(\"\\n\", @cont), \"\\n\";\n#print score(@cont), \"\\n\";\n", "language": "Perl", "metadata": {"date": 1593398973, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02620.html", "problem_id": "p02620", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02620/input.txt", "sample_output_relpath": "derived/input_output/data/p02620/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02620/Perl/s628081439.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s628081439", "user_id": "u996239623"}, "prompt_components": {"gold_output": "72882\n56634\n38425\n27930\n42884\n", "input_to_evaluate": "use List::Util qw(max min sum);\nuse Time::HiRes qw(gettimeofday tv_interval);\n\nmy ($ssec, $smsec) = gettimeofday();\n\nmy ($d) = split(/\\s+/, <>);\nmy (@c) = (-1, split(/\\s+/, <>));\n\nmy @s = ();\nfor my $i (1..$d) {\n $s[$i] = [-1, split(/\\s+/, <>)];\n}\n\nsub score {\n my (@contest) = @_;\n my $ret = 0;\n my @last = (-1); for (1..26) { push @last, 0; }\n my $j = 1;\n\n for my $i (@contest) {\n\t$ret += $s[$j][$i];\n\t$last[$i] = $j;\n\tfor (1..26) {\n\t $ret -= $c[$_] * ($j-$last[$_]);\n\t}\n\t$j++;\n }\n return $ret;\n}\n\nsub max_index {\n my (@list) = @_;\n my $maxi = 0;\n for (my $i=0; $i $val;\n }\n return @ret;\n}\n\nmy @last = (-1); for (1..26) { push @last, 0; }\nmy @cont = ();\nfor my $j (1..$d) {\n my $max = max(@{$s[$j]});\n my @can = (1..26);\n #my @can = over_index($max*0.9, @{$s[$j]});\n #print \"$j: \", join(\",\", @can), \"\\n\";\n \n my $index = -1;\n my $maxre = 0;\n for my $i (@can) {\n\tmy $re = $s[$j][$i] + $c[$i] * ($j-$last[$i]);\n\tif ($maxre < $re) { $maxre=$re; $index = $i; }\n }\n #push @cont, max_index(@{$s[$j]});\n push @cont, $index;\n $last[$index] = $j;\n}\n\nmy $score = score(@cont);\nwhile (1) {\n my ($sec, $msec) = gettimeofday();\n #print \"$score : $sec $msec\\n\";\n last if ($sec+$msec/1000000 - $ssec-$smsec/1000000 > 1.7);\n my @new = @cont;\n $new[int(1+rand($d))] = int(1+rand(26));\n my $new_score = score(@new);\n if ($new_score > $score) {\n\t$score = $new_score;\n\t@cont = @new;\n }\n}\n\n\nprint join(\"\\n\", @cont), \"\\n\";\n#print score(@cont), \"\\n\";\n", "problem_context": "(Please read problem A first. The maximum score you can get by solving this problem C is 1, which will have almost no effect on your ranking.)\n\nBeginner's Guide\n\n\"Local search\" is a powerful method for finding a high-quality solution.\nIn this method, instead of constructing a solution from scratch, we try to find a better solution by slightly modifying the already found solution.\nIf the solution gets better, update it, and if it gets worse, restore it.\nBy repeating this process, the quality of the solution is gradually improved over time.\nThe pseudo-code is as follows.\n\nsolution = compute an initial solution (by random generation, or by applying other methods such as greedy)\nwhile the remaining time > 0:\nslightly modify the solution (randomly)\nif the solution gets worse:\nrestore the solution\n\nFor example, in this problem, we can use the following modification: pick the date d and contest type q at random and change the type of contest to be held on day d to q.\nThe pseudo-code is as follows.\n\nt[1..D] = compute an initial solution (by random generation, or by applying other methods such as greedy)\nwhile the remaining time > 0:\npick d and q at random\nold = t[d] # Remember the original value so that we can restore it later\nt[d] = q\nif the solution gets worse:\nt[d] = old\n\nThe most important thing when using the local search method is the design of how to modify solutions.\n\nIf the amount of modification is too small, we will soon fall into a dead-end (local optimum) and, conversely, if the amount of modification is too large, the probability of finding an improving move becomes extremely small.\n\nIn order to increase the number of iterations, it is desirable to be able to quickly calculate the score after applying a modification.\n\nIn this problem C, we focus on the second point.\nThe score after the modification can, of course, be obtained by calculating the score from scratch.\nHowever, by focusing on only the parts that have been modified, it may be possible to quickly compute the difference between the scores before and after the modification.\nFrom another viewpoint, the impossibility of such a fast incremental calculation implies that a small modification to the solution affects a majority of the score calculation.\nIn such a case, we may need to redesign how to modify solutions, or there is a high possibility that the problem is not suitable for local search.\nLet's implement fast incremental score computation.\nIt's time to demonstrate the skills of algorithms and data structures you have developed in ABC and ARC!\n\nIn this kind of contest, where the objective is to find a better solution instead of the optimal one, a bug in a program does not result in a wrong answer, which may delay the discovery of the bug.\nFor early detection of bugs, it is a good idea to unit test functions you implemented complicated routines.\nFor example, if you implement fast incremental score calculation, it is a good idea to test that the scores computed by the fast implementation match the scores computed from scratch, as we will do in this problem C.\n\nProblem Statement\n\nYou will be given a contest schedule for D days and M queries of schedule modification.\nIn the i-th query, given integers d_i and q_i, change the type of contest to be held on day d_i to q_i, and then output the final satisfaction at the end of day D on the updated schedule.\nNote that we do not revert each query. That is, the i-th query is applied to the new schedule obtained by the (i-1)-th query.\n\nInput\n\nInput is given from Standard Input in the form of the input of Problem A followed by the output of Problem A and the queries.\n\nD\nc_1 c_2 \\cdots c_{26}\ns_{1,1} s_{1,2} \\cdots s_{1,26}\n\\vdots\ns_{D,1} s_{D,2} \\cdots s_{D,26}\nt_1\nt_2\n\\vdots\nt_D\nM\nd_1 q_1\nd_2 q_2\n\\vdots\nd_M q_M\n\nThe constraints and generation methods for the input part are the same as those for Problem A.\n\nFor each d=1,\\ldots,D, t_d is an integer generated independently and uniformly at random from {1,2,\\ldots,26}.\n\nThe number of queries M is an integer satisfying 1\\leq M\\leq 10^5.\n\nFor each i=1,\\ldots,M, d_i is an integer generated independently and uniformly at random from {1,2,\\ldots,D}.\n\nFor each i=1,\\ldots,26, q_i is an integer satisfying 1\\leq q_i\\leq 26 generated uniformly at random from the 25 values that differ from the type of contest on day d_i.\n\nOutput\n\nLet v_i be the final satisfaction at the end of day D on the schedule after applying the i-th query.\nPrint M integers v_i to Standard Output in the following format:\n\nv_1\nv_2\n\\vdots\nv_M\n\nSample Input 1\n\n5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n5\n1 7\n4 11\n3 4\n5 24\n4 19\n\nSample Output 1\n\n72882\n56634\n38425\n27930\n42884\n\nNote that this example is a small one for checking the problem specification. It does not satisfy the constraint D=365 and is never actually given as a test case.\n\nNext Step\n\nLet's go back to Problem A and implement the local search algorithm by utilizing the incremental score calculator you just implemented!\nFor this problem, the current modification \"pick the date d and contest type q at random and change the type of contest to be held on day d to q\" is actually not so good. By considering why it is not good, let's improve the modification operation.\nOne of the most powerful and widely used variant of the local search method is \"Simulated Annealing (SA)\", which makes it easier to reach a better solution by stochastically accepting worsening moves.\nFor more information about SA and other local search techniques, please refer to the editorial that will be published after the contest.", "sample_input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n5\n1 7\n4 11\n3 4\n5 24\n4 19\n"}, "reference_outputs": ["72882\n56634\n38425\n27930\n42884\n"], "source_document_id": "p02620", "source_text": "(Please read problem A first. The maximum score you can get by solving this problem C is 1, which will have almost no effect on your ranking.)\n\nBeginner's Guide\n\n\"Local search\" is a powerful method for finding a high-quality solution.\nIn this method, instead of constructing a solution from scratch, we try to find a better solution by slightly modifying the already found solution.\nIf the solution gets better, update it, and if it gets worse, restore it.\nBy repeating this process, the quality of the solution is gradually improved over time.\nThe pseudo-code is as follows.\n\nsolution = compute an initial solution (by random generation, or by applying other methods such as greedy)\nwhile the remaining time > 0:\nslightly modify the solution (randomly)\nif the solution gets worse:\nrestore the solution\n\nFor example, in this problem, we can use the following modification: pick the date d and contest type q at random and change the type of contest to be held on day d to q.\nThe pseudo-code is as follows.\n\nt[1..D] = compute an initial solution (by random generation, or by applying other methods such as greedy)\nwhile the remaining time > 0:\npick d and q at random\nold = t[d] # Remember the original value so that we can restore it later\nt[d] = q\nif the solution gets worse:\nt[d] = old\n\nThe most important thing when using the local search method is the design of how to modify solutions.\n\nIf the amount of modification is too small, we will soon fall into a dead-end (local optimum) and, conversely, if the amount of modification is too large, the probability of finding an improving move becomes extremely small.\n\nIn order to increase the number of iterations, it is desirable to be able to quickly calculate the score after applying a modification.\n\nIn this problem C, we focus on the second point.\nThe score after the modification can, of course, be obtained by calculating the score from scratch.\nHowever, by focusing on only the parts that have been modified, it may be possible to quickly compute the difference between the scores before and after the modification.\nFrom another viewpoint, the impossibility of such a fast incremental calculation implies that a small modification to the solution affects a majority of the score calculation.\nIn such a case, we may need to redesign how to modify solutions, or there is a high possibility that the problem is not suitable for local search.\nLet's implement fast incremental score computation.\nIt's time to demonstrate the skills of algorithms and data structures you have developed in ABC and ARC!\n\nIn this kind of contest, where the objective is to find a better solution instead of the optimal one, a bug in a program does not result in a wrong answer, which may delay the discovery of the bug.\nFor early detection of bugs, it is a good idea to unit test functions you implemented complicated routines.\nFor example, if you implement fast incremental score calculation, it is a good idea to test that the scores computed by the fast implementation match the scores computed from scratch, as we will do in this problem C.\n\nProblem Statement\n\nYou will be given a contest schedule for D days and M queries of schedule modification.\nIn the i-th query, given integers d_i and q_i, change the type of contest to be held on day d_i to q_i, and then output the final satisfaction at the end of day D on the updated schedule.\nNote that we do not revert each query. That is, the i-th query is applied to the new schedule obtained by the (i-1)-th query.\n\nInput\n\nInput is given from Standard Input in the form of the input of Problem A followed by the output of Problem A and the queries.\n\nD\nc_1 c_2 \\cdots c_{26}\ns_{1,1} s_{1,2} \\cdots s_{1,26}\n\\vdots\ns_{D,1} s_{D,2} \\cdots s_{D,26}\nt_1\nt_2\n\\vdots\nt_D\nM\nd_1 q_1\nd_2 q_2\n\\vdots\nd_M q_M\n\nThe constraints and generation methods for the input part are the same as those for Problem A.\n\nFor each d=1,\\ldots,D, t_d is an integer generated independently and uniformly at random from {1,2,\\ldots,26}.\n\nThe number of queries M is an integer satisfying 1\\leq M\\leq 10^5.\n\nFor each i=1,\\ldots,M, d_i is an integer generated independently and uniformly at random from {1,2,\\ldots,D}.\n\nFor each i=1,\\ldots,26, q_i is an integer satisfying 1\\leq q_i\\leq 26 generated uniformly at random from the 25 values that differ from the type of contest on day d_i.\n\nOutput\n\nLet v_i be the final satisfaction at the end of day D on the schedule after applying the i-th query.\nPrint M integers v_i to Standard Output in the following format:\n\nv_1\nv_2\n\\vdots\nv_M\n\nSample Input 1\n\n5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n5\n1 7\n4 11\n3 4\n5 24\n4 19\n\nSample Output 1\n\n72882\n56634\n38425\n27930\n42884\n\nNote that this example is a small one for checking the problem specification. It does not satisfy the constraint D=365 and is never actually given as a test case.\n\nNext Step\n\nLet's go back to Problem A and implement the local search algorithm by utilizing the incremental score calculator you just implemented!\nFor this problem, the current modification \"pick the date d and contest type q at random and change the type of contest to be held on day d to q\" is actually not so good. By considering why it is not good, let's improve the modification operation.\nOne of the most powerful and widely used variant of the local search method is \"Simulated Annealing (SA)\", which makes it easier to reach a better solution by stochastically accepting worsening moves.\nFor more information about SA and other local search techniques, please refer to the editorial that will be published after the contest.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1758, "cpu_time_ms": 1718, "memory_kb": 7068}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s232000725", "group_id": "codeNet:p02621", "input_text": "my $a = $ARGV[1];\n \nprint $a + $a * $a + $a * $a * $a;\n \n1;", "language": "Perl", "metadata": {"date": 1593628988, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02621.html", "problem_id": "p02621", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02621/input.txt", "sample_output_relpath": "derived/input_output/data/p02621/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02621/Perl/s232000725.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s232000725", "user_id": "u286255470"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "my $a = $ARGV[1];\n \nprint $a + $a * $a + $a * $a * $a;\n \n1;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven an integer a as input, print the value a + a^2 + a^3.\n\nConstraints\n\n1 \\leq a \\leq 10\n\na is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\n\nOutput\n\nPrint the value a + a^2 + a^3 as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n14\n\nWhen a = 2, we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14.\n\nPrint the answer as an input. Outputs such as 14.0 will be judged as incorrect.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1110", "sample_input": "2\n"}, "reference_outputs": ["14\n"], "source_document_id": "p02621", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven an integer a as input, print the value a + a^2 + a^3.\n\nConstraints\n\n1 \\leq a \\leq 10\n\na is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\n\nOutput\n\nPrint the value a + a^2 + a^3 as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n14\n\nWhen a = 2, we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14.\n\nPrint the answer as an input. Outputs such as 14.0 will be judged as incorrect.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1110", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 59, "cpu_time_ms": 6, "memory_kb": 4612}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s397695049", "group_id": "codeNet:p02622", "input_text": "$s=<>;$t=<>;\n$ans=0;\nfor(0..length($s)-2){\n\tif(substr($s,$_,1)ne substr($t,$_,1)){\n\t\t$ans++;\n\t}\n}\nprint $ans", "language": "Perl", "metadata": {"date": 1600003541, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02622.html", "problem_id": "p02622", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02622/input.txt", "sample_output_relpath": "derived/input_output/data/p02622/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02622/Perl/s397695049.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s397695049", "user_id": "u172873334"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$s=<>;$t=<>;\n$ans=0;\nfor(0..length($s)-2){\n\tif(substr($s,$_,1)ne substr($t,$_,1)){\n\t\t$ans++;\n\t}\n}\nprint $ans", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "sample_input": "cupofcoffee\ncupofhottea\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02622", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 108, "cpu_time_ms": 46, "memory_kb": 5152}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s187610762", "group_id": "codeNet:p02622", "input_text": "use strict;\nmy @x = <>;\nchomp @x;\nmy @y = <>;\nchomp @y;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\n$d=0;\nmy $length = length(@x);\nfor($c=0; $c > $length; $c++){\n$a = shift @x;\n$b = shift @y;\nif($a != $b){$d = $d+1 ;}}\nprint \"$d\";", "language": "Perl", "metadata": {"date": 1593308339, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02622.html", "problem_id": "p02622", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02622/input.txt", "sample_output_relpath": "derived/input_output/data/p02622/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02622/Perl/s187610762.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s187610762", "user_id": "u853130993"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use strict;\nmy @x = <>;\nchomp @x;\nmy @y = <>;\nchomp @y;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\n$d=0;\nmy $length = length(@x);\nfor($c=0; $c > $length; $c++){\n$a = shift @x;\n$b = shift @y;\nif($a != $b){$d = $d+1 ;}}\nprint \"$d\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "sample_input": "cupofcoffee\ncupofhottea\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02622", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 5256}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s626334455", "group_id": "codeNet:p02622", "input_text": "print y/�// for<>^<>", "language": "Perl", "metadata": {"date": 1593306494, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02622.html", "problem_id": "p02622", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02622/input.txt", "sample_output_relpath": "derived/input_output/data/p02622/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02622/Perl/s626334455.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s626334455", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "print y/�// for<>^<>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "sample_input": "cupofcoffee\ncupofhottea\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02622", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 22, "cpu_time_ms": 11, "memory_kb": 5392}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s851731352", "group_id": "codeNet:p02625", "input_text": "use strict;\nuse warnings;\n\nuse constant MOD => 1000000007;\n\nmy ($n, $m) = split(/\\s+/, <>);\nmy @fact = (1);\nfor(my $i = 1; $i <= $m; ++$i){\n\tpush(@fact, $fact[-1] * $i % MOD);\n}\nmy @ifact;\n$ifact[$m] = powmod($fact[$m], MOD - 2);\nfor(my $i = $m; $i > 0; --$i){\n\t$ifact[$i - 1] = $ifact[$i] * $i % MOD;\n}\n\nmy $ans = perm($m, $n);\nfor(my $i = 1; $i <= $n; ++$i){\n\tmy $sgn = $i & 1 ? -1 : 1;\n\tmy $t = cmb($n, $i) * perm($m - $i, $n - $i);\n\t$ans = ($ans + $sgn * $t) % MOD;\n}\n$ans = $ans * $fact[$m] % MOD * $ifact[$m - $n] % MOD;\nprint \"$ans\\n\";\n\nsub powmod{\n\tmy ($x, $y) = @_;\n\tmy $a = 1;\n\twhile($y){\n\t\t$a = $a * $x % MOD if $y & 1;\n\t\t$y >>= 1;\n\t\t$x = $x * $x % MOD;\n\t}\n\treturn $a;\n}\n\nsub perm{\n\tmy ($n, $k) = @_;\n\treturn $fact[$n] * $ifact[$n - $k] % MOD;\n}\n\nsub cmb{\n\tmy ($n, $k) = @_;\n\treturn $fact[$n] * $ifact[$n - $k] % MOD * $ifact[$k] % MOD;\n}\n", "language": "Perl", "metadata": {"date": 1593309537, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02625.html", "problem_id": "p02625", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02625/input.txt", "sample_output_relpath": "derived/input_output/data/p02625/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02625/Perl/s851731352.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s851731352", "user_id": "u049095189"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nuse constant MOD => 1000000007;\n\nmy ($n, $m) = split(/\\s+/, <>);\nmy @fact = (1);\nfor(my $i = 1; $i <= $m; ++$i){\n\tpush(@fact, $fact[-1] * $i % MOD);\n}\nmy @ifact;\n$ifact[$m] = powmod($fact[$m], MOD - 2);\nfor(my $i = $m; $i > 0; --$i){\n\t$ifact[$i - 1] = $ifact[$i] * $i % MOD;\n}\n\nmy $ans = perm($m, $n);\nfor(my $i = 1; $i <= $n; ++$i){\n\tmy $sgn = $i & 1 ? -1 : 1;\n\tmy $t = cmb($n, $i) * perm($m - $i, $n - $i);\n\t$ans = ($ans + $sgn * $t) % MOD;\n}\n$ans = $ans * $fact[$m] % MOD * $ifact[$m - $n] % MOD;\nprint \"$ans\\n\";\n\nsub powmod{\n\tmy ($x, $y) = @_;\n\tmy $a = 1;\n\twhile($y){\n\t\t$a = $a * $x % MOD if $y & 1;\n\t\t$y >>= 1;\n\t\t$x = $x * $x % MOD;\n\t}\n\treturn $a;\n}\n\nsub perm{\n\tmy ($n, $k) = @_;\n\treturn $fact[$n] * $ifact[$n - $k] % MOD;\n}\n\nsub cmb{\n\tmy ($n, $k) = @_;\n\treturn $fact[$n] * $ifact[$n - $k] % MOD * $ifact[$k] % MOD;\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nCount the pairs of length-N sequences consisting of integers between 1 and M (inclusive), A_1, A_2, \\cdots, A_{N} and B_1, B_2, \\cdots, B_{N}, that satisfy all of the following conditions:\n\nA_i \\neq B_i, for every i such that 1\\leq i\\leq N.\n\nA_i \\neq A_j and B_i \\neq B_j, for every (i, j) such that 1\\leq i < j\\leq N.\n\nSince the count can be enormous, print it modulo (10^9+7).\n\nConstraints\n\n1\\leq N \\leq M \\leq 5\\times10^5\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 count modulo (10^9+7).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nA_1=1,A_2=2,B_1=2,B_2=1 and A_1=2,A_2=1,B_1=1,B_2=2 satisfy the conditions.\n\nSample Input 2\n\n2 3\n\nSample Output 2\n\n18\n\nSample Input 3\n\n141421 356237\n\nSample Output 3\n\n881613484", "sample_input": "2 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02625", "source_text": "Score : 500 points\n\nProblem Statement\n\nCount the pairs of length-N sequences consisting of integers between 1 and M (inclusive), A_1, A_2, \\cdots, A_{N} and B_1, B_2, \\cdots, B_{N}, that satisfy all of the following conditions:\n\nA_i \\neq B_i, for every i such that 1\\leq i\\leq N.\n\nA_i \\neq A_j and B_i \\neq B_j, for every (i, j) such that 1\\leq i < j\\leq N.\n\nSince the count can be enormous, print it modulo (10^9+7).\n\nConstraints\n\n1\\leq N \\leq M \\leq 5\\times10^5\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 count modulo (10^9+7).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nA_1=1,A_2=2,B_1=2,B_2=1 and A_1=2,A_2=1,B_1=1,B_2=2 satisfy the conditions.\n\nSample Input 2\n\n2 3\n\nSample Output 2\n\n18\n\nSample Input 3\n\n141421 356237\n\nSample Output 3\n\n881613484", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 850, "cpu_time_ms": 510, "memory_kb": 37148}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s655187516", "group_id": "codeNet:p02627", "input_text": "#!/usr/bin/perl\n\nmy $s = scalar();\n\nif( $s =~ /^[A-Z]/o ){\n print \"A\\n\";\n} else {\n print \"a\\n\";\n}\n\n", "language": "Perl", "metadata": {"date": 1592787669, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02627.html", "problem_id": "p02627", "resource_group": "low_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/Perl/s655187516.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s655187516", "user_id": "u750383873"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy $s = scalar();\n\nif( $s =~ /^[A-Z]/o ){\n print \"A\\n\";\n} else {\n print \"a\\n\";\n}\n\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 108, "cpu_time_ms": 6, "memory_kb": 4812}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s025247094", "group_id": "codeNet:p02628", "input_text": "get~~/\\s.+/;[\\+](words)[$/-1].say", "language": "Perl", "metadata": {"date": 1592787743, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02628.html", "problem_id": "p02628", "resource_group": "low_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/Perl/s025247094.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s025247094", "user_id": "u657913472"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "get~~/\\s.+/;[\\+](words)[$/-1].say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 254, "memory_kb": 93416}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s881922778", "group_id": "codeNet:p02629", "input_text": "use strict;\nuse warnings;\nuse POSIX qw/ floor /;\nuse feature 'say';\nuse Data::Dumper;\n\nchomp(my $count = );\nmy @alphabets = ('a' .. 'z');\n\n{\n my @nums = ();\n\n sub divider {\n my $n = shift;\n\n while ( $n >= 26 ) {\n my $div = $n / 26;\n my $mod = $n % 26;\n if( $mod == 0) {\n push(@nums, $div);\n return @nums;\n } else {\n divider( $div );\n\n push(@nums, $mod);\n return @nums;\n }\n }\n\n push(@nums, $n);\n return @nums;\n\n }\n}\n\nmy @elms = divider($count);\n\nmy $str = '';\nfor my $i (@elms ) {\n my $ind = floor($i) - 1;\n $str .= $alphabets[$ind];\n}\nsay $str;\n", "language": "Perl", "metadata": {"date": 1592795375, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "low_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/Perl/s881922778.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s881922778", "user_id": "u662377073"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse POSIX qw/ floor /;\nuse feature 'say';\nuse Data::Dumper;\n\nchomp(my $count = );\nmy @alphabets = ('a' .. 'z');\n\n{\n my @nums = ();\n\n sub divider {\n my $n = shift;\n\n while ( $n >= 26 ) {\n my $div = $n / 26;\n my $mod = $n % 26;\n if( $mod == 0) {\n push(@nums, $div);\n return @nums;\n } else {\n divider( $div );\n\n push(@nums, $mod);\n return @nums;\n }\n }\n\n push(@nums, $n);\n return @nums;\n\n }\n}\n\nmy @elms = divider($count);\n\nmy $str = '';\nfor my $i (@elms ) {\n my $ind = floor($i) - 1;\n $str .= $alphabets[$ind];\n}\nsay $str;\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 633, "cpu_time_ms": 32, "memory_kb": 7216}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s432036927", "group_id": "codeNet:p02630", "input_text": "#!/usr/bin/perl\nuse POSIX qw(floor);\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @A = map { $_ - 0 } split(/\\s+/,);\n\nmy @cntA = ();\n$#cntA = 10**5;\n\nmy $tot = 0;\nfor(my $i=0;$i<$n;$i++){\n $cntA[$A[$i]]++;\n $tot += $A[$i];\n}\n\nmy ($q) = map { $_ - 0 } split(/\\s+/,);\nfor(my $i=0;$i<$q;$i++){\n my ($b,$c) = map { $_ - 0 } split(/\\s+/,);\n $tot -= ( $b * ( $cntA[$b] - 0 ) );\n my $zo = ( $cntA[$b] - 0 );\n $cntA[$c] = ( $cntA[$c] - 0 ) + $zo;\n $cntA[$b] = 0;\n $tot += ( $c * $zo );\n print \"$tot\\n\";\n}\n\n\nexit(0);\n\n", "language": "Perl", "metadata": {"date": 1592789584, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02630.html", "problem_id": "p02630", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02630/input.txt", "sample_output_relpath": "derived/input_output/data/p02630/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02630/Perl/s432036927.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s432036927", "user_id": "u750383873"}, "prompt_components": {"gold_output": "11\n12\n16\n", "input_to_evaluate": "#!/usr/bin/perl\nuse POSIX qw(floor);\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @A = map { $_ - 0 } split(/\\s+/,);\n\nmy @cntA = ();\n$#cntA = 10**5;\n\nmy $tot = 0;\nfor(my $i=0;$i<$n;$i++){\n $cntA[$A[$i]]++;\n $tot += $A[$i];\n}\n\nmy ($q) = map { $_ - 0 } split(/\\s+/,);\nfor(my $i=0;$i<$q;$i++){\n my ($b,$c) = map { $_ - 0 } split(/\\s+/,);\n $tot -= ( $b * ( $cntA[$b] - 0 ) );\n my $zo = ( $cntA[$b] - 0 );\n $cntA[$c] = ( $cntA[$c] - 0 ) + $zo;\n $cntA[$b] = 0;\n $tot += ( $c * $zo );\n print \"$tot\\n\";\n}\n\n\nexit(0);\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have a sequence A composed of N positive integers: A_{1}, A_{2}, \\cdots, A_{N}.\n\nYou will now successively do the following Q operations:\n\nIn the i-th operation, you replace every element whose value is B_{i} with C_{i}.\n\nFor each i (1 \\leq i \\leq Q), find S_{i}: the sum of all elements in A just after the i-th operation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q, A_{i}, B_{i}, C_{i} \\leq 10^{5}\n\nB_{i} \\neq C_{i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1} A_{2} \\cdots A_{N}\nQ\nB_{1} C_{1}\nB_{2} C_{2}\n\\vdots\nB_{Q} C_{Q}\n\nOutput\n\nPrint Q integers S_{i} to Standard Output in the following format:\n\nS_{1}\nS_{2}\n\\vdots\nS_{Q}\n\nNote that S_{i} may not fit into a 32-bit integer.\n\nSample Input 1\n\n4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n11\n12\n16\n\nInitially, the sequence A is 1,2,3,4.\n\nAfter each operation, it becomes the following:\n\n2, 2, 3, 4\n\n2, 2, 4, 4\n\n4, 4, 4, 4\n\nSample Input 2\n\n4\n1 1 1 1\n3\n1 2\n2 1\n3 5\n\nSample Output 2\n\n8\n4\n4\n\nNote that the sequence A may not contain an element whose value is B_{i}.\n\nSample Input 3\n\n2\n1 2\n3\n1 100\n2 100\n100 1000\n\nSample Output 3\n\n102\n200\n2000", "sample_input": "4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n"}, "reference_outputs": ["11\n12\n16\n"], "source_document_id": "p02630", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have a sequence A composed of N positive integers: A_{1}, A_{2}, \\cdots, A_{N}.\n\nYou will now successively do the following Q operations:\n\nIn the i-th operation, you replace every element whose value is B_{i} with C_{i}.\n\nFor each i (1 \\leq i \\leq Q), find S_{i}: the sum of all elements in A just after the i-th operation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q, A_{i}, B_{i}, C_{i} \\leq 10^{5}\n\nB_{i} \\neq C_{i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1} A_{2} \\cdots A_{N}\nQ\nB_{1} C_{1}\nB_{2} C_{2}\n\\vdots\nB_{Q} C_{Q}\n\nOutput\n\nPrint Q integers S_{i} to Standard Output in the following format:\n\nS_{1}\nS_{2}\n\\vdots\nS_{Q}\n\nNote that S_{i} may not fit into a 32-bit integer.\n\nSample Input 1\n\n4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n11\n12\n16\n\nInitially, the sequence A is 1,2,3,4.\n\nAfter each operation, it becomes the following:\n\n2, 2, 3, 4\n\n2, 2, 4, 4\n\n4, 4, 4, 4\n\nSample Input 2\n\n4\n1 1 1 1\n3\n1 2\n2 1\n3 5\n\nSample Output 2\n\n8\n4\n4\n\nNote that the sequence A may not contain an element whose value is B_{i}.\n\nSample Input 3\n\n2\n1 2\n3\n1 100\n2 100\n100 1000\n\nSample Output 3\n\n102\n200\n2000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 545, "cpu_time_ms": 233, "memory_kb": 23464}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s389731370", "group_id": "codeNet:p02631", "input_text": "<>;print$_^$%,$\"for grep{$%^=$_;1}glob<>", "language": "Perl", "metadata": {"date": 1592791701, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02631.html", "problem_id": "p02631", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02631/input.txt", "sample_output_relpath": "derived/input_output/data/p02631/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02631/Perl/s389731370.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s389731370", "user_id": "u283869437"}, "prompt_components": {"gold_output": "26 5 7 22\n", "input_to_evaluate": "<>;print$_^$%,$\"for grep{$%^=$_;1}glob<>", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N Snuke Cats numbered 1, 2, \\ldots, N, where N is even.\n\nEach Snuke Cat wears a red scarf, on which his favorite non-negative integer is written.\n\nRecently, they learned the operation called xor (exclusive OR).\n\nWhat is xor?\n\nFor n non-negative integers x_1, x_2, \\ldots, x_n, their xor, x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~x_n is defined as follows:\n\nWhen x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3~\\textrm{xor}~5 = 6.\n\nThey wanted to use this operation quickly, so each of them calculated the xor of the integers written on their scarfs except his scarf.\n\nWe know that the xor calculated by Snuke Cat i, that is, the xor of the integers written on the scarfs except the scarf of Snuke Cat i is a_i.\nUsing this information, restore the integer written on the scarf of each Snuke Cat.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n0 \\leq a_i \\leq 10^9\n\nThere exists a combination of integers on the scarfs that is consistent with the given information.\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 a line containing N integers separated with space.\n\nThe i-th of the integers from the left should represent the integer written on the scarf of Snuke Cat i.\n\nIf there are multiple possible solutions, you may print any of them.\n\nSample Input 1\n\n4\n20 11 9 24\n\nSample Output 1\n\n26 5 7 22\n\n5~\\textrm{xor}~7~\\textrm{xor}~22 = 20\n\n26~\\textrm{xor}~7~\\textrm{xor}~22 = 11\n\n26~\\textrm{xor}~5~\\textrm{xor}~22 = 9\n\n26~\\textrm{xor}~5~\\textrm{xor}~7 = 24\n\nThus, this output is consistent with the given information.", "sample_input": "4\n20 11 9 24\n"}, "reference_outputs": ["26 5 7 22\n"], "source_document_id": "p02631", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N Snuke Cats numbered 1, 2, \\ldots, N, where N is even.\n\nEach Snuke Cat wears a red scarf, on which his favorite non-negative integer is written.\n\nRecently, they learned the operation called xor (exclusive OR).\n\nWhat is xor?\n\nFor n non-negative integers x_1, x_2, \\ldots, x_n, their xor, x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~x_n is defined as follows:\n\nWhen x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3~\\textrm{xor}~5 = 6.\n\nThey wanted to use this operation quickly, so each of them calculated the xor of the integers written on their scarfs except his scarf.\n\nWe know that the xor calculated by Snuke Cat i, that is, the xor of the integers written on the scarfs except the scarf of Snuke Cat i is a_i.\nUsing this information, restore the integer written on the scarf of each Snuke Cat.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n0 \\leq a_i \\leq 10^9\n\nThere exists a combination of integers on the scarfs that is consistent with the given information.\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 a line containing N integers separated with space.\n\nThe i-th of the integers from the left should represent the integer written on the scarf of Snuke Cat i.\n\nIf there are multiple possible solutions, you may print any of them.\n\nSample Input 1\n\n4\n20 11 9 24\n\nSample Output 1\n\n26 5 7 22\n\n5~\\textrm{xor}~7~\\textrm{xor}~22 = 20\n\n26~\\textrm{xor}~7~\\textrm{xor}~22 = 11\n\n26~\\textrm{xor}~5~\\textrm{xor}~22 = 9\n\n26~\\textrm{xor}~5~\\textrm{xor}~7 = 24\n\nThus, this output is consistent with the given information.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 40, "cpu_time_ms": 1063, "memory_kb": 152520}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s553479130", "group_id": "codeNet:p02633", "input_text": "say 360/(90 gcd get)", "language": "Perl", "metadata": {"date": 1592709749, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02633.html", "problem_id": "p02633", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02633/input.txt", "sample_output_relpath": "derived/input_output/data/p02633/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02633/Perl/s553479130.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s553479130", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "say 360/(90 gcd get)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times:\n\nGo one meter in the direction he is facing. Then, turn X degrees counter-clockwise.\n\nConstraints\n\n1 \\leq X \\leq 179\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 number of times Takahashi will do the action before he is at the starting position again.\n\nSample Input 1\n\n90\n\nSample Output 1\n\n4\n\nTakahashi's path is a square.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n360", "sample_input": "90\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02633", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times:\n\nGo one meter in the direction he is facing. Then, turn X degrees counter-clockwise.\n\nConstraints\n\n1 \\leq X \\leq 179\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 number of times Takahashi will do the action before he is at the starting position again.\n\nSample Input 1\n\n90\n\nSample Output 1\n\n4\n\nTakahashi's path is a square.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n360", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20, "cpu_time_ms": 204, "memory_kb": 82976}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s509159080", "group_id": "codeNet:p02639", "input_text": "#!/usr/bin/perl\n\n# 引数取り込み\nmy $i = 1;\nforeach $a ( @ARGV ) {\n print \"$i\" if ( $a == 0 );\n $i = $i + 1;\n}\n\n1;", "language": "Perl", "metadata": {"date": 1594050336, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "low_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/Perl/s509159080.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s509159080", "user_id": "u286255470"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\n\n# 引数取り込み\nmy $i = 1;\nforeach $a ( @ARGV ) {\n print \"$i\" if ( $a == 0 );\n $i = $i + 1;\n}\n\n1;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 125, "cpu_time_ms": 3, "memory_kb": 4480}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s000525315", "group_id": "codeNet:p02639", "input_text": "@buf=split(' ',<>);\nfor(0..4){\n\tif($buf[$_]==0){\n\t\tprint 0+$_+1 .\"\\n\";\n\t}\n}", "language": "Perl", "metadata": {"date": 1592183006, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "low_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/Perl/s000525315.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s000525315", "user_id": "u222602662"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "@buf=split(' ',<>);\nfor(0..4){\n\tif($buf[$_]==0){\n\t\tprint 0+$_+1 .\"\\n\";\n\t}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 75, "cpu_time_ms": 4, "memory_kb": 4716}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s581752196", "group_id": "codeNet:p02639", "input_text": "say 15-words.sum", "language": "Perl", "metadata": {"date": 1592182834, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "low_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/Perl/s581752196.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s581752196", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "say 15-words.sum", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 16, "cpu_time_ms": 172, "memory_kb": 82828}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s224244462", "group_id": "codeNet:p02640", "input_text": "use strict;\nmy($x,$y)=glob <>;\nif(2*$x<=$y&&4*$x>=$y){if($y%2==0){print\"YES\";}else{print\"NO\";}}\nelse{print\"NO\";}", "language": "Perl", "metadata": {"date": 1592183515, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/Perl/s224244462.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s224244462", "user_id": "u853130993"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use strict;\nmy($x,$y)=glob <>;\nif(2*$x<=$y&&4*$x>=$y){if($y%2==0){print\"YES\";}else{print\"NO\";}}\nelse{print\"NO\";}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\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 there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\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 there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 112, "cpu_time_ms": 10, "memory_kb": 5300}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s079157206", "group_id": "codeNet:p02641", "input_text": "use strict;\nuse warnings;\nuse feature 'say';\nuse Data::Dumper;\n\nchomp(my $line = );\nmy ($x, $n) = split / /, $line;\n\nif($n == 0) {\n say $x;\n exit;\n}\n\nchomp(my $line2 = );\nmy @nums = sort { $a <=> $b } (split/ /, $line2);\n\nmy %exist_hash = ();\nmap { $exist_hash{$_}++ } @nums;\n\nmy @all = (1 .. 100);\n\nmy @not_exist = ();\nfor (@all) {\n if(! exists($exist_hash{$_}) ) {\n push(@not_exist, $_);\n }\n}\n\nmy $min_diff = 100;\nmy $answer = '';\n\n\nfor my $num ( sort { $b <=> $a } @not_exist) {\n my $diff = $x - $num;\n\n if( $answer eq '') {\n $answer = $num;\n next;\n }\n\n if ( abs($diff) <= $min_diff) {\n if ($answer = 0 || $num < $answer ) {\n $answer = $num;\n }\n $min_diff = abs($diff);\n }\n}\n\nsay $answer;\n\n\n", "language": "Perl", "metadata": {"date": 1592188469, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "low_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/Perl/s079157206.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s079157206", "user_id": "u662377073"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse feature 'say';\nuse Data::Dumper;\n\nchomp(my $line = );\nmy ($x, $n) = split / /, $line;\n\nif($n == 0) {\n say $x;\n exit;\n}\n\nchomp(my $line2 = );\nmy @nums = sort { $a <=> $b } (split/ /, $line2);\n\nmy %exist_hash = ();\nmap { $exist_hash{$_}++ } @nums;\n\nmy @all = (1 .. 100);\n\nmy @not_exist = ();\nfor (@all) {\n if(! exists($exist_hash{$_}) ) {\n push(@not_exist, $_);\n }\n}\n\nmy $min_diff = 100;\nmy $answer = '';\n\n\nfor my $num ( sort { $b <=> $a } @not_exist) {\n my $diff = $x - $num;\n\n if( $answer eq '') {\n $answer = $num;\n next;\n }\n\n if ( abs($diff) <= $min_diff) {\n if ($answer = 0 || $num < $answer ) {\n $answer = $num;\n }\n $min_diff = abs($diff);\n }\n}\n\nsay $answer;\n\n\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 739, "cpu_time_ms": 22, "memory_kb": 6428}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s449780034", "group_id": "codeNet:p02641", "input_text": "say (^102∖($/=+<;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nif(($v-$w)*$t>(abs($a-$b))){print\"YES\";}\nelse{print\"NO\";}", "language": "Perl", "metadata": {"date": 1592110935, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02645.html", "problem_id": "p02645", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02645/input.txt", "sample_output_relpath": "derived/input_output/data/p02645/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02645/Perl/s617676435.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s617676435", "user_id": "u853130993"}, "prompt_components": {"gold_output": "tak\n", "input_to_evaluate": "use strict;\nmy $a = <>;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nif(($v-$w)*$t>(abs($a-$b))){print\"YES\";}\nelse{print\"NO\";}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWhen you asked some guy in your class his name, he called himself S, where S is a string of length between 3 and 20 (inclusive) consisting of lowercase English letters.\nYou have decided to choose some three consecutive characters from S and make it his nickname. Print a string that is a valid nickname for him.\n\nConstraints\n\n3 \\leq |S| \\leq 20\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 your answer.\n\nSample Input 1\n\ntakahashi\n\nSample Output 1\n\ntak\n\nSample Input 2\n\nnaohiro\n\nSample Output 2\n\nnao", "sample_input": "takahashi\n"}, "reference_outputs": ["tak\n"], "source_document_id": "p02645", "source_text": "Score : 100 points\n\nProblem Statement\n\nWhen you asked some guy in your class his name, he called himself S, where S is a string of length between 3 and 20 (inclusive) consisting of lowercase English letters.\nYou have decided to choose some three consecutive characters from S and make it his nickname. Print a string that is a valid nickname for him.\n\nConstraints\n\n3 \\leq |S| \\leq 20\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 your answer.\n\nSample Input 1\n\ntakahashi\n\nSample Output 1\n\ntak\n\nSample Input 2\n\nnaohiro\n\nSample Output 2\n\nnao", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 4840}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s205544059", "group_id": "codeNet:p02645", "input_text": "my $a = $ARGV[0];\nmy $substr = substr(my $a, 0, 3); \nprint my $substur;", "language": "Perl", "metadata": {"date": 1592097516, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02645.html", "problem_id": "p02645", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02645/input.txt", "sample_output_relpath": "derived/input_output/data/p02645/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02645/Perl/s205544059.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s205544059", "user_id": "u853130993"}, "prompt_components": {"gold_output": "tak\n", "input_to_evaluate": "my $a = $ARGV[0];\nmy $substr = substr(my $a, 0, 3); \nprint my $substur;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWhen you asked some guy in your class his name, he called himself S, where S is a string of length between 3 and 20 (inclusive) consisting of lowercase English letters.\nYou have decided to choose some three consecutive characters from S and make it his nickname. Print a string that is a valid nickname for him.\n\nConstraints\n\n3 \\leq |S| \\leq 20\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 your answer.\n\nSample Input 1\n\ntakahashi\n\nSample Output 1\n\ntak\n\nSample Input 2\n\nnaohiro\n\nSample Output 2\n\nnao", "sample_input": "takahashi\n"}, "reference_outputs": ["tak\n"], "source_document_id": "p02645", "source_text": "Score : 100 points\n\nProblem Statement\n\nWhen you asked some guy in your class his name, he called himself S, where S is a string of length between 3 and 20 (inclusive) consisting of lowercase English letters.\nYou have decided to choose some three consecutive characters from S and make it his nickname. Print a string that is a valid nickname for him.\n\nConstraints\n\n3 \\leq |S| \\leq 20\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 your answer.\n\nSample Input 1\n\ntakahashi\n\nSample Output 1\n\ntak\n\nSample Input 2\n\nnaohiro\n\nSample Output 2\n\nnao", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 4684}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s757823207", "group_id": "codeNet:p02646", "input_text": "use strict;\nmy $a = <>;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nif(($v-$w)*$t<=(abs($a-$b))){print\"YES\";}\nelse{print\"NO\";}", "language": "Perl", "metadata": {"date": 1592111793, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "low_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/Perl/s757823207.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s757823207", "user_id": "u853130993"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "use strict;\nmy $a = <>;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nif(($v-$w)*$t<=(abs($a-$b))){print\"YES\";}\nelse{print\"NO\";}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 130, "cpu_time_ms": 3, "memory_kb": 4880}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s861022091", "group_id": "codeNet:p02646", "input_text": "use strict;\nuse Math::BigInt;\nmy $a = <>;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nmy $e;\nmy $c;\nmy $d;\nmy $gcd = Math::BigInt::bgcd($v, $w);\n$e=0;\nif($v==$w){print\"NO\";}\nelse{for($c=0;$c*2<=$t;$c++){$d=0;while($d*2<=$t){if($a+2*$d*$w==$b+2*$c*$v||$a-2*$d*$w==$b-2*$c*$v){$e=1;$c=$c+$t;$d=$d+$t;}else{$d=$d+1;}}}\nif($e==1){print\"YES\";}else{print\"NO\";}}", "language": "Perl", "metadata": {"date": 1592103107, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "low_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/Perl/s861022091.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s861022091", "user_id": "u853130993"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "use strict;\nuse Math::BigInt;\nmy $a = <>;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nmy $e;\nmy $c;\nmy $d;\nmy $gcd = Math::BigInt::bgcd($v, $w);\n$e=0;\nif($v==$w){print\"NO\";}\nelse{for($c=0;$c*2<=$t;$c++){$d=0;while($d*2<=$t){if($a+2*$d*$w==$b+2*$c*$v||$a-2*$d*$w==$b-2*$c*$v){$e=1;$c=$c+$t;$d=$d+$t;}else{$d=$d+1;}}}\nif($e==1){print\"YES\";}else{print\"NO\";}}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 359, "cpu_time_ms": 2206, "memory_kb": 10716}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s251501349", "group_id": "codeNet:p02646", "input_text": "use strict;\nuse Math::BigInt;\nmy $a = <>;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nmy $e;\nmy $c;\nmy $d;\nmy $gcd = Math::BigInt::bgcd($v, $w);\n$e=0;\nif($v==$w){print\"NO\";}\nelsif($v>$w){print\"NO\";}\nelsif((abs($a-$b))%($w-$v)!=0){print\"NO\";}\nelsif(abs($a-$b)%$gcd!=0){print\"NO\";}\nelse{for($c=0,$c<=$t,$c++){for($d=0,$d<=$t,$d++){if($a+$d*$w==$b+$c*$v||$a-$d*$w==$b-$c*$v){$e=1;$c=$c+$t;$d=$d+$t;}}}\nif($e==1){print\"YES\";}else{print\"NO\";}}", "language": "Perl", "metadata": {"date": 1592102275, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "low_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/Perl/s251501349.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s251501349", "user_id": "u853130993"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "use strict;\nuse Math::BigInt;\nmy $a = <>;\nmy $v = <>;\nmy $b = <>;\nmy $w = <>;\nmy $t = <>;\nmy $e;\nmy $c;\nmy $d;\nmy $gcd = Math::BigInt::bgcd($v, $w);\n$e=0;\nif($v==$w){print\"NO\";}\nelsif($v>$w){print\"NO\";}\nelsif((abs($a-$b))%($w-$v)!=0){print\"NO\";}\nelsif(abs($a-$b)%$gcd!=0){print\"NO\";}\nelse{for($c=0,$c<=$t,$c++){for($d=0,$d<=$t,$d++){if($a+$d*$w==$b+$c*$v||$a-$d*$w==$b-$c*$v){$e=1;$c=$c+$t;$d=$d+$t;}}}\nif($e==1){print\"YES\";}else{print\"NO\";}}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 36, "memory_kb": 10732}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s564661773", "group_id": "codeNet:p02647", "input_text": "($N,$K)=glob<>;\n@A=glob<>;\nfor(1..$K){\n\t@_=();\n\tmap{\n\t\t++$_[$-=$_-$A[$_]];\n\t\t--$_[$_+$A[$_]+1];\n\t}0..$N-1;\n\t$t=0;\n\t@A=map$t+=$_[$_],0..$N-1;\n\tlast if!grep$_<$N,@A\n}\nprint\"@A\"\n", "language": "Perl", "metadata": {"date": 1592113212, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02647.html", "problem_id": "p02647", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02647/input.txt", "sample_output_relpath": "derived/input_output/data/p02647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02647/Perl/s564661773.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s564661773", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1 2 2 1 2\n", "input_to_evaluate": "($N,$K)=glob<>;\n@A=glob<>;\nfor(1..$K){\n\t@_=();\n\tmap{\n\t\t++$_[$-=$_-$A[$_]];\n\t\t--$_[$_+$A[$_]+1];\n\t}0..$N-1;\n\t$t=0;\n\t@A=map$t+=$_[$_],0..$N-1;\n\tlast if!grep$_<$N,@A\n}\nprint\"@A\"\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "sample_input": "5 1\n1 0 0 1 0\n"}, "reference_outputs": ["1 2 2 1 2\n"], "source_document_id": "p02647", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2207, "memory_kb": 98028}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s441653566", "group_id": "codeNet:p02647", "input_text": "use strict;\nuse warnings;\n\nmy ($n, $k) = glob <>;\nmy @a = glob <>;\n\nprint join ' ' , @{operation(\\@a, $k, 0)};\n\nsub operation {\n my ($lights, $k, $count) = @_;\n my @range_diff = map { 0 } (0..$n-1);\n\n for my $pos (0..$n-1) {\n my $min = ($pos - $lights->[$pos] >= 0) ? $pos - $lights->[$pos] : 0;\n ++$range_diff[$min];\n\n if ($pos + $lights->[$pos] + 1 <= $n-1) {\n --$range_diff[$pos + $lights->[$pos] + 1];\n }\n }\n for my $pos (1..$n-1) {\n $range_diff[$pos] += $range_diff[$pos-1];\n }\n\n return ($k-1 == 0 || $count >= 50) ? \\@range_diff : operation(\\@range_diff, $k-1, $count+1);\n}", "language": "Perl", "metadata": {"date": 1592111107, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02647.html", "problem_id": "p02647", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02647/input.txt", "sample_output_relpath": "derived/input_output/data/p02647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02647/Perl/s441653566.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s441653566", "user_id": "u035372052"}, "prompt_components": {"gold_output": "1 2 2 1 2\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy ($n, $k) = glob <>;\nmy @a = glob <>;\n\nprint join ' ' , @{operation(\\@a, $k, 0)};\n\nsub operation {\n my ($lights, $k, $count) = @_;\n my @range_diff = map { 0 } (0..$n-1);\n\n for my $pos (0..$n-1) {\n my $min = ($pos - $lights->[$pos] >= 0) ? $pos - $lights->[$pos] : 0;\n ++$range_diff[$min];\n\n if ($pos + $lights->[$pos] + 1 <= $n-1) {\n --$range_diff[$pos + $lights->[$pos] + 1];\n }\n }\n for my $pos (1..$n-1) {\n $range_diff[$pos] += $range_diff[$pos-1];\n }\n\n return ($k-1 == 0 || $count >= 50) ? \\@range_diff : operation(\\@range_diff, $k-1, $count+1);\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "sample_input": "5 1\n1 0 0 1 0\n"}, "reference_outputs": ["1 2 2 1 2\n"], "source_document_id": "p02647", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2215, "memory_kb": 261844}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s426547490", "group_id": "codeNet:p02651", "input_text": "<>;print@_=$/,1-!grep{$%=pop@A;$%-=$-=$%-($_^$%)for@_;$_*=$_[@_]=$%}reverse<>=~/./g while<>,@A=glob<>", "language": "Perl", "metadata": {"date": 1591593279, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02651.html", "problem_id": "p02651", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02651/input.txt", "sample_output_relpath": "derived/input_output/data/p02651/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02651/Perl/s426547490.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s426547490", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n0\n0\n", "input_to_evaluate": "<>;print@_=$/,1-!grep{$%=pop@A;$%-=$-=$%-($_^$%)for@_;$_*=$_[@_]=$%}reverse<>=~/./g while<>,@A=glob<>", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are two persons, numbered 0 and 1, and a variable x whose initial value is 0.\nThe two persons now play a game.\nThe game is played in N rounds. The following should be done in the i-th round (1 \\leq i \\leq N):\n\nPerson S_i does one of the following:\n\nReplace x with x \\oplus A_i, where \\oplus represents bitwise XOR.\n\nDo nothing.\n\nPerson 0 aims to have x=0 at the end of the game, while Person 1 aims to have x \\neq 0 at the end of the game.\n\nDetermine whether x becomes 0 at the end of the game when the two persons play optimally.\n\nSolve T test cases for each input file.\n\nConstraints\n\n1 \\leq T \\leq 100\n\n1 \\leq N \\leq 200\n\n1 \\leq A_i \\leq 10^{18}\n\nS is a string of length N consisting of 0 and 1.\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format.\nThe first line is as follows:\n\nT\n\nThen, T test cases follow.\nEach test case is given in the following format:\n\nN\nA_1 A_2 \\cdots A_N\nS\n\nOutput\n\nFor each test case, print a line containing 0 if x becomes 0 at the end of the game, and 1 otherwise.\n\nSample Input 1\n\n3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000\n\nSample Output 1\n\n1\n0\n0\n\nIn the first test case, if Person 1 replaces x with 0 \\oplus 1=1, we surely have x \\neq 0 at the end of the game, regardless of the choice of Person 0.\n\nIn the second test case, regardless of the choice of Person 1, Person 0 can make x=0 with a suitable choice.", "sample_input": "3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000\n"}, "reference_outputs": ["1\n0\n0\n"], "source_document_id": "p02651", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are two persons, numbered 0 and 1, and a variable x whose initial value is 0.\nThe two persons now play a game.\nThe game is played in N rounds. The following should be done in the i-th round (1 \\leq i \\leq N):\n\nPerson S_i does one of the following:\n\nReplace x with x \\oplus A_i, where \\oplus represents bitwise XOR.\n\nDo nothing.\n\nPerson 0 aims to have x=0 at the end of the game, while Person 1 aims to have x \\neq 0 at the end of the game.\n\nDetermine whether x becomes 0 at the end of the game when the two persons play optimally.\n\nSolve T test cases for each input file.\n\nConstraints\n\n1 \\leq T \\leq 100\n\n1 \\leq N \\leq 200\n\n1 \\leq A_i \\leq 10^{18}\n\nS is a string of length N consisting of 0 and 1.\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format.\nThe first line is as follows:\n\nT\n\nThen, T test cases follow.\nEach test case is given in the following format:\n\nN\nA_1 A_2 \\cdots A_N\nS\n\nOutput\n\nFor each test case, print a line containing 0 if x becomes 0 at the end of the game, and 1 otherwise.\n\nSample Input 1\n\n3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000\n\nSample Output 1\n\n1\n0\n0\n\nIn the first test case, if Person 1 replaces x with 0 \\oplus 1=1, we surely have x \\neq 0 at the end of the game, regardless of the choice of Person 0.\n\nIn the second test case, regardless of the choice of Person 1, Person 0 can make x=0 with a suitable choice.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 101, "cpu_time_ms": 564, "memory_kb": 12636}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s171605200", "group_id": "codeNet:p02651", "input_text": "<>;@_=!print$/,1-!grep{$%=pop@A;$%-=$-=$%-($_^$%)for@_;$_?$%:!push@_,$%}reverse<>=~/./g while<>,@A=glob<>", "language": "Perl", "metadata": {"date": 1591592571, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02651.html", "problem_id": "p02651", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02651/input.txt", "sample_output_relpath": "derived/input_output/data/p02651/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02651/Perl/s171605200.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s171605200", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n0\n0\n", "input_to_evaluate": "<>;@_=!print$/,1-!grep{$%=pop@A;$%-=$-=$%-($_^$%)for@_;$_?$%:!push@_,$%}reverse<>=~/./g while<>,@A=glob<>", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are two persons, numbered 0 and 1, and a variable x whose initial value is 0.\nThe two persons now play a game.\nThe game is played in N rounds. The following should be done in the i-th round (1 \\leq i \\leq N):\n\nPerson S_i does one of the following:\n\nReplace x with x \\oplus A_i, where \\oplus represents bitwise XOR.\n\nDo nothing.\n\nPerson 0 aims to have x=0 at the end of the game, while Person 1 aims to have x \\neq 0 at the end of the game.\n\nDetermine whether x becomes 0 at the end of the game when the two persons play optimally.\n\nSolve T test cases for each input file.\n\nConstraints\n\n1 \\leq T \\leq 100\n\n1 \\leq N \\leq 200\n\n1 \\leq A_i \\leq 10^{18}\n\nS is a string of length N consisting of 0 and 1.\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format.\nThe first line is as follows:\n\nT\n\nThen, T test cases follow.\nEach test case is given in the following format:\n\nN\nA_1 A_2 \\cdots A_N\nS\n\nOutput\n\nFor each test case, print a line containing 0 if x becomes 0 at the end of the game, and 1 otherwise.\n\nSample Input 1\n\n3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000\n\nSample Output 1\n\n1\n0\n0\n\nIn the first test case, if Person 1 replaces x with 0 \\oplus 1=1, we surely have x \\neq 0 at the end of the game, regardless of the choice of Person 0.\n\nIn the second test case, regardless of the choice of Person 1, Person 0 can make x=0 with a suitable choice.", "sample_input": "3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000\n"}, "reference_outputs": ["1\n0\n0\n"], "source_document_id": "p02651", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are two persons, numbered 0 and 1, and a variable x whose initial value is 0.\nThe two persons now play a game.\nThe game is played in N rounds. The following should be done in the i-th round (1 \\leq i \\leq N):\n\nPerson S_i does one of the following:\n\nReplace x with x \\oplus A_i, where \\oplus represents bitwise XOR.\n\nDo nothing.\n\nPerson 0 aims to have x=0 at the end of the game, while Person 1 aims to have x \\neq 0 at the end of the game.\n\nDetermine whether x becomes 0 at the end of the game when the two persons play optimally.\n\nSolve T test cases for each input file.\n\nConstraints\n\n1 \\leq T \\leq 100\n\n1 \\leq N \\leq 200\n\n1 \\leq A_i \\leq 10^{18}\n\nS is a string of length N consisting of 0 and 1.\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format.\nThe first line is as follows:\n\nT\n\nThen, T test cases follow.\nEach test case is given in the following format:\n\nN\nA_1 A_2 \\cdots A_N\nS\n\nOutput\n\nFor each test case, print a line containing 0 if x becomes 0 at the end of the game, and 1 otherwise.\n\nSample Input 1\n\n3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000\n\nSample Output 1\n\n1\n0\n0\n\nIn the first test case, if Person 1 replaces x with 0 \\oplus 1=1, we surely have x \\neq 0 at the end of the game, regardless of the choice of Person 0.\n\nIn the second test case, regardless of the choice of Person 1, Person 0 can make x=0 with a suitable choice.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 105, "cpu_time_ms": 424, "memory_kb": 12640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s013082714", "group_id": "codeNet:p02657", "input_text": "say [*] words", "language": "Perl", "metadata": {"date": 1591128474, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02657.html", "problem_id": "p02657", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02657/input.txt", "sample_output_relpath": "derived/input_output/data/p02657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02657/Perl/s013082714.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s013082714", "user_id": "u657913472"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "say [*] words", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\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\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\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\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 13, "cpu_time_ms": 175, "memory_kb": 82336}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s217134767", "group_id": "codeNet:p02657", "input_text": "#!/usr/bin/perl\n\nmy ($x,$y) = map { $_ - 0 } split(/\\s+/,);\nprint (($x * $y) . \"\\n\");\n", "language": "Perl", "metadata": {"date": 1591066962, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02657.html", "problem_id": "p02657", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02657/input.txt", "sample_output_relpath": "derived/input_output/data/p02657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02657/Perl/s217134767.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s217134767", "user_id": "u750383873"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($x,$y) = map { $_ - 0 } split(/\\s+/,);\nprint (($x * $y) . \"\\n\");\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\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\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\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\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 4832}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s368881190", "group_id": "codeNet:p02660", "input_text": "use strict;\nuse warnings;\n\nchomp (my $n = <>);\nprint &div($n, 2) , \"\\n\";\n\nsub div {\n my $num = shift;\n my $min = shift;\n $min++;\n \n if ($min > $num) { return 0 }\n \n for my $i ( $min .. $num ){\n \tif ($num % $i == 0) {\n return 1 + div( $num/$i, $i ) ;\n }\n }\n}", "language": "Perl", "metadata": {"date": 1592015240, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02660.html", "problem_id": "p02660", "resource_group": "low_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/Perl/s368881190.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s368881190", "user_id": "u783415940"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nchomp (my $n = <>);\nprint &div($n, 2) , \"\\n\";\n\nsub div {\n my $num = shift;\n my $min = shift;\n $min++;\n \n if ($min > $num) { return 0 }\n \n for my $i ( $min .. $num ){\n \tif ($num % $i == 0) {\n return 1 + div( $num/$i, $i ) ;\n }\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2205, "memory_kb": 5176}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s757728058", "group_id": "codeNet:p02663", "input_text": "use strict;\nuse warnings;\n\nmy ($h1, $m1, $h2, $m2, $d) = split /\\s/, ;\n\nmy $hour_min = ($h2 - $h1) * 60;\nmy $min = $m2 - $m1;\nmy $total_min = $hour_min + $min;\nmy $valid_time_len = $total_min - $d;\nprint $valid_time_len, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1591233251, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02663.html", "problem_id": "p02663", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02663/input.txt", "sample_output_relpath": "derived/input_output/data/p02663/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02663/Perl/s757728058.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s757728058", "user_id": "u662377073"}, "prompt_components": {"gold_output": "270\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy ($h1, $m1, $h2, $m2, $d) = split /\\s/, ;\n\nmy $hour_min = ($h2 - $h1) * 60;\nmy $min = $m2 - $m1;\nmy $total_min = $hour_min + $min;\nmy $valid_time_len = $total_min - $d;\nprint $valid_time_len, \"\\n\";\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn this problem, we use the 24-hour clock.\n\nTakahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.)\nHe has decided to study for K consecutive minutes while he is up.\nWhat is the length of the period in which he can start studying?\n\nConstraints\n\n0 \\le H_1, H_2 \\le 23\n\n0 \\le M_1, M_2 \\le 59\n\nThe time H_1 : M_1 comes before the time H_2 : M_2.\n\nK \\ge 1\n\nTakahashi is up for at least K minutes.\n\nAll values in input are integers (without leading zeros).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH_1 M_1 H_2 M_2 K\n\nOutput\n\nPrint the length of the period in which he can start studying, as an integer.\n\nSample Input 1\n\n10 0 15 0 30\n\nSample Output 1\n\n270\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly three in the afternoon.\nIt takes 30 minutes to do the study, so he can start it in the period between ten o'clock and half-past two. The length of this period is 270 minutes, so we should print 270.\n\nSample Input 2\n\n10 0 12 0 120\n\nSample Output 2\n\n0\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly noon. It takes 120 minutes to do the study, so he has to start it at exactly ten o'clock. Thus, we should print 0.", "sample_input": "10 0 15 0 30\n"}, "reference_outputs": ["270\n"], "source_document_id": "p02663", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn this problem, we use the 24-hour clock.\n\nTakahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.)\nHe has decided to study for K consecutive minutes while he is up.\nWhat is the length of the period in which he can start studying?\n\nConstraints\n\n0 \\le H_1, H_2 \\le 23\n\n0 \\le M_1, M_2 \\le 59\n\nThe time H_1 : M_1 comes before the time H_2 : M_2.\n\nK \\ge 1\n\nTakahashi is up for at least K minutes.\n\nAll values in input are integers (without leading zeros).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH_1 M_1 H_2 M_2 K\n\nOutput\n\nPrint the length of the period in which he can start studying, as an integer.\n\nSample Input 1\n\n10 0 15 0 30\n\nSample Output 1\n\n270\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly three in the afternoon.\nIt takes 30 minutes to do the study, so he can start it in the period between ten o'clock and half-past two. The length of this period is 270 minutes, so we should print 270.\n\nSample Input 2\n\n10 0 12 0 120\n\nSample Output 2\n\n0\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly noon. It takes 120 minutes to do the study, so he has to start it at exactly ten o'clock. Thus, we should print 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 12, "memory_kb": 5088}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s622011045", "group_id": "codeNet:p02664", "input_text": "use strict;\nuse warnings;\nuse feature 'say';\nuse Data::Dumper;\n\nchomp(my $str = );\n\nmy @rep = qw(P D);\nmy $max_index_cnt = 0;\nmy $target_str = '';\nfor my $rep (@rep) {\n my $target = '';\n ($target = $str) =~ s/\\?/$rep/g;\n\n my $before = length($target);\n my $total_pd_cnt = 0;\n for my $rep ( qw/ D PD / ) {\n\n my $occurrence_cnt = (() = $target =~ m/$rep/g);\n $total_pd_cnt += $occurrence_cnt;\n }\n\n if( $total_pd_cnt > $max_index_cnt) {\n $max_index_cnt = $total_pd_cnt;\n $target_str = $target;\n }\n}\nprint $target_str,\"\\n\";\n", "language": "Perl", "metadata": {"date": 1591235859, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02664.html", "problem_id": "p02664", "resource_group": "low_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/Perl/s622011045.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s622011045", "user_id": "u662377073"}, "prompt_components": {"gold_output": "PDPDPDP\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse feature 'say';\nuse Data::Dumper;\n\nchomp(my $str = );\n\nmy @rep = qw(P D);\nmy $max_index_cnt = 0;\nmy $target_str = '';\nfor my $rep (@rep) {\n my $target = '';\n ($target = $str) =~ s/\\?/$rep/g;\n\n my $before = length($target);\n my $total_pd_cnt = 0;\n for my $rep ( qw/ D PD / ) {\n\n my $occurrence_cnt = (() = $target =~ m/$rep/g);\n $total_pd_cnt += $occurrence_cnt;\n }\n\n if( $total_pd_cnt > $max_index_cnt) {\n $max_index_cnt = $total_pd_cnt;\n $target_str = $target;\n }\n}\nprint $target_str,\"\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 90, "memory_kb": 23860}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s912430444", "group_id": "codeNet:p02665", "input_text": "my @arr = ;\n@arr = map { chomp; [ split(/\\s+/, $_) ] } @arr;\nprint main(@arr);\n\nsub main {\n my ($n) = shift->@*;\n my (@arr) = shift->@*;\n my @arr2 = @arr;\n for my $i (0..$n) {\n $arr[$i] = $arr[$i]/(2**$i);\n }\n my $sum = 0;\n $sum += $_ for map { $_ } @arr;\n return -1 if $sum != 1;\n $sum = 0;\n for my $i (reverse 1..$n) {\n $sum += $arr2[$i];\n $arr2[$i-1] += $arr2[$i]/2;\n }\n return $sum + 1;\n}", "language": "Perl", "metadata": {"date": 1590893006, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02665.html", "problem_id": "p02665", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02665/input.txt", "sample_output_relpath": "derived/input_output/data/p02665/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02665/Perl/s912430444.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s912430444", "user_id": "u260747134"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "my @arr = ;\n@arr = map { chomp; [ split(/\\s+/, $_) ] } @arr;\nprint main(@arr);\n\nsub main {\n my ($n) = shift->@*;\n my (@arr) = shift->@*;\n my @arr2 = @arr;\n for my $i (0..$n) {\n $arr[$i] = $arr[$i]/(2**$i);\n }\n my $sum = 0;\n $sum += $_ for map { $_ } @arr;\n return -1 if $sum != 1;\n $sum = 0;\n for my $i (reverse 1..$n) {\n $sum += $arr2[$i];\n $arr2[$i-1] += $arr2[$i]/2;\n }\n return $sum + 1;\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "sample_input": "3\n0 1 1 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02665", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 452, "cpu_time_ms": 120, "memory_kb": 32608}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s774437154", "group_id": "codeNet:p02675", "input_text": "$_=<>;\nchomp;\nmy $r=$_%10;\n@tbl=('pon','pon','hon','bon','hon','hon','pon','hon','pon','hon');\nprint $tbl[$r].\"\\n\";\n", "language": "Perl", "metadata": {"date": 1589763922, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02675.html", "problem_id": "p02675", "resource_group": "low_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/Perl/s774437154.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s774437154", "user_id": "u222602662"}, "prompt_components": {"gold_output": "pon\n", "input_to_evaluate": "$_=<>;\nchomp;\nmy $r=$_%10;\n@tbl=('pon','pon','hon','bon','hon','hon','pon','hon','pon','hon');\nprint $tbl[$r].\"\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 4748}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s410781708", "group_id": "codeNet:p02676", "input_text": "$k=<>;\n$s=<>;\nif(length($s)-1>$k){\n\tprint substr($s,0,$k).\"...\"\n}else{\n\tprint $s\n}", "language": "Perl", "metadata": {"date": 1600004304, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "low_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/Perl/s410781708.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s410781708", "user_id": "u172873334"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "$k=<>;\n$s=<>;\nif(length($s)-1>$k){\n\tprint substr($s,0,$k).\"...\"\n}else{\n\tprint $s\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 4636}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s974848854", "group_id": "codeNet:p02676", "input_text": "my @arr = ;\n@arr = map { chomp; [ split(/\\s+/, $_) ] } @arr;\nprint main(@arr);\n\nsub main {\n my ($ln) = shift->@*;\n my ($str) = shift->@*;\n my $sfx = length($str) <= $ln ? '...' : '';\n $str = substr($str, 0, $ln);\n return \"$str$sfx\"\n}", "language": "Perl", "metadata": {"date": 1589764471, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "low_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/Perl/s974848854.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s974848854", "user_id": "u260747134"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "my @arr = ;\n@arr = map { chomp; [ split(/\\s+/, $_) ] } @arr;\nprint main(@arr);\n\nsub main {\n my ($ln) = shift->@*;\n my ($str) = shift->@*;\n my $sfx = length($str) <= $ln ? '...' : '';\n $str = substr($str, 0, $ln);\n return \"$str$sfx\"\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 4820}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s074246316", "group_id": "codeNet:p02676", "input_text": "chomp($k = <>);\nchomp($s = <>);\n\nif(length($s) <= $k){\n\tprint \"$s\\n\";\n}else{\n\tprint substr($s, 0, $k) . \"...\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1589764116, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "low_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/Perl/s074246316.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s074246316", "user_id": "u609426052"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "chomp($k = <>);\nchomp($s = <>);\n\nif(length($s) <= $k){\n\tprint \"$s\\n\";\n}else{\n\tprint substr($s, 0, $k) . \"...\\n\";\n}\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 115, "cpu_time_ms": 8, "memory_kb": 4700}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s884356739", "group_id": "codeNet:p02677", "input_text": "$/=words;say abs $0-$1*cis pi*($2-$3*11/60)/6", "language": "Perl", "metadata": {"date": 1590817064, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02677.html", "problem_id": "p02677", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02677/input.txt", "sample_output_relpath": "derived/input_output/data/p02677/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02677/Perl/s884356739.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s884356739", "user_id": "u032223772"}, "prompt_components": {"gold_output": "5.00000000000000000000\n", "input_to_evaluate": "$/=words;say abs $0-$1*cis pi*($2-$3*11/60)/6", "problem_context": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "sample_input": "3 4 9 0\n"}, "reference_outputs": ["5.00000000000000000000\n"], "source_document_id": "p02677", "source_text": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 182, "memory_kb": 84796}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s711668593", "group_id": "codeNet:p02678", "input_text": "<>;$d[@Q=1]=Yes;map{push@$_,$_[--$|]for@_=glob}<>;//,map{$d[$_]//=$'+!push@Q,$_}@$_ for@Q;print\"@d\"", "language": "Perl", "metadata": {"date": 1589773805, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02678.html", "problem_id": "p02678", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02678/input.txt", "sample_output_relpath": "derived/input_output/data/p02678/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02678/Perl/s711668593.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s711668593", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n1\n2\n2\n", "input_to_evaluate": "<>;$d[@Q=1]=Yes;map{push@$_,$_[--$|]for@_=glob}<>;//,map{$d[$_]//=$'+!push@Q,$_}@$_ for@Q;print\"@d\"", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\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\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "sample_input": "4 4\n1 2\n2 3\n3 4\n4 2\n"}, "reference_outputs": ["Yes\n1\n2\n2\n"], "source_document_id": "p02678", "source_text": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\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\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1442, "memory_kb": 137680}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s876256071", "group_id": "codeNet:p02679", "input_text": "$M=1e9+7;\n$O=-1;\n<>;\nfor(<>){\n\t($a,$b)=split$\";\n\tif($a==0&&$b==0)\n\t{\n\t\t$O++;\n\t}\n\telse\n\t{\n\t\t($ga,$gb)=($a,$b);\n\t\t($ga,$gb)=($gb,$ga%$gb)while$gb!=0;\n\t\t$a/=$ga;$b/=$ga;\n\t\t($a,$b)=(-$a,-$b)if$a<0||$a==0&&$b>0;\n\t\t$f=0;\n\t\t($a,$b,$f)=(-$b,$a,1)if$b<0;\n\t\t$_{\"$a $b\"}[$f]=($_{\"$a $b\"}[$f]//1)*2%$M;\n\t}\n}\n$s=1;\n$s=$s*(($_{$_}[0]//1)+($_{$_}[1]//1)-1)%$M for keys%_;\nprint+($s+$O)%$M,$/;", "language": "Perl", "metadata": {"date": 1589840589, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02679.html", "problem_id": "p02679", "resource_group": "low_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/Perl/s876256071.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s876256071", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "$M=1e9+7;\n$O=-1;\n<>;\nfor(<>){\n\t($a,$b)=split$\";\n\tif($a==0&&$b==0)\n\t{\n\t\t$O++;\n\t}\n\telse\n\t{\n\t\t($ga,$gb)=($a,$b);\n\t\t($ga,$gb)=($gb,$ga%$gb)while$gb!=0;\n\t\t$a/=$ga;$b/=$ga;\n\t\t($a,$b)=(-$a,-$b)if$a<0||$a==0&&$b>0;\n\t\t$f=0;\n\t\t($a,$b,$f)=(-$b,$a,1)if$b<0;\n\t\t$_{\"$a $b\"}[$f]=($_{\"$a $b\"}[$f]//1)*2%$M;\n\t}\n}\n$s=1;\n$s=$s*(($_{$_}[0]//1)+($_{$_}[1]//1)-1)%$M for keys%_;\nprint+($s+$O)%$M,$/;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 377, "cpu_time_ms": 1551, "memory_kb": 83036}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s406852807", "group_id": "codeNet:p02681", "input_text": "#!/usr/bin/perl\n\nmy $s = scalar();\n$s =~ s/[\\x00-\\x20]+$//ios;\nmy $t = scalar();\n$t =~ s/[\\x00-\\x20]+$//ios;\n\nif( $s eq substr($t,0,length($s)) and length($t) == length($s) + 1 and substr($t,length($s),1) =~ /[a-z]/os ){\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\n}\n\n", "language": "Perl", "metadata": {"date": 1589158964, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "low_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/Perl/s406852807.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s406852807", "user_id": "u750383873"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy $s = scalar();\n$s =~ s/[\\x00-\\x20]+$//ios;\nmy $t = scalar();\n$t =~ s/[\\x00-\\x20]+$//ios;\n\nif( $s eq substr($t,0,length($s)) and length($t) == length($s) + 1 and substr($t,length($s),1) =~ /[a-z]/os ){\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\n}\n\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 280, "cpu_time_ms": 6, "memory_kb": 4812}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s910487661", "group_id": "codeNet:p02681", "input_text": "my ($s) = split(/\\s+/, <>);\nmy ($t) = split(/\\s+/, <>);\n\nif (length($s)==length($t)-1 && $t =~ /^$s/) {\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1589158956, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "low_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/Perl/s910487661.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s910487661", "user_id": "u996239623"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my ($s) = split(/\\s+/, <>);\nmy ($t) = split(/\\s+/, <>);\n\nif (length($s)==length($t)-1 && $t =~ /^$s/) {\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 4856}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s772361529", "group_id": "codeNet:p02682", "input_text": "use List::Util qw(max min sum);\n\nmy ($a,$b,$c,$k) = split(/\\s+/, <>);\n\nmy $ans = min($k,$a);\n$k-=$ans;\n\nif ($k>0) {\n $k-=$b;\n if ($k>0) {\n\t$ans -= min($k,$c);\n }\n}\nprint $ans, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1589159205, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "low_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/Perl/s772361529.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s772361529", "user_id": "u996239623"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use List::Util qw(max min sum);\n\nmy ($a,$b,$c,$k) = split(/\\s+/, <>);\n\nmy $ans = min($k,$a);\n$k-=$ans;\n\nif ($k>0) {\n $k-=$b;\n if ($k>0) {\n\t$ans -= min($k,$c);\n }\n}\nprint $ans, \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 14, "memory_kb": 5440}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s486776715", "group_id": "codeNet:p02683", "input_text": "my $input = ;\nchomp $input;\nmy ($Nsatsu, $Mko, $Xdo) = split /\\s+/, $input;\nmy @books;\nwhile () {\n chomp;\n last unless $_;\n push @books, [split(/\\s+/, $_)];\n}\nmy $lastidx = @{$books[0]} - 1;\nunless (mitasu(@books)) {\n print '-1';\n goto END_OF_CODE;\n}\nmy @arr = 0..(@books - 1);\nmy @prod = prodset(([0, 1]) x @books);\nmy @prices;\nfor my $set (@prod) {\n my @_arr = grep { $set->[$_] } @arr;\n if (mitasu(@books[@_arr])) {\n my $sum = 0;\n $sum += $_ for (map { $_->[0] } @books[@_arr]);\n push @prices, $sum;\n }\n}\n@prices = sort { $a <=> $b } @prices;\nprint $prices[0];\n\nsub prodset {\n my @sets = @_;\n my @tpls = ([]);\n while ( $#sets + 1 ) {\n my $ref = shift @sets;\n my @rslt = ();\n foreach my $oldtpl (@tpls) {\n foreach my $newelm (@$ref) {\n push(@rslt, [@$oldtpl, $newelm]);\n }\n }\n @tpls = @rslt;\n }\n return @tpls;\n}\nsub mitasu {\n my @_books = @_;\n for my $i (1..$lastidx) {\n my $sum = 0;\n $sum += $_ for (map { $_->[$i] } @_books);\n return ($sum < $Xdo) ? '' : 1;\n }\n}\nEND_OF_CODE: 1;\n", "language": "Perl", "metadata": {"date": 1589162261, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02683.html", "problem_id": "p02683", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02683/input.txt", "sample_output_relpath": "derived/input_output/data/p02683/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02683/Perl/s486776715.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s486776715", "user_id": "u260747134"}, "prompt_components": {"gold_output": "120\n", "input_to_evaluate": "my $input = ;\nchomp $input;\nmy ($Nsatsu, $Mko, $Xdo) = split /\\s+/, $input;\nmy @books;\nwhile () {\n chomp;\n last unless $_;\n push @books, [split(/\\s+/, $_)];\n}\nmy $lastidx = @{$books[0]} - 1;\nunless (mitasu(@books)) {\n print '-1';\n goto END_OF_CODE;\n}\nmy @arr = 0..(@books - 1);\nmy @prod = prodset(([0, 1]) x @books);\nmy @prices;\nfor my $set (@prod) {\n my @_arr = grep { $set->[$_] } @arr;\n if (mitasu(@books[@_arr])) {\n my $sum = 0;\n $sum += $_ for (map { $_->[0] } @books[@_arr]);\n push @prices, $sum;\n }\n}\n@prices = sort { $a <=> $b } @prices;\nprint $prices[0];\n\nsub prodset {\n my @sets = @_;\n my @tpls = ([]);\n while ( $#sets + 1 ) {\n my $ref = shift @sets;\n my @rslt = ();\n foreach my $oldtpl (@tpls) {\n foreach my $newelm (@$ref) {\n push(@rslt, [@$oldtpl, $newelm]);\n }\n }\n @tpls = @rslt;\n }\n return @tpls;\n}\nsub mitasu {\n my @_books = @_;\n for my $i (1..$lastidx) {\n my $sum = 0;\n $sum += $_ for (map { $_->[$i] } @_books);\n return ($sum < $Xdo) ? '' : 1;\n }\n}\nEND_OF_CODE: 1;\n", "problem_context": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "sample_input": "3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n"}, "reference_outputs": ["120\n"], "source_document_id": "p02683", "source_text": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1159, "cpu_time_ms": 40, "memory_kb": 8132}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s141689044", "group_id": "codeNet:p02686", "input_text": "my $s = <>;\nchomp $s;\nmy @PDB;\nmy @MDB;\nmy $state =0;\nmy $mstate =0;\nmy $pmmax =0;\nmy $pmmin =0;\nmy $sum=0;\nfor(my $i=0;$i<$s;$i++){\n my $line = <>;chomp $line;\n my @dat = split(//,$line);\n #print \"@dat\\n\";\n my $min=0;\n my $max=0;\n my $total=0;\n for(my $j=0;$j<=$#dat;$j++){\n #print \"$dat[$j]\\n\";\n if($dat[$j] eq '(' ){\n #print \"plus \\n\";\n $total++;\n }else{\n $total--;\n }\n if($min >$total ){ $min =$total;}\n if($max <$total ){ $max =$total;}\n }\n $max = $max - $total;\n #print \"$total $min\\n\";\n $sum = $sum + $total;\n if($total ==0){\n if($pmmin > $min){$pmmin = $min;}\n }elsif($total >0){\n if( $min >=0 ){#-にならないならここで足してしまう\n $state = $state + $total;\n next;\n }\n my @row = ($total,$min);\n push (@PDB,\\@row);\n }else{\n $min = $min - $total;#左からみた最小\n if( $min >=0){\n $mstate = $mstate + $total;\n #print\"$min $mstate\\n\";\n next;\n }\n my @row = ($total,$min);\n push (@MDB,\\@row);\n }\n #print \"$sum $total \\n\";\n}\n#print \"$state $mstate \\n\";\n\n@PDB = sort{ $b->[1] <=> $a->[1]} @PDB;\n#my @amari;\nfor(my $i=0;$i<=$#PDB;$i++){\n if(($state+$PDB[$i][1]) >= 0){#採用\n $state = $state + $PDB[$i][0];\n #print \"@{$PDB[$i]} state $state \\n \";\n }else{\n print \"No\";exit;\n }\n}\n#print \"$state $pmmin \\n\";\nif( ($state+$pmmin) < 0){ print \"No\";exit;}\n#print \"MDB $#MDB\\n\";\n\n@MDB = sort{ $b->[1] <=> $a->[1]} @MDB;\nfor(my $i=0;$i<=$#MDB;$i++){\n if((-$mstate+$MDB[$i][1]) >= 0){#採用\n $mstate = $mstate + $MDB[$i][0];\n #print \"@{$MDB[$i]} mstate $mstate \\n \";\n }else{\n print \"No\";exit;\n }\n}\n$state = $state + $mstate;\n\nif( $state == 0){\n print \"Yes\";\n}else{\n print \"No\";\n}\n", "language": "Perl", "metadata": {"date": 1589517519, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02686.html", "problem_id": "p02686", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02686/input.txt", "sample_output_relpath": "derived/input_output/data/p02686/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02686/Perl/s141689044.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s141689044", "user_id": "u464700044"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $s = <>;\nchomp $s;\nmy @PDB;\nmy @MDB;\nmy $state =0;\nmy $mstate =0;\nmy $pmmax =0;\nmy $pmmin =0;\nmy $sum=0;\nfor(my $i=0;$i<$s;$i++){\n my $line = <>;chomp $line;\n my @dat = split(//,$line);\n #print \"@dat\\n\";\n my $min=0;\n my $max=0;\n my $total=0;\n for(my $j=0;$j<=$#dat;$j++){\n #print \"$dat[$j]\\n\";\n if($dat[$j] eq '(' ){\n #print \"plus \\n\";\n $total++;\n }else{\n $total--;\n }\n if($min >$total ){ $min =$total;}\n if($max <$total ){ $max =$total;}\n }\n $max = $max - $total;\n #print \"$total $min\\n\";\n $sum = $sum + $total;\n if($total ==0){\n if($pmmin > $min){$pmmin = $min;}\n }elsif($total >0){\n if( $min >=0 ){#-にならないならここで足してしまう\n $state = $state + $total;\n next;\n }\n my @row = ($total,$min);\n push (@PDB,\\@row);\n }else{\n $min = $min - $total;#左からみた最小\n if( $min >=0){\n $mstate = $mstate + $total;\n #print\"$min $mstate\\n\";\n next;\n }\n my @row = ($total,$min);\n push (@MDB,\\@row);\n }\n #print \"$sum $total \\n\";\n}\n#print \"$state $mstate \\n\";\n\n@PDB = sort{ $b->[1] <=> $a->[1]} @PDB;\n#my @amari;\nfor(my $i=0;$i<=$#PDB;$i++){\n if(($state+$PDB[$i][1]) >= 0){#採用\n $state = $state + $PDB[$i][0];\n #print \"@{$PDB[$i]} state $state \\n \";\n }else{\n print \"No\";exit;\n }\n}\n#print \"$state $pmmin \\n\";\nif( ($state+$pmmin) < 0){ print \"No\";exit;}\n#print \"MDB $#MDB\\n\";\n\n@MDB = sort{ $b->[1] <=> $a->[1]} @MDB;\nfor(my $i=0;$i<=$#MDB;$i++){\n if((-$mstate+$MDB[$i][1]) >= 0){#採用\n $mstate = $mstate + $MDB[$i][0];\n #print \"@{$MDB[$i]} mstate $mstate \\n \";\n }else{\n print \"No\";exit;\n }\n}\n$state = $state + $mstate;\n\nif( $state == 0){\n print \"Yes\";\n}else{\n print \"No\";\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "sample_input": "2\n)\n(()\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02686", "source_text": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1813, "cpu_time_ms": 740, "memory_kb": 12988}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s557618527", "group_id": "codeNet:p02686", "input_text": "my $s = <>;\nchomp $s;\nmy @PDB;\nmy @MDB;\n#my $sum=0;\nmy $state =0;\nfor(my $i=0;$i<$s;$i++){\n my $line = <>;chomp $line;\n my @dat = split(//,$line);\n #print \"@dat\\n\";\n my $min=0;\n my $total=0;\n for(my $j=0;$j<=$#dat;$j++){\n #print \"$dat[$j]\\n\";\n if($dat[$j] eq '(' ){\n #print \"plus \\n\";\n $total++;\n }else{\n $total--;\n }\n if($min >$total ){ $min =$total;}\n }\n if( $min >=0 ){#-にならないならここで足してしまう\n $state = $state + $total;\n next;\n }\n my @row = ($total,$min);\n if( $total >=0){\n push (@PDB,\\@row);\n }else{\n push (@MDB,\\@row);\n }\n #print \"$total $min \\n\";\n #$sum = $sum +$total;\n}\nif($state ==0){ print \"No\";exit;}\n@PDB = sort{ $a->[1] <=> $b->[1]} @PDB;\n#my @amari;\n\nfor(my $i=0;$i<=$#PDB;$i++){\n if(($state+$PDB[$i][1]) >= 0){#採用\n $state = $state + $PDB[$i][0];\n #print \"@{$PDB[$i]} state $state \\n \";\n }else{\n print \"No\";exit;\n }\n}\n@MDB = sort{ $a->[1] <=> $b->[1]} @MDB;\n\nfor(my $i=0;$i<=$#MDB;$i++){\n if(($state+$MDB[$i][1]) >= 0){#採用\n $state = $state + $MDB[$i][0];\n #print \"@{$MDB[$i]} state $state \\n \";\n }else{\n print \"No\";exit;\n }\n}\n\nif( $state == 0){\n print \"Yes\";\n}else{\n print \"No\";\n}", "language": "Perl", "metadata": {"date": 1589459631, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02686.html", "problem_id": "p02686", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02686/input.txt", "sample_output_relpath": "derived/input_output/data/p02686/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02686/Perl/s557618527.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s557618527", "user_id": "u464700044"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $s = <>;\nchomp $s;\nmy @PDB;\nmy @MDB;\n#my $sum=0;\nmy $state =0;\nfor(my $i=0;$i<$s;$i++){\n my $line = <>;chomp $line;\n my @dat = split(//,$line);\n #print \"@dat\\n\";\n my $min=0;\n my $total=0;\n for(my $j=0;$j<=$#dat;$j++){\n #print \"$dat[$j]\\n\";\n if($dat[$j] eq '(' ){\n #print \"plus \\n\";\n $total++;\n }else{\n $total--;\n }\n if($min >$total ){ $min =$total;}\n }\n if( $min >=0 ){#-にならないならここで足してしまう\n $state = $state + $total;\n next;\n }\n my @row = ($total,$min);\n if( $total >=0){\n push (@PDB,\\@row);\n }else{\n push (@MDB,\\@row);\n }\n #print \"$total $min \\n\";\n #$sum = $sum +$total;\n}\nif($state ==0){ print \"No\";exit;}\n@PDB = sort{ $a->[1] <=> $b->[1]} @PDB;\n#my @amari;\n\nfor(my $i=0;$i<=$#PDB;$i++){\n if(($state+$PDB[$i][1]) >= 0){#採用\n $state = $state + $PDB[$i][0];\n #print \"@{$PDB[$i]} state $state \\n \";\n }else{\n print \"No\";exit;\n }\n}\n@MDB = sort{ $a->[1] <=> $b->[1]} @MDB;\n\nfor(my $i=0;$i<=$#MDB;$i++){\n if(($state+$MDB[$i][1]) >= 0){#採用\n $state = $state + $MDB[$i][0];\n #print \"@{$MDB[$i]} state $state \\n \";\n }else{\n print \"No\";exit;\n }\n}\n\nif( $state == 0){\n print \"Yes\";\n}else{\n print \"No\";\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "sample_input": "2\n)\n(()\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02686", "source_text": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1279, "cpu_time_ms": 950, "memory_kb": 103208}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s912973850", "group_id": "codeNet:p02688", "input_text": "$\\=<>;$\\-=grep!++$#$_,glob<>while<>;print", "language": "Perl", "metadata": {"date": 1588556860, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02688.html", "problem_id": "p02688", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02688/input.txt", "sample_output_relpath": "derived/input_output/data/p02688/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02688/Perl/s912973850.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s912973850", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$\\=<>;$\\-=grep!++$#$_,glob<>while<>;print", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "sample_input": "3 2\n2\n1 3\n1\n3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02688", "source_text": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 41, "cpu_time_ms": 23, "memory_kb": 5488}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s237042874", "group_id": "codeNet:p02688", "input_text": "$\\=<>;map$\\-=!++$#$_,glob<>while<>;print", "language": "Perl", "metadata": {"date": 1588554439, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02688.html", "problem_id": "p02688", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02688/input.txt", "sample_output_relpath": "derived/input_output/data/p02688/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02688/Perl/s237042874.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s237042874", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$\\=<>;map$\\-=!++$#$_,glob<>while<>;print", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "sample_input": "3 2\n2\n1 3\n1\n3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02688", "source_text": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 40, "cpu_time_ms": 23, "memory_kb": 5464}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s075845053", "group_id": "codeNet:p02689", "input_text": "print<>-map{map{$#$_*=$H[$_-1]>$H[$_[--$|]-1]for@_=glob}<>;@++$i}@H=glob<>", "language": "Perl", "metadata": {"date": 1588562885, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "low_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/Perl/s075845053.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s075845053", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print<>-map{map{$#$_*=$H[$_-1]>$H[$_[--$|]-1]for@_=glob}<>;@++$i}@H=glob<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1316, "memory_kb": 202484}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s923189078", "group_id": "codeNet:p02690", "input_text": "my ($n) = split(/\\s+/, <>);\n\nfor my $a (0..$n) {\n my $a5 = $a * $a * $a * $a * $a;\n my $b;\n if ($a5-$n>0) {\n\t$b = exp(log($a5-$n)/5);\n } elsif ($a5-$n<0) {\n\t$b = -exp(log(-$a5+$n)/5);\n } else {\n\t$b = 0;\n }\n $b = int($b);\n my $b5 = $b * $b * $b * $b * $b;\n if ($a5-$b5==$n) {\n\tprint $a, \" \", $b, \"\\n\";\n\texit;\n }\n}\n", "language": "Perl", "metadata": {"date": 1588560334, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02690.html", "problem_id": "p02690", "resource_group": "low_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/Perl/s923189078.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s923189078", "user_id": "u996239623"}, "prompt_components": {"gold_output": "2 -1\n", "input_to_evaluate": "my ($n) = split(/\\s+/, <>);\n\nfor my $a (0..$n) {\n my $a5 = $a * $a * $a * $a * $a;\n my $b;\n if ($a5-$n>0) {\n\t$b = exp(log($a5-$n)/5);\n } elsif ($a5-$n<0) {\n\t$b = -exp(log(-$a5+$n)/5);\n } else {\n\t$b = 0;\n }\n $b = int($b);\n my $b5 = $b * $b * $b * $b * $b;\n if ($a5-$b5==$n) {\n\tprint $a, \" \", $b, \"\\n\";\n\texit;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 343, "cpu_time_ms": 2205, "memory_kb": 5396}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s388823812", "group_id": "codeNet:p02691", "input_text": "<>;$\\+=$_{$i-$_},$_{$_+$i++}++for glob<>;print", "language": "Perl", "metadata": {"date": 1588559927, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02691.html", "problem_id": "p02691", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02691/input.txt", "sample_output_relpath": "derived/input_output/data/p02691/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02691/Perl/s388823812.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s388823812", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;$\\+=$_{$i-$_},$_{$_+$i++}++for glob<>;print", "problem_context": "Score: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\\ (1 \\leq i \\leq N)\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\nPrint the number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "sample_input": "6\n2 3 3 1 3 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02691", "source_text": "Score: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\\ (1 \\leq i \\leq N)\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\nPrint the number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 884, "memory_kb": 143480}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s081498854", "group_id": "codeNet:p02691", "input_text": "use strict;\n\n$_ = <>;\nchomp;\nmy $n = $_;\n\n$_ = <>;\nchomp;\nmy @height = split(\" \");\n\nmy $count = 0;\nfor (my $j = 0; $j < $n - 1; $j++) {\n for (my $i = 1; $i < $n - $j; $i++) {\n\tif ($i == $height[$j + $i] + $height[$j]) {\n\t $count++;\n\t}\n }\n}\n\nprint \"$count\\n\";\n", "language": "Perl", "metadata": {"date": 1588556779, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02691.html", "problem_id": "p02691", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02691/input.txt", "sample_output_relpath": "derived/input_output/data/p02691/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02691/Perl/s081498854.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s081498854", "user_id": "u075757589"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use strict;\n\n$_ = <>;\nchomp;\nmy $n = $_;\n\n$_ = <>;\nchomp;\nmy @height = split(\" \");\n\nmy $count = 0;\nfor (my $j = 0; $j < $n - 1; $j++) {\n for (my $i = 1; $i < $n - $j; $i++) {\n\tif ($i == $height[$j + $i] + $height[$j]) {\n\t $count++;\n\t}\n }\n}\n\nprint \"$count\\n\";\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\\ (1 \\leq i \\leq N)\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\nPrint the number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "sample_input": "6\n2 3 3 1 3 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02691", "source_text": "Score: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\\ (1 \\leq i \\leq N)\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\nPrint the number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2206, "memory_kb": 26972}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s373845569", "group_id": "codeNet:p02692", "input_text": "my $s = ;\nchomp $s;\nmy ($N,$A,$B,$C) = split(/ /,$s);\n#print \"$N,$K\\n\";\nmy @data;\nfor(my $i=0;$i<$N;$i++){\n $s = ;\n chomp $s;\n $data[$i] = $s;\n}\nmy $zero = 0;\nif($A ==0){ $zero++}\nif($B ==0){ $zero++}\nif($C ==0){ $zero++}\n\nmy %data2;\n$data2{\"A\"}=$A;\n$data2{\"B\"}=$B; \n$data2{\"C\"}=$C; \n\nmy $flag = 0;\nmy $str;\n$str .= \"Yes\\n\";\n\n for(my $i=0;$i<$N;$i++){\n #print \"i$i \\n\";\n my @dat =split(//,$data[$i]);\n if( ($data2{$dat[0]}==1)&&($data2{$dat[1]}==1) ){\n my @dat2 =split(//,$data[$i+1]);\n if( $dat[0] eq $dat2[0]){\n $data2{$dat[0]}++;\n $data2{$dat[1]}--;\n $str .= \"$dat[0]\\n\";\n }elsif( $dat[0] eq $dat2[1]){\n $data2{$dat[0]}++;\n $data2{$dat[1]}--;\n $str .= \"$dat[0]\\n\";\n }else{\n $data2{$dat[0]}--;\n $data2{$dat[1]}++; \n $str .= \"$dat[1]\\n\";\n }\n }elsif( $data2{$dat[0]} >= $data2{$dat[1]} ){\n if( $data2{$dat[0]}==0){ print \"No\";exit;}\n $data2{$dat[0]}--;\n $data2{$dat[1]}++;\n $str .= \"$dat[1]\\n\";\n }else{\n $data2{$dat[0]}++;\n $data2{$dat[1]}--;\n $str .= \"$dat[0]\\n\";\n }\n }\n \nprint \"$str\";\n ", "language": "Perl", "metadata": {"date": 1588537759, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02692.html", "problem_id": "p02692", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02692/input.txt", "sample_output_relpath": "derived/input_output/data/p02692/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02692/Perl/s373845569.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s373845569", "user_id": "u464700044"}, "prompt_components": {"gold_output": "Yes\nA\nC\n", "input_to_evaluate": "my $s = ;\nchomp $s;\nmy ($N,$A,$B,$C) = split(/ /,$s);\n#print \"$N,$K\\n\";\nmy @data;\nfor(my $i=0;$i<$N;$i++){\n $s = ;\n chomp $s;\n $data[$i] = $s;\n}\nmy $zero = 0;\nif($A ==0){ $zero++}\nif($B ==0){ $zero++}\nif($C ==0){ $zero++}\n\nmy %data2;\n$data2{\"A\"}=$A;\n$data2{\"B\"}=$B; \n$data2{\"C\"}=$C; \n\nmy $flag = 0;\nmy $str;\n$str .= \"Yes\\n\";\n\n for(my $i=0;$i<$N;$i++){\n #print \"i$i \\n\";\n my @dat =split(//,$data[$i]);\n if( ($data2{$dat[0]}==1)&&($data2{$dat[1]}==1) ){\n my @dat2 =split(//,$data[$i+1]);\n if( $dat[0] eq $dat2[0]){\n $data2{$dat[0]}++;\n $data2{$dat[1]}--;\n $str .= \"$dat[0]\\n\";\n }elsif( $dat[0] eq $dat2[1]){\n $data2{$dat[0]}++;\n $data2{$dat[1]}--;\n $str .= \"$dat[0]\\n\";\n }else{\n $data2{$dat[0]}--;\n $data2{$dat[1]}++; \n $str .= \"$dat[1]\\n\";\n }\n }elsif( $data2{$dat[0]} >= $data2{$dat[1]} ){\n if( $data2{$dat[0]}==0){ print \"No\";exit;}\n $data2{$dat[0]}--;\n $data2{$dat[1]}++;\n $str .= \"$dat[1]\\n\";\n }else{\n $data2{$dat[0]}++;\n $data2{$dat[1]}--;\n $str .= \"$dat[0]\\n\";\n }\n }\n \nprint \"$str\";\n ", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a game that involves three variables, denoted A, B, and C.\n\nAs the game progresses, there will be N events where you are asked to make a choice.\nEach of these choices is represented by a string s_i. If s_i is AB, you must add 1 to A or B then subtract 1 from the other; if s_i is AC, you must add 1 to A or C then subtract 1 from the other; if s_i is BC, you must add 1 to B or C then subtract 1 from the other.\n\nAfter each choice, none of A, B, and C should be negative.\n\nDetermine whether it is possible to make N choices under this condition. If it is possible, also give one such way to make the choices.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A,B,C \\leq 10^9\n\nN, A, B, C are integers.\n\ns_i is AB, AC, or BC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf it is possible to make N choices under the condition, print Yes; otherwise, print No.\n\nAlso, in the former case, show one such way to make the choices in the subsequent N lines. The (i+1)-th line should contain the name of the variable (A, B, or C) to which you add 1 in the i-th choice.\n\nSample Input 1\n\n2 1 3 0\nAB\nAC\n\nSample Output 1\n\nYes\nA\nC\n\nYou can successfully make two choices, as follows:\n\nIn the first choice, add 1 to A and subtract 1 from B. A becomes 2, and B becomes 2.\n\nIn the second choice, add 1 to C and subtract 1 from A. C becomes 1, and A becomes 1.\n\nSample Input 2\n\n3 1 0 0\nAB\nBC\nAB\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1 0 9 0\nAC\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n8 6 9 1\nAC\nBC\nAB\nBC\nAC\nBC\nAB\nAB\n\nSample Output 4\n\nYes\nC\nB\nB\nC\nC\nB\nA\nA", "sample_input": "2 1 3 0\nAB\nAC\n"}, "reference_outputs": ["Yes\nA\nC\n"], "source_document_id": "p02692", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a game that involves three variables, denoted A, B, and C.\n\nAs the game progresses, there will be N events where you are asked to make a choice.\nEach of these choices is represented by a string s_i. If s_i is AB, you must add 1 to A or B then subtract 1 from the other; if s_i is AC, you must add 1 to A or C then subtract 1 from the other; if s_i is BC, you must add 1 to B or C then subtract 1 from the other.\n\nAfter each choice, none of A, B, and C should be negative.\n\nDetermine whether it is possible to make N choices under this condition. If it is possible, also give one such way to make the choices.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A,B,C \\leq 10^9\n\nN, A, B, C are integers.\n\ns_i is AB, AC, or BC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf it is possible to make N choices under the condition, print Yes; otherwise, print No.\n\nAlso, in the former case, show one such way to make the choices in the subsequent N lines. The (i+1)-th line should contain the name of the variable (A, B, or C) to which you add 1 in the i-th choice.\n\nSample Input 1\n\n2 1 3 0\nAB\nAC\n\nSample Output 1\n\nYes\nA\nC\n\nYou can successfully make two choices, as follows:\n\nIn the first choice, add 1 to A and subtract 1 from B. A becomes 2, and B becomes 2.\n\nIn the second choice, add 1 to C and subtract 1 from A. C becomes 1, and A becomes 1.\n\nSample Input 2\n\n3 1 0 0\nAB\nBC\nAB\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1 0 9 0\nAC\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n8 6 9 1\nAC\nBC\nAB\nBC\nAC\nBC\nAB\nAB\n\nSample Output 4\n\nYes\nC\nB\nB\nC\nC\nB\nA\nA", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1336, "cpu_time_ms": 115, "memory_kb": 13072}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s339938646", "group_id": "codeNet:p02694", "input_text": "$x=<>;\n$n=100;\nfor($i=1;$i<10**6;$i++){\n\t$n+=int($n/100);\n\tif($n>=$x){\n\t\tprint $i;\n\t\texit\n\t}\n}", "language": "Perl", "metadata": {"date": 1600005098, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02694.html", "problem_id": "p02694", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02694/input.txt", "sample_output_relpath": "derived/input_output/data/p02694/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02694/Perl/s339938646.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s339938646", "user_id": "u172873334"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$x=<>;\n$n=100;\nfor($i=1;$i<10**6;$i++){\n\t$n+=int($n/100);\n\tif($n>=$x){\n\t\tprint $i;\n\t\texit\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "sample_input": "103\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02694", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 4660}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s196624484", "group_id": "codeNet:p02695", "input_text": "use strict;\nmy $s = ;\nchomp $s;\nmy ($N,$M,$Q) = split(/ /,$s);\nmy @data;\nfor(my $i=0;$i<$Q;$i++){\n $s = ;\n chomp $s;\n my @dat = split(/ /,$s);\n $data[$i] = \\@dat;\n}\nmy @list;\nfor(my $j=0;$j<$M;$j++){\n $list[$j][0] = 0;\n}\nfor(my $j=0;$j<$M;$j++){\n $list[$j][0] = $j+1;\n}\nfor(my $i=1; $i<$N;$i++){\n my @newlist;\n for(my $j=0;$j<=$#list;$j++){\n for(my $k=0; $k<=$N;$k++){\n my @new = @{$list[$j]};\n if(($new[-1]+$k) >$M){last;}\n push (@new, $new[-1]+$k);\n push (@newlist,\\@new);\n }\n }\n @list = @newlist;\n}\nmy $max=0;\nfor(my $j=0;$j<=$#list;$j++){\n print \"TG @{$list[$j]}\\n\";\n my $point = 0;\n for(my $i=0;$i<$Q;$i++){\n my $a = $data[$i][0];\n my $b = $data[$i][1]; \n #print \"($list[$j][$b-1]-$list[$j][$a-1])==$data[$i][2] \\n\"; \n if( ($list[$j][$b-1]-$list[$j][$a-1])==$data[$i][2]){\n $point = $point + $data[$i][3];\n #print \" get $point \"\n }\n }\n #print \"pont $point\\n\";\n if($point > $max ){\n #print \"max $point\\n\";\n $max = $point;\n }\n}\nprint \"$max\\n\";", "language": "Perl", "metadata": {"date": 1588474179, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02695.html", "problem_id": "p02695", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02695/input.txt", "sample_output_relpath": "derived/input_output/data/p02695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02695/Perl/s196624484.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s196624484", "user_id": "u464700044"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "use strict;\nmy $s = ;\nchomp $s;\nmy ($N,$M,$Q) = split(/ /,$s);\nmy @data;\nfor(my $i=0;$i<$Q;$i++){\n $s = ;\n chomp $s;\n my @dat = split(/ /,$s);\n $data[$i] = \\@dat;\n}\nmy @list;\nfor(my $j=0;$j<$M;$j++){\n $list[$j][0] = 0;\n}\nfor(my $j=0;$j<$M;$j++){\n $list[$j][0] = $j+1;\n}\nfor(my $i=1; $i<$N;$i++){\n my @newlist;\n for(my $j=0;$j<=$#list;$j++){\n for(my $k=0; $k<=$N;$k++){\n my @new = @{$list[$j]};\n if(($new[-1]+$k) >$M){last;}\n push (@new, $new[-1]+$k);\n push (@newlist,\\@new);\n }\n }\n @list = @newlist;\n}\nmy $max=0;\nfor(my $j=0;$j<=$#list;$j++){\n print \"TG @{$list[$j]}\\n\";\n my $point = 0;\n for(my $i=0;$i<$Q;$i++){\n my $a = $data[$i][0];\n my $b = $data[$i][1]; \n #print \"($list[$j][$b-1]-$list[$j][$a-1])==$data[$i][2] \\n\"; \n if( ($list[$j][$b-1]-$list[$j][$a-1])==$data[$i][2]){\n $point = $point + $data[$i][3];\n #print \" get $point \"\n }\n }\n #print \"pont $point\\n\";\n if($point > $max ){\n #print \"max $point\\n\";\n $max = $point;\n }\n}\nprint \"$max\\n\";", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "sample_input": "3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n"}, "reference_outputs": ["110\n"], "source_document_id": "p02695", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1054, "cpu_time_ms": 1739, "memory_kb": 113876}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s902808905", "group_id": "codeNet:p02695", "input_text": "use List::Util qw(max min sum);\n\nmy ($n, $m, $q) = split(/\\s+/, <>);\nmy (@a, @b, @c, @d);\nfor (1..$q) {\n ($a[$_],$b[$_],$c[$_],$d[$_]) = split(/\\s+/, <>);\n}\n\nmy @x;\nfor (0..$m) { $x[$_] = 1; }\n\nsub ans {\n my $ret = 0;\n for (1..$q) {\n\tif ($x[$b[$_]]-$x[$a[$_]]==$c[$_]) {\n\t $ret += $d[$_];\n\t}\n }\n return $ret;\n}\n\nmy $max = 0;\nsub loop {\n my ($level) = @_;\n if ($level == $n) {\n\t$max = max($max, ans());\n\t#print join(\" \", @x), \" max=$max\\n\";\n\treturn;\n }\n for ($x[$level]..$m) {\n\t$x[$level+1] = $_;\n\tloop($level+1);\n }\n $x[$level+1] = $x[$level];\n}\n\nloop(0);\nprint \"$max\\n\";\n", "language": "Perl", "metadata": {"date": 1588471827, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02695.html", "problem_id": "p02695", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02695/input.txt", "sample_output_relpath": "derived/input_output/data/p02695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02695/Perl/s902808905.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s902808905", "user_id": "u996239623"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "use List::Util qw(max min sum);\n\nmy ($n, $m, $q) = split(/\\s+/, <>);\nmy (@a, @b, @c, @d);\nfor (1..$q) {\n ($a[$_],$b[$_],$c[$_],$d[$_]) = split(/\\s+/, <>);\n}\n\nmy @x;\nfor (0..$m) { $x[$_] = 1; }\n\nsub ans {\n my $ret = 0;\n for (1..$q) {\n\tif ($x[$b[$_]]-$x[$a[$_]]==$c[$_]) {\n\t $ret += $d[$_];\n\t}\n }\n return $ret;\n}\n\nmy $max = 0;\nsub loop {\n my ($level) = @_;\n if ($level == $n) {\n\t$max = max($max, ans());\n\t#print join(\" \", @x), \" max=$max\\n\";\n\treturn;\n }\n for ($x[$level]..$m) {\n\t$x[$level+1] = $_;\n\tloop($level+1);\n }\n $x[$level+1] = $x[$level];\n}\n\nloop(0);\nprint \"$max\\n\";\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "sample_input": "3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n"}, "reference_outputs": ["110\n"], "source_document_id": "p02695", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 607, "memory_kb": 5436}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s096215617", "group_id": "codeNet:p02696", "input_text": "my $s = ;\nchomp $s;\nmy ($A,$B,$N) = split(/ /,$s);\n\nmy $max =0;\nif(($B-1)>$N ){\n my $i = $N;\n my $cal = int(($A*$i)/$B)- $A*int($i/$B);\n print \"$cal\";exit;\n}\nfor(my $i=$B-1;$i<=$B;$i=$i+$B){\n my $cal = int(($A*$i)/$B)- $A*int($i/$B);\n if($cal >$max){\n $max = $cal;\n }\n}\n\nprint \"$max\";", "language": "Perl", "metadata": {"date": 1588474035, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/Perl/s096215617.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s096215617", "user_id": "u464700044"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my $s = ;\nchomp $s;\nmy ($A,$B,$N) = split(/ /,$s);\n\nmy $max =0;\nif(($B-1)>$N ){\n my $i = $N;\n my $cal = int(($A*$i)/$B)- $A*int($i/$B);\n print \"$cal\";exit;\n}\nfor(my $i=$B-1;$i<=$B;$i=$i+$B){\n my $cal = int(($A*$i)/$B)- $A*int($i/$B);\n if($cal >$max){\n $max = $cal;\n }\n}\n\nprint \"$max\";", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 310, "cpu_time_ms": 3, "memory_kb": 4784}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s075930840", "group_id": "codeNet:p02697", "input_text": "my ($n, $m) = split(/\\s+/, <>);\n\nmy $b = $m*2 + 1 - $n%2;\nfor my $a (1..$m) {\n print $a, \" \", $b--, \"\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1588474024, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02697.html", "problem_id": "p02697", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02697/input.txt", "sample_output_relpath": "derived/input_output/data/p02697/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02697/Perl/s075930840.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s075930840", "user_id": "u996239623"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "my ($n, $m) = split(/\\s+/, <>);\n\nmy $b = $m*2 + 1 - $n%2;\nfor my $a (1..$m) {\n print $a, \" \", $b--, \"\\n\";\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "sample_input": "4 1\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02697", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 49, "memory_kb": 4840}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s774919690", "group_id": "codeNet:p02699", "input_text": "#!/usr/bin/perl\n\n# 引数取り込み\nmy $a = <>;\nmy ( $s, $w ) = split( / /, $a );\n\n# 処理開始\nif ( $s < $w ) {\n print \"unsafe\";\n}\nelse {\n print \"safe\";\n}\n\n\n1;", "language": "Perl", "metadata": {"date": 1594057020, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "low_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/Perl/s774919690.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s774919690", "user_id": "u286255470"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "#!/usr/bin/perl\n\n# 引数取り込み\nmy $a = <>;\nmy ( $s, $w ) = split( / /, $a );\n\n# 処理開始\nif ( $s < $w ) {\n print \"unsafe\";\n}\nelse {\n print \"safe\";\n}\n\n\n1;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 170, "cpu_time_ms": 3, "memory_kb": 4624}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s604136655", "group_id": "codeNet:p02699", "input_text": "#! /usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $in = <>;\nchomp($in);\nmy ($s, $w) = split(/\\s+/, $in);\n\nif($s <= $w) {\n print \"unsafe\\n\";\n}else{\n print \"safe\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1588100562, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "low_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/Perl/s604136655.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s604136655", "user_id": "u477280761"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "#! /usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $in = <>;\nchomp($in);\nmy ($s, $w) = split(/\\s+/, $in);\n\nif($s <= $w) {\n print \"unsafe\\n\";\n}else{\n print \"safe\\n\";\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 170, "cpu_time_ms": 8, "memory_kb": 5088}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s687892634", "group_id": "codeNet:p02699", "input_text": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $inp = ;\nchomp($inp);\nmy ($s, $w) = split(/ /, $inp);\nif ($s > $w) {\n say 'safe';\n} else {\n say 'unsafe';\n}", "language": "Perl", "metadata": {"date": 1587949337, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "low_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/Perl/s687892634.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s687892634", "user_id": "u566924053"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $inp = ;\nchomp($inp);\nmy ($s, $w) = split(/ /, $inp);\nif ($s > $w) {\n say 'safe';\n} else {\n say 'unsafe';\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 14, "memory_kb": 5216}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s760064539", "group_id": "codeNet:p02701", "input_text": "my %hash;\nfor(1..<>){ $hash{<>}++ }\n$_ = keys %hash;\nprint;\n", "language": "Perl", "metadata": {"date": 1588901527, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02701.html", "problem_id": "p02701", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02701/input.txt", "sample_output_relpath": "derived/input_output/data/p02701/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02701/Perl/s760064539.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s760064539", "user_id": "u020604402"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my %hash;\nfor(1..<>){ $hash{<>}++ }\n$_ = keys %hash;\nprint;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\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 number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "sample_input": "3\napple\norange\napple\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02701", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\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 number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 60, "cpu_time_ms": 138, "memory_kb": 30412}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s166918481", "group_id": "codeNet:p02701", "input_text": "$n=<>-1;\n%buf=();\nfor(0..$n){\n\t$buf{<>}=1;\n}\nprint scalar(%buf).\"\\n\";\n\n", "language": "Perl", "metadata": {"date": 1587950392, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02701.html", "problem_id": "p02701", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02701/input.txt", "sample_output_relpath": "derived/input_output/data/p02701/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02701/Perl/s166918481.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s166918481", "user_id": "u222602662"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$n=<>-1;\n%buf=();\nfor(0..$n){\n\t$buf{<>}=1;\n}\nprint scalar(%buf).\"\\n\";\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\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 number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "sample_input": "3\napple\norange\napple\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02701", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\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 number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 95, "memory_kb": 30728}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s052951988", "group_id": "codeNet:p02707", "input_text": "\nmy $N= ;\nmy $s= ;\nmy @dat = split(/ /,$s);\nmy $sum =0;\nmy @data;\nfor(my $i=0;$i<$N;$i++){\n $data[$i+1]=0;\n}\nfor(my $i=0;$i<$N;$i++){\n $data[$dat[$i]]++;\n}\nfor(my $i=0;$i<$N;$i++){\n print \"$data[$i+1]\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1587345074, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02707.html", "problem_id": "p02707", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02707/input.txt", "sample_output_relpath": "derived/input_output/data/p02707/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02707/Perl/s052951988.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s052951988", "user_id": "u464700044"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\n", "input_to_evaluate": "\nmy $N= ;\nmy $s= ;\nmy @dat = split(/ /,$s);\nmy $sum =0;\nmy @data;\nfor(my $i=0;$i<$N;$i++){\n $data[$i+1]=0;\n}\nfor(my $i=0;$i<$N;$i++){\n $data[$dat[$i]]++;\n}\nfor(my $i=0;$i<$N;$i++){\n print \"$data[$i+1]\\n\";\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "sample_input": "5\n1 1 2 2\n"}, "reference_outputs": ["2\n2\n0\n0\n0\n"], "source_document_id": "p02707", "source_text": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 143, "memory_kb": 43920}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s991116464", "group_id": "codeNet:p02707", "input_text": "@_=(0)x<>;$_[$_-1]++for glob<>;print$_,$/for@_", "language": "Perl", "metadata": {"date": 1587344858, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02707.html", "problem_id": "p02707", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02707/input.txt", "sample_output_relpath": "derived/input_output/data/p02707/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02707/Perl/s991116464.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s991116464", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\n", "input_to_evaluate": "@_=(0)x<>;$_[$_-1]++for glob<>;print$_,$/for@_", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "sample_input": "5\n1 1 2 2\n"}, "reference_outputs": ["2\n2\n0\n0\n0\n"], "source_document_id": "p02707", "source_text": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 633, "memory_kb": 124440}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s430529613", "group_id": "codeNet:p02708", "input_text": "#!/usr/bin/perl\n\nmy ($n,$k) = map { $_ - 0 } split(/\\s+/,scalar());\nmy $mb = 1000000007;\n\nmy $tot = 0;\nfor(my $i=$k; $i<=$n+1; $i++){\n my $p = ( $n * $i - $i * ( $i - 1 ) / 2 ) - ( $i * ( $i - 1 ) / 2 ) + 1;\n $tot = ( $tot + $p ) % $mb ;\n}\n\nprint \"$tot\\n\";\n\n", "language": "Perl", "metadata": {"date": 1587430060, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02708.html", "problem_id": "p02708", "resource_group": "low_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/Perl/s430529613.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s430529613", "user_id": "u750383873"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n,$k) = map { $_ - 0 } split(/\\s+/,scalar());\nmy $mb = 1000000007;\n\nmy $tot = 0;\nfor(my $i=$k; $i<=$n+1; $i++){\n my $p = ( $n * $i - $i * ( $i - 1 ) / 2 ) - ( $i * ( $i - 1 ) / 2 ) + 1;\n $tot = ( $tot + $p ) % $mb ;\n}\n\nprint \"$tot\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 63, "memory_kb": 4840}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s734754586", "group_id": "codeNet:p02708", "input_text": "$/=words;say map({1+$_*($0-$_+1)},$1..$0+1).sum%(1e9+|7)", "language": "Perl", "metadata": {"date": 1587364193, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02708.html", "problem_id": "p02708", "resource_group": "low_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/Perl/s734754586.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s734754586", "user_id": "u657913472"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$/=words;say map({1+$_*($0-$_+1)},$1..$0+1).sum%(1e9+|7)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 56, "cpu_time_ms": 2209, "memory_kb": 149464}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s770954378", "group_id": "codeNet:p02712", "input_text": "#!/usr/bin/perl\nuse strict;\n\nmy $N = <>;\nmy $sum = 0;\nfor (my $i = 1; $i <= $N; $i++) {\n if (($i % 3 == 0) && ($i % 5 == 0) ) {\n } elsif ($i % 3 == 0) {\n } elsif ($i % 5 == 0) {\n } else {\n\t$sum += $i;\n }\n}\nprint $sum;", "language": "Perl", "metadata": {"date": 1586831682, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "low_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/Perl/s770954378.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s770954378", "user_id": "u297275853"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "#!/usr/bin/perl\nuse strict;\n\nmy $N = <>;\nmy $sum = 0;\nfor (my $i = 1; $i <= $N; $i++) {\n if (($i % 3 == 0) && ($i % 5 == 0) ) {\n } elsif ($i % 3 == 0) {\n } elsif ($i % 5 == 0) {\n } else {\n\t$sum += $i;\n }\n}\nprint $sum;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 164, "memory_kb": 4916}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s229592532", "group_id": "codeNet:p02712", "input_text": "$_=+get;\nsay sum(1..$_)-sum(1..$_ div 3)*3-sum(1..$_ div 5)*5+sum(1..$_ div 15)*15", "language": "Perl", "metadata": {"date": 1586742531, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "low_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/Perl/s229592532.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s229592532", "user_id": "u657913472"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "$_=+get;\nsay sum(1..$_)-sum(1..$_ div 3)*3-sum(1..$_ div 5)*5+sum(1..$_ div 15)*15", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 186, "memory_kb": 84408}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s677346745", "group_id": "codeNet:p02716", "input_text": "<>;$0[@0]=($\\=$_+$0[-2])+=$-=${@0%2}[-1]-$\\,$1[@1]=$_+$1[-2]for glob<>;print", "language": "Perl", "metadata": {"date": 1586769525, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02716.html", "problem_id": "p02716", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02716/input.txt", "sample_output_relpath": "derived/input_output/data/p02716/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02716/Perl/s677346745.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s677346745", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "<>;$0[@0]=($\\=$_+$0[-2])+=$-=${@0%2}[-1]-$\\,$1[@1]=$_+$1[-2]for glob<>;print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence A_1, ..., A_N of length N.\n\nWe will choose exactly \\left\\lfloor \\frac{N}{2} \\right\\rfloor elements from this sequence so that no two adjacent elements are chosen.\n\nFind the maximum possible sum of the chosen elements.\n\nHere \\lfloor x \\rfloor denotes the greatest integer not greater than x.\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n|A_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\nA_1 ... A_N\n\nOutput\n\nPrint the maximum possible sum of the chosen elements.\n\nSample Input 1\n\n6\n1 2 3 4 5 6\n\nSample Output 1\n\n12\n\nChoosing 2, 4, and 6 makes the sum 12, which is the maximum possible value.\n\nSample Input 2\n\n5\n-1000 -100 -10 0 10\n\nSample Output 2\n\n0\n\nChoosing -10 and 10 makes the sum 0, which is the maximum possible value.\n\nSample Input 3\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nWatch out for overflow.\n\nSample Input 4\n\n27\n18 -28 18 28 -45 90 -45 23 -53 60 28 -74 -71 35 -26 -62 49 -77 57 24 -70 -93 69 -99 59 57 -49\n\nSample Output 4\n\n295", "sample_input": "6\n1 2 3 4 5 6\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02716", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence A_1, ..., A_N of length N.\n\nWe will choose exactly \\left\\lfloor \\frac{N}{2} \\right\\rfloor elements from this sequence so that no two adjacent elements are chosen.\n\nFind the maximum possible sum of the chosen elements.\n\nHere \\lfloor x \\rfloor denotes the greatest integer not greater than x.\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n|A_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\nA_1 ... A_N\n\nOutput\n\nPrint the maximum possible sum of the chosen elements.\n\nSample Input 1\n\n6\n1 2 3 4 5 6\n\nSample Output 1\n\n12\n\nChoosing 2, 4, and 6 makes the sum 12, which is the maximum possible value.\n\nSample Input 2\n\n5\n-1000 -100 -10 0 10\n\nSample Output 2\n\n0\n\nChoosing -10 and 10 makes the sum 0, which is the maximum possible value.\n\nSample Input 3\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nWatch out for overflow.\n\nSample Input 4\n\n27\n18 -28 18 28 -45 90 -45 23 -53 60 28 -74 -71 35 -26 -62 49 -77 57 24 -70 -93 69 -99 59 57 -49\n\nSample Output 4\n\n295", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1279, "memory_kb": 192076}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s540934661", "group_id": "codeNet:p02716", "input_text": "<>;map{$d[@d]=$\\=($X=$_+$d[-2])+=$-=(@d%2?$e[-1]:$\\)-$X;$e[@e]=$_+$e[-2]}glob<>;print", "language": "Perl", "metadata": {"date": 1586769368, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02716.html", "problem_id": "p02716", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02716/input.txt", "sample_output_relpath": "derived/input_output/data/p02716/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02716/Perl/s540934661.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s540934661", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "<>;map{$d[@d]=$\\=($X=$_+$d[-2])+=$-=(@d%2?$e[-1]:$\\)-$X;$e[@e]=$_+$e[-2]}glob<>;print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence A_1, ..., A_N of length N.\n\nWe will choose exactly \\left\\lfloor \\frac{N}{2} \\right\\rfloor elements from this sequence so that no two adjacent elements are chosen.\n\nFind the maximum possible sum of the chosen elements.\n\nHere \\lfloor x \\rfloor denotes the greatest integer not greater than x.\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n|A_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\nA_1 ... A_N\n\nOutput\n\nPrint the maximum possible sum of the chosen elements.\n\nSample Input 1\n\n6\n1 2 3 4 5 6\n\nSample Output 1\n\n12\n\nChoosing 2, 4, and 6 makes the sum 12, which is the maximum possible value.\n\nSample Input 2\n\n5\n-1000 -100 -10 0 10\n\nSample Output 2\n\n0\n\nChoosing -10 and 10 makes the sum 0, which is the maximum possible value.\n\nSample Input 3\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nWatch out for overflow.\n\nSample Input 4\n\n27\n18 -28 18 28 -45 90 -45 23 -53 60 28 -74 -71 35 -26 -62 49 -77 57 24 -70 -93 69 -99 59 57 -49\n\nSample Output 4\n\n295", "sample_input": "6\n1 2 3 4 5 6\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02716", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence A_1, ..., A_N of length N.\n\nWe will choose exactly \\left\\lfloor \\frac{N}{2} \\right\\rfloor elements from this sequence so that no two adjacent elements are chosen.\n\nFind the maximum possible sum of the chosen elements.\n\nHere \\lfloor x \\rfloor denotes the greatest integer not greater than x.\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n|A_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\nA_1 ... A_N\n\nOutput\n\nPrint the maximum possible sum of the chosen elements.\n\nSample Input 1\n\n6\n1 2 3 4 5 6\n\nSample Output 1\n\n12\n\nChoosing 2, 4, and 6 makes the sum 12, which is the maximum possible value.\n\nSample Input 2\n\n5\n-1000 -100 -10 0 10\n\nSample Output 2\n\n0\n\nChoosing -10 and 10 makes the sum 0, which is the maximum possible value.\n\nSample Input 3\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nWatch out for overflow.\n\nSample Input 4\n\n27\n18 -28 18 28 -45 90 -45 23 -53 60 28 -74 -71 35 -26 -62 49 -77 57 24 -70 -93 69 -99 59 57 -49\n\nSample Output 4\n\n295", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 85, "cpu_time_ms": 1466, "memory_kb": 193728}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s605394028", "group_id": "codeNet:p02719", "input_text": "use strict;\nuse warnings;\n\nsub min {\n return $_[0] < $_[1] ? $_[0] : $_[1];\n}\n\nchomp (my ($N, $K) = split(/ /, ));\n\nprint min($N % $K, $K - ($N % $K)) . \"\\n\";", "language": "Perl", "metadata": {"date": 1586616405, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02719.html", "problem_id": "p02719", "resource_group": "low_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/Perl/s605394028.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s605394028", "user_id": "u587248350"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nsub min {\n return $_[0] < $_[1] ? $_[0] : $_[1];\n}\n\nchomp (my ($N, $K) = split(/ /, ));\n\nprint min($N % $K, $K - ($N % $K)) . \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s979140438", "group_id": "codeNet:p02719", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($n, $k) = split / /, );\nmy $ans = $n % $k;\nsay min($ans, abs($ans - $k));", "language": "Perl", "metadata": {"date": 1586049168, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02719.html", "problem_id": "p02719", "resource_group": "low_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/Perl/s979140438.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s979140438", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($n, $k) = split / /, );\nmy $ans = $n % $k;\nsay min($ans, abs($ans - $k));", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s284881913", "group_id": "codeNet:p02720", "input_text": "#include \nusing namespace std;\n#define rep(i, n) for (int i = 0; i < (int)(n); i++)\n\nint main() {\n int K, X, A=0;\n cin >> K;\n vector Q;\n rep(i, 9) Q.push_back(i+1);\n while(Q.size()<=K){\n X=Q.at(A);\n if(X%10!=0) Q.push_back(10*X+X%10-1);\n Q.push_back(10*X+X%10);\n if(X%10!=9) Q.push_back(10*X+X%10+1);\n A++;\n }\n cout << Q.at(K-1) << endl;\n}", "language": "Perl", "metadata": {"date": 1586139289, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02720.html", "problem_id": "p02720", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02720/input.txt", "sample_output_relpath": "derived/input_output/data/p02720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02720/Perl/s284881913.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s284881913", "user_id": "u749022615"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "#include \nusing namespace std;\n#define rep(i, n) for (int i = 0; i < (int)(n); i++)\n\nint main() {\n int K, X, A=0;\n cin >> K;\n vector Q;\n rep(i, 9) Q.push_back(i+1);\n while(Q.size()<=K){\n X=Q.at(A);\n if(X%10!=0) Q.push_back(10*X+X%10-1);\n Q.push_back(10*X+X%10);\n if(X%10!=9) Q.push_back(10*X+X%10+1);\n A++;\n }\n cout << Q.at(K-1) << endl;\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "sample_input": "15\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02720", "source_text": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s924584936", "group_id": "codeNet:p02720", "input_text": "@_=0..9;push@_,($\\=@_[$_]).($_=$\\%10)-!$_..$\\.$_+!/9/ for 1..<>;print", "language": "Perl", "metadata": {"date": 1586056818, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02720.html", "problem_id": "p02720", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02720/input.txt", "sample_output_relpath": "derived/input_output/data/p02720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02720/Perl/s924584936.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s924584936", "user_id": "u657913472"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "@_=0..9;push@_,($\\=@_[$_]).($_=$\\%10)-!$_..$\\.$_+!/9/ for 1..<>;print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "sample_input": "15\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02720", "source_text": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 116, "memory_kb": 5888}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s550915483", "group_id": "codeNet:p02722", "input_text": "$N = ;\nchomp $N;\n#print \"$N\\n\";\n\nmy $count =2;#NとN-1\n\nfor(my $i=2;$i;\nchomp $N;\n#print \"$N\\n\";\n\nmy $count =2;#NとN-1\n\nfor(my $i=2;$i);\nif ($array[2] eq $array[3] && $array[4] eq $array[5]) {print\"Yes\\n\"}else{print\"No\\n\"}", "language": "Perl", "metadata": {"date": 1585443863, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "low_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/Perl/s172471104.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s172471104", "user_id": "u449599952"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my @array = split(//, );\nif ($array[2] eq $array[3] && $array[4] eq $array[5]) {print\"Yes\\n\"}else{print\"No\\n\"}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 117, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s460073448", "group_id": "codeNet:p02725", "input_text": "use List::Util max;$k=glob<>;@a=glob<>;$d[$_]=$a[$_+1]-$a[$_]for(0..@a-2);push@d,$a[0]+$k-$a[@a-1];print$k-max@d;", "language": "Perl", "metadata": {"date": 1586479362, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "low_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/Perl/s460073448.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s460073448", "user_id": "u703141727"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "use List::Util max;$k=glob<>;@a=glob<>;$d[$_]=$a[$_+1]-$a[$_]for(0..@a-2);push@d,$a[0]+$k-$a[@a-1];print$k-max@d;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 113, "cpu_time_ms": 756, "memory_kb": 52784}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s518164888", "group_id": "codeNet:p02725", "input_text": "my ($k,$n) = split(/ /,);\nmy @a = split(/ /,);my @diff= ();my $diff;\nwhile ($n > 0){$diff = abs($a[$n-1]-$a[$n-2]);if($diff>$k-$diff){push(@diff,$k-$diff)} else{push(@diff,$diff)};$n--;}\nmy @sorted = sort{$a<=>$b}@diff;\nprint $k-$sorted[n-1],\"\\n\";", "language": "Perl", "metadata": {"date": 1586459152, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "low_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/Perl/s518164888.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s518164888", "user_id": "u491340600"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "my ($k,$n) = split(/ /,);\nmy @a = split(/ /,);my @diff= ();my $diff;\nwhile ($n > 0){$diff = abs($a[$n-1]-$a[$n-2]);if($diff>$k-$diff){push(@diff,$k-$diff)} else{push(@diff,$diff)};$n--;}\nmy @sorted = sort{$a<=>$b}@diff;\nprint $k-$sorted[n-1],\"\\n\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 261, "cpu_time_ms": 191, "memory_kb": 41288}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s109043351", "group_id": "codeNet:p02725", "input_text": "my ($k,$n) = split(/ /,);\nmy @a = split(/ /,);my @diff= ();my $diff;\nwhile ($n > 0){$diff = abs($a[$n-1]-$a[$n-2]);if($diff>$k-$diff){push(@diff,$k-$diff)} else{push(@diff,$diff)};$n--;}\nmy @sorted = sort{a<=>$b}@diff;\nprint $diff[0],\"\\n\";", "language": "Perl", "metadata": {"date": 1586458514, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "low_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/Perl/s109043351.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s109043351", "user_id": "u491340600"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "my ($k,$n) = split(/ /,);\nmy @a = split(/ /,);my @diff= ();my $diff;\nwhile ($n > 0){$diff = abs($a[$n-1]-$a[$n-2]);if($diff>$k-$diff){push(@diff,$k-$diff)} else{push(@diff,$diff)};$n--;}\nmy @sorted = sort{a<=>$b}@diff;\nprint $diff[0],\"\\n\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 253, "cpu_time_ms": 190, "memory_kb": 53960}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s525984220", "group_id": "codeNet:p02725", "input_text": "$s = ;\nmy ($K,$N) = split(/ /,$s);\n$s = ;\nchomp $s;\nmy $max= 0;\nmy @dat = split(/ /,$s);\nfor(my $i =1;$i<$N;$i++){\n my $dist = $dat[$i] - $dat[$i-1];\n if($dist > $max ){\n $max = $dist;\n } \n}\n$add = $dat[0] + ($K-$dat[$N-1]);\nif($add > $max ){\n $max = $add;\n} \n\nmy $ans = $K - $max ;\nprint \"$ans\";", "language": "Perl", "metadata": {"date": 1585444967, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "low_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/Perl/s525984220.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s525984220", "user_id": "u464700044"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$s = ;\nmy ($K,$N) = split(/ /,$s);\n$s = ;\nchomp $s;\nmy $max= 0;\nmy @dat = split(/ /,$s);\nfor(my $i =1;$i<$N;$i++){\n my $dist = $dat[$i] - $dat[$i-1];\n if($dist > $max ){\n $max = $dist;\n } \n}\n$add = $dat[0] + ($K-$dat[$N-1]);\nif($add > $max ){\n $max = $add;\n} \n\nmy $ans = $K - $max ;\nprint \"$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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 319, "cpu_time_ms": 127, "memory_kb": 33356}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s415993936", "group_id": "codeNet:p02726", "input_text": "<>=~/ .* /;for$i(1..$`){$#{($a=$i-$_,$b=abs($_-$&)+1+abs($'-$i),$a<$b?$a:$b)}++for 1..$i-1}print@$_|0,$/for 1..$`-1", "language": "Perl", "metadata": {"date": 1586539818, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02726.html", "problem_id": "p02726", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02726/input.txt", "sample_output_relpath": "derived/input_output/data/p02726/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02726/Perl/s415993936.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s415993936", "user_id": "u703141727"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "<>=~/ .* /;for$i(1..$`){$#{($a=$i-$_,$b=abs($_-$&)+1+abs($'-$i),$a<$b?$a:$b)}++for 1..$i-1}print@$_|0,$/for 1..$`-1", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "sample_input": "5 2 4\n"}, "reference_outputs": ["5\n4\n1\n0\n"], "source_document_id": "p02726", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 115, "cpu_time_ms": 2105, "memory_kb": 24704}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s678322239", "group_id": "codeNet:p02726", "input_text": "use List::Util min;<>=~/ .* /;for$i(1..$`){$#{min($i-$_,abs($_-$&)+1+abs($'-$i))}++for 1..$i-1}print@$_|0,$/for 1..$n-1", "language": "Perl", "metadata": {"date": 1586537963, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02726.html", "problem_id": "p02726", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02726/input.txt", "sample_output_relpath": "derived/input_output/data/p02726/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02726/Perl/s678322239.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s678322239", "user_id": "u703141727"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "use List::Util min;<>=~/ .* /;for$i(1..$`){$#{min($i-$_,abs($_-$&)+1+abs($'-$i))}++for 1..$i-1}print@$_|0,$/for 1..$n-1", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "sample_input": "5 2 4\n"}, "reference_outputs": ["5\n4\n1\n0\n"], "source_document_id": "p02726", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1681, "memory_kb": 24704}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s094616493", "group_id": "codeNet:p02729", "input_text": "#!/usr/bin/perl\n\nmy ($N,$M) = map { $_ - 0 } split(/\\s+/,);\n\nmy $r = 0;\n\nif( $N > 1 ){\n $r += ( $N * ( $N - 1 ) ) / 2;\n}\nif( $M > 1 ){\n $r += ( $M * ( $M - 1 ) ) / 2;\n}\nprint \"$r\\n\";\n", "language": "Perl", "metadata": {"date": 1584925526, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "low_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/Perl/s094616493.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s094616493", "user_id": "u750383873"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($N,$M) = map { $_ - 0 } split(/\\s+/,);\n\nmy $r = 0;\n\nif( $N > 1 ){\n $r += ( $N * ( $N - 1 ) ) / 2;\n}\nif( $M > 1 ){\n $r += ( $M * ( $M - 1 ) ) / 2;\n}\nprint \"$r\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s503226654", "group_id": "codeNet:p02730", "input_text": "<>=~/.../ or die", "language": "Perl", "metadata": {"date": 1584931982, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02730.html", "problem_id": "p02730", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02730/input.txt", "sample_output_relpath": "derived/input_output/data/p02730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02730/Perl/s503226654.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s503226654", "user_id": "u049095189"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "<>=~/.../ or die", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "sample_input": "akasaka\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02730", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 16, "cpu_time_ms": 3, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s794553806", "group_id": "codeNet:p02730", "input_text": "$s = ;\n\nchomp $s;\nmy @dat = split(//,$s);\n\n$N = length $s;\n$T = ($N-1)/2;\n$A = substr($s, 0, $T);\n$B = reverse($A);\n$flag = 0;\nif($A eq $B ){\n #print \"Yes\\n\";\n}else{\n $flag = 1;\n #print \"No\\n\";\n}\nprint \"$T\\n\";\nprint \"$A\\n\";\nprint \"$B\\n\";\n\n$T2 = ($N+3)/2;\n$A = substr($s, $T2-1, $N);\n$B = reverse($A);\nif($A eq $B ){\n #print \"Yes\\n\";\n}else{\n $flag = 1;\n #print \"No\\n\";\n}\nif($flag == 0 ){\n print \"Yes\";\n}else{\n print \"No\";\n}", "language": "Perl", "metadata": {"date": 1584927069, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02730.html", "problem_id": "p02730", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02730/input.txt", "sample_output_relpath": "derived/input_output/data/p02730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02730/Perl/s794553806.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s794553806", "user_id": "u464700044"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$s = ;\n\nchomp $s;\nmy @dat = split(//,$s);\n\n$N = length $s;\n$T = ($N-1)/2;\n$A = substr($s, 0, $T);\n$B = reverse($A);\n$flag = 0;\nif($A eq $B ){\n #print \"Yes\\n\";\n}else{\n $flag = 1;\n #print \"No\\n\";\n}\nprint \"$T\\n\";\nprint \"$A\\n\";\nprint \"$B\\n\";\n\n$T2 = ($N+3)/2;\n$A = substr($s, $T2-1, $N);\n$B = reverse($A);\nif($A eq $B ){\n #print \"Yes\\n\";\n}else{\n $flag = 1;\n #print \"No\\n\";\n}\nif($flag == 0 ){\n print \"Yes\";\n}else{\n print \"No\";\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "sample_input": "akasaka\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02730", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 440, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s732853554", "group_id": "codeNet:p02731", "input_text": "print<>**3/27", "language": "Perl", "metadata": {"date": 1584925747, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02731.html", "problem_id": "p02731", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02731/input.txt", "sample_output_relpath": "derived/input_output/data/p02731/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02731/Perl/s732853554.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s732853554", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1.000000000000\n", "input_to_evaluate": "print<>**3/27", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer L.\nFind the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\n\nConstraints\n\n1 ≤ L ≤ 1000\n\nL is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\n\nOutput\n\nPrint the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\nYour output is considered correct if its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1.000000000000\n\nFor example, a rectangular cuboid whose dimensions are 0.8, 1, and 1.2 has a volume of 0.96.\n\nOn the other hand, if the dimensions are 1, 1, and 1, the volume of the rectangular cuboid is 1, which is greater.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n36926037.000000000000", "sample_input": "3\n"}, "reference_outputs": ["1.000000000000\n"], "source_document_id": "p02731", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer L.\nFind the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\n\nConstraints\n\n1 ≤ L ≤ 1000\n\nL is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\n\nOutput\n\nPrint the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\nYour output is considered correct if its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1.000000000000\n\nFor example, a rectangular cuboid whose dimensions are 0.8, 1, and 1.2 has a volume of 0.96.\n\nOn the other hand, if the dimensions are 1, 1, and 1, the volume of the rectangular cuboid is 1, which is greater.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n36926037.000000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 13, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s726593563", "group_id": "codeNet:p02732", "input_text": "<>;print$.-@$_-1,$/for grep$.+=++$#$_,glob<>", "language": "Perl", "metadata": {"date": 1584928450, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "low_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/Perl/s726593563.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s726593563", "user_id": "u049095189"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "<>;print$.-@$_-1,$/for grep$.+=++$#$_,glob<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 44, "cpu_time_ms": 1189, "memory_kb": 124652}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s077055418", "group_id": "codeNet:p02734", "input_text": "<>=~$\";$%+=$_[$i=!++$_[$']*map$_[$i++]+=$_%=$==998244353,@_[$_..$']]for glob<>;print$%%$=", "language": "Perl", "metadata": {"date": 1584935021, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02734.html", "problem_id": "p02734", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02734/input.txt", "sample_output_relpath": "derived/input_output/data/p02734/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02734/Perl/s077055418.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s077055418", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "<>=~$\";$%+=$_[$i=!++$_[$']*map$_[$i++]+=$_%=$==998244353,@_[$_..$']]for glob<>;print$%%$=", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are a sequence of N integers A_1, A_2, \\ldots, A_N and a positive integer S.\n\nFor a pair of integers (L, R) such that 1\\leq L \\leq R \\leq N, let us define f(L, R) as follows:\n\nf(L, R) is the number of sequences of integers (x_1, x_2, \\ldots , x_k) such that L \\leq x_1 < x_2 < \\cdots < x_k \\leq R and A_{x_1}+A_{x_2}+\\cdots +A_{x_k} = S.\n\nFind the sum of f(L, R) over all pairs of integers (L, R) such that 1\\leq L \\leq R\\leq N. Since this 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(L, R), modulo 998244353.\n\nSample Input 1\n\n3 4\n2 2 4\n\nSample Output 1\n\n5\n\nThe value of f(L, R) for each pair is as follows, for a total of 5.\n\nf(1,1) = 0\n\nf(1,2) = 1 (for the sequence (1, 2))\n\nf(1,3) = 2 (for (1, 2) and (3))\n\nf(2,2) = 0\n\nf(2,3) = 1 (for (3))\n\nf(3,3) = 1 (for (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\n152", "sample_input": "3 4\n2 2 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02734", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are a sequence of N integers A_1, A_2, \\ldots, A_N and a positive integer S.\n\nFor a pair of integers (L, R) such that 1\\leq L \\leq R \\leq N, let us define f(L, R) as follows:\n\nf(L, R) is the number of sequences of integers (x_1, x_2, \\ldots , x_k) such that L \\leq x_1 < x_2 < \\cdots < x_k \\leq R and A_{x_1}+A_{x_2}+\\cdots +A_{x_k} = S.\n\nFind the sum of f(L, R) over all pairs of integers (L, R) such that 1\\leq L \\leq R\\leq N. Since this 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(L, R), modulo 998244353.\n\nSample Input 1\n\n3 4\n2 2 4\n\nSample Output 1\n\n5\n\nThe value of f(L, R) for each pair is as follows, for a total of 5.\n\nf(1,1) = 0\n\nf(1,2) = 1 (for the sequence (1, 2))\n\nf(1,3) = 2 (for (1, 2) and (3))\n\nf(2,2) = 0\n\nf(2,3) = 1 (for (3))\n\nf(3,3) = 1 (for (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\n152", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1971, "memory_kb": 1664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s610183170", "group_id": "codeNet:p02734", "input_text": "<>=~$\";$_[$']++,$%+=$_[$i=0*map$_[$i++]+=$_%=$==998244353,@_[$_..$']]for glob<>;print$%%$=", "language": "Perl", "metadata": {"date": 1584934945, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02734.html", "problem_id": "p02734", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02734/input.txt", "sample_output_relpath": "derived/input_output/data/p02734/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02734/Perl/s610183170.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s610183170", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "<>=~$\";$_[$']++,$%+=$_[$i=0*map$_[$i++]+=$_%=$==998244353,@_[$_..$']]for glob<>;print$%%$=", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are a sequence of N integers A_1, A_2, \\ldots, A_N and a positive integer S.\n\nFor a pair of integers (L, R) such that 1\\leq L \\leq R \\leq N, let us define f(L, R) as follows:\n\nf(L, R) is the number of sequences of integers (x_1, x_2, \\ldots , x_k) such that L \\leq x_1 < x_2 < \\cdots < x_k \\leq R and A_{x_1}+A_{x_2}+\\cdots +A_{x_k} = S.\n\nFind the sum of f(L, R) over all pairs of integers (L, R) such that 1\\leq L \\leq R\\leq N. Since this 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(L, R), modulo 998244353.\n\nSample Input 1\n\n3 4\n2 2 4\n\nSample Output 1\n\n5\n\nThe value of f(L, R) for each pair is as follows, for a total of 5.\n\nf(1,1) = 0\n\nf(1,2) = 1 (for the sequence (1, 2))\n\nf(1,3) = 2 (for (1, 2) and (3))\n\nf(2,2) = 0\n\nf(2,3) = 1 (for (3))\n\nf(3,3) = 1 (for (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\n152", "sample_input": "3 4\n2 2 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02734", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are a sequence of N integers A_1, A_2, \\ldots, A_N and a positive integer S.\n\nFor a pair of integers (L, R) such that 1\\leq L \\leq R \\leq N, let us define f(L, R) as follows:\n\nf(L, R) is the number of sequences of integers (x_1, x_2, \\ldots , x_k) such that L \\leq x_1 < x_2 < \\cdots < x_k \\leq R and A_{x_1}+A_{x_2}+\\cdots +A_{x_k} = S.\n\nFind the sum of f(L, R) over all pairs of integers (L, R) such that 1\\leq L \\leq R\\leq N. Since this 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(L, R), modulo 998244353.\n\nSample Input 1\n\n3 4\n2 2 4\n\nSample Output 1\n\n5\n\nThe value of f(L, R) for each pair is as follows, for a total of 5.\n\nf(1,1) = 0\n\nf(1,2) = 1 (for the sequence (1, 2))\n\nf(1,3) = 2 (for (1, 2) and (3))\n\nf(2,2) = 0\n\nf(2,3) = 1 (for (3))\n\nf(3,3) = 1 (for (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\n152", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1967, "memory_kb": 1664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s591508111", "group_id": "codeNet:p02741", "input_text": "say '\u0004\u0001\u000e 3\u0001\u0002 \u0005 \u000f'.ords[get%14]||5", "language": "Perl", "metadata": {"date": 1584241309, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02741.html", "problem_id": "p02741", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02741/input.txt", "sample_output_relpath": "derived/input_output/data/p02741/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02741/Perl/s591508111.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s591508111", "user_id": "u049095189"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "say '\u0004\u0001\u000e 3\u0001\u0002 \u0005 \u000f'.ords[get%14]||5", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "sample_input": "6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02741", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 314, "memory_kb": 61556}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s675894527", "group_id": "codeNet:p02741", "input_text": "print+(51,1,4,1,4,5,2,2,_,1,2,2,5,1,5,1,14,1,2,1,5,1,2,2,5,1,2,1,2,1,1,1)[-<>]", "language": "Perl", "metadata": {"date": 1584234435, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02741.html", "problem_id": "p02741", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02741/input.txt", "sample_output_relpath": "derived/input_output/data/p02741/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02741/Perl/s675894527.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s675894527", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print+(51,1,4,1,4,5,2,2,_,1,2,2,5,1,5,1,14,1,2,1,5,1,2,2,5,1,2,1,2,1,1,1)[-<>]", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "sample_input": "6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02741", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s717353509", "group_id": "codeNet:p02742", "input_text": "use strict;\nuse warnings;\n\nchomp(my $hw = <>);\nmy ($h, $w) = split(\" \", $hw);\n\nif ($h%2==0){\n print $h/2 * $w, \"\\n\";\n}elsif($w%2==0){\n print $h * $w/2, \"\\n\";\n}else{\n print int($h/2) * $w + int($w/2)+1, \"\\n\";\n}", "language": "Perl", "metadata": {"date": 1584672797, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02742.html", "problem_id": "p02742", "resource_group": "low_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/Perl/s717353509.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s717353509", "user_id": "u783415940"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nchomp(my $hw = <>);\nmy ($h, $w) = split(\" \", $hw);\n\nif ($h%2==0){\n print $h/2 * $w, \"\\n\";\n}elsif($w%2==0){\n print $h * $w/2, \"\\n\";\n}else{\n print int($h/2) * $w + int($w/2)+1, \"\\n\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 212, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s558194437", "group_id": "codeNet:p02742", "input_text": "use v5.18; # strict say state\nuse warnings;\n\nmy ($h, $w) = split / /, ;\nmy $ans = int(($w+1)/2)*$h;\n$ans -= int($h/2) if $w%2>0;\nsay $ans;", "language": "Perl", "metadata": {"date": 1584235209, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02742.html", "problem_id": "p02742", "resource_group": "low_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/Perl/s558194437.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s558194437", "user_id": "u979552932"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\n\nmy ($h, $w) = split / /, ;\nmy $ans = int(($w+1)/2)*$h;\n$ans -= int($h/2) if $w%2>0;\nsay $ans;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s907167565", "group_id": "codeNet:p02747", "input_text": "chomp($s = );\n\nif($s =~ /^(hi)+$/){\n\tprint \"Yes\\n\";\n}else{\n\tprint \"No\\n\";\n}", "language": "Perl", "metadata": {"date": 1583717523, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02747.html", "problem_id": "p02747", "resource_group": "low_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/Perl/s907167565.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s907167565", "user_id": "u609426052"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "chomp($s = );\n\nif($s =~ /^(hi)+$/){\n\tprint \"Yes\\n\";\n}else{\n\tprint \"No\\n\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s182889040", "group_id": "codeNet:p02748", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nmy ($A, $B, $M) = split / /, ;\nmy @a = split / /, ;\nmy @b = split / /, ;\nmy (@x, @y, @z);\n{\n for (my $i=0; $i<$M; $i++) {\n ($x[$i], $y[$i], $z[$i]) = split / /, ;\n }\n}\nmy $min = min(@a) + min(@b);\n\nfor (my $i=0; $i<$M; $i++) {\n my $value = $a[$x[$i]-1] + $b[$y[$i]-1] - $z[$i];\n $min = $value if $min > $value;\n}\nsay $min;", "language": "Perl", "metadata": {"date": 1583717284, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02748.html", "problem_id": "p02748", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02748/input.txt", "sample_output_relpath": "derived/input_output/data/p02748/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02748/Perl/s182889040.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s182889040", "user_id": "u979552932"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nmy ($A, $B, $M) = split / /, ;\nmy @a = split / /, ;\nmy @b = split / /, ;\nmy (@x, @y, @z);\n{\n for (my $i=0; $i<$M; $i++) {\n ($x[$i], $y[$i], $z[$i]) = split / /, ;\n }\n}\nmy $min = min(@a) + min(@b);\n\nfor (my $i=0; $i<$M; $i++) {\n my $value = $a[$x[$i]-1] + $b[$y[$i]-1] - $z[$i];\n $min = $value if $min > $value;\n}\nsay $min;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "sample_input": "2 3 1\n3 3\n3 3 3\n1 2 1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02748", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 303, "memory_kb": 56768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s644403829", "group_id": "codeNet:p02749", "input_text": "sub f{my($u,$p)=@_;push@{--$|?b:c},$u;$_-$p&&f($_,$u)for@$u;--$|}<>;map{push@$_,$u-$_+$;for($u,$;)=split}<>;@a=($,=$\",(f 1)x$.);--$x;@b>$./3&@c>$./3?(map$a[$_]=$x+=3,@b)+map$a[$_]=++$y*3-2,@c:map$a[$_]=$x+=$x%3,@b>@c?@b:@c;print map$_<=$.&&$_||3*++$z,@a", "language": "Perl", "metadata": {"date": 1583731033, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02749.html", "problem_id": "p02749", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02749/input.txt", "sample_output_relpath": "derived/input_output/data/p02749/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02749/Perl/s644403829.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s644403829", "user_id": "u049095189"}, "prompt_components": {"gold_output": "1 2 5 4 3\n", "input_to_evaluate": "sub f{my($u,$p)=@_;push@{--$|?b:c},$u;$_-$p&&f($_,$u)for@$u;--$|}<>;map{push@$_,$u-$_+$;for($u,$;)=split}<>;@a=($,=$\",(f 1)x$.);--$x;@b>$./3&@c>$./3?(map$a[$_]=$x+=3,@b)+map$a[$_]=++$y*3-2,@c:map$a[$_]=$x+=$x%3,@b>@c?@b:@c;print map$_<=$.&&$_||3*++$z,@a", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The vertices are numbered 1 to N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nTakahashi loves the number 3. He is seeking a permutation p_1, p_2, \\ldots , p_N of integers from 1 to N satisfying the following condition:\n\nFor every pair of vertices (i, j), if the distance between Vertex i and Vertex j is 3, the sum or product of p_i and p_j is a multiple of 3.\n\nHere the distance between Vertex i and Vertex j is the number of edges contained in the shortest path from Vertex i to Vertex j.\n\nHelp Takahashi by finding a permutation that satisfies the condition.\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\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nIf no permutation satisfies the condition, print -1.\n\nOtherwise, print a permutation satisfying the condition, with space in between.\nIf there are multiple solutions, you can print any of them.\n\nSample Input 1\n\n5\n1 2\n1 3\n3 4\n3 5\n\nSample Output 1\n\n1 2 5 4 3\n\nThe distance between two vertices is 3 for the two pairs (2, 4) and (2, 5).\n\np_2 + p_4 = 6\n\np_2\\times p_5 = 6\n\nThus, this permutation satisfies the condition.", "sample_input": "5\n1 2\n1 3\n3 4\n3 5\n"}, "reference_outputs": ["1 2 5 4 3\n"], "source_document_id": "p02749", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The vertices are numbered 1 to N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nTakahashi loves the number 3. He is seeking a permutation p_1, p_2, \\ldots , p_N of integers from 1 to N satisfying the following condition:\n\nFor every pair of vertices (i, j), if the distance between Vertex i and Vertex j is 3, the sum or product of p_i and p_j is a multiple of 3.\n\nHere the distance between Vertex i and Vertex j is the number of edges contained in the shortest path from Vertex i to Vertex j.\n\nHelp Takahashi by finding a permutation that satisfies the condition.\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\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nIf no permutation satisfies the condition, print -1.\n\nOtherwise, print a permutation satisfying the condition, with space in between.\nIf there are multiple solutions, you can print any of them.\n\nSample Input 1\n\n5\n1 2\n1 3\n3 4\n3 5\n\nSample Output 1\n\n1 2 5 4 3\n\nThe distance between two vertices is 3 for the two pairs (2, 4) and (2, 5).\n\np_2 + p_4 = 6\n\np_2\\times p_5 = 6\n\nThus, this permutation satisfies the condition.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 253, "cpu_time_ms": 1336, "memory_kb": 269440}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s803275664", "group_id": "codeNet:p02750", "input_text": "#!/usr/bin/perl\nuse strict;\nuse warnings;\nuse feature qw(:5.10);\nuse utf8;\n\nmy $limit;\n{\n my $l = ;\n my @l = split(/\\s+/, $l);\n $limit = $l[1] + 0.5;\n}\nmy %shops;\n{\n my $i = 0;\n while(){\n $i++;\n my @s = split(/\\s+/);\n $shops{$i} = {\n a => $s[0],\n b => $s[1]\n };\n }\n}\n\nmy $now = 1;\nmy $count = 0;\nwhile ($now < $limit){\n my $minshop = minshop($now);\n $now += visit($minshop, $now);\n $count++ if $now < $limit;\n $now++;\n last if (keys %shops)+0 == 0;\n}\nsay $count;\n\nsub visit {\n my $s = shift;\n my $n = shift;\n my $time = $shops{$s}->{a} * $n + $shops{$s}->{b};\n delete($shops{$s});\n return $time;\n}\nsub minshop {\n my $now = shift;\n my %cal;\n for my $k (keys %shops){\n my $sum = $shops{$k}->{a} * $now + $shops{$k}->{b};\n $cal{$k} = $sum;\n }\n my @result = sort {$cal{$a} <=> $cal{$b}} keys %cal;\n return $result[0];\n}", "language": "Perl", "metadata": {"date": 1583720490, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02750.html", "problem_id": "p02750", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02750/input.txt", "sample_output_relpath": "derived/input_output/data/p02750/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02750/Perl/s803275664.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s803275664", "user_id": "u264332171"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\nuse strict;\nuse warnings;\nuse feature qw(:5.10);\nuse utf8;\n\nmy $limit;\n{\n my $l = ;\n my @l = split(/\\s+/, $l);\n $limit = $l[1] + 0.5;\n}\nmy %shops;\n{\n my $i = 0;\n while(){\n $i++;\n my @s = split(/\\s+/);\n $shops{$i} = {\n a => $s[0],\n b => $s[1]\n };\n }\n}\n\nmy $now = 1;\nmy $count = 0;\nwhile ($now < $limit){\n my $minshop = minshop($now);\n $now += visit($minshop, $now);\n $count++ if $now < $limit;\n $now++;\n last if (keys %shops)+0 == 0;\n}\nsay $count;\n\nsub visit {\n my $s = shift;\n my $n = shift;\n my $time = $shops{$s}->{a} * $n + $shops{$s}->{b};\n delete($shops{$s});\n return $time;\n}\nsub minshop {\n my $now = shift;\n my %cal;\n for my $k (keys %shops){\n my $sum = $shops{$k}->{a} * $now + $shops{$k}->{b};\n $cal{$k} = $sum;\n }\n my @result = sort {$cal{$a} <=> $cal{$b}} keys %cal;\n return $result[0];\n}", "problem_context": "Score : 800 points\n\nProblem Statement\n\nThere are N stores called Store 1, Store 2, \\cdots, Store N. Takahashi, who is at his house at time 0, is planning to visit some of these stores.\n\nIt takes Takahashi one unit of time to travel from his house to one of the stores, or between any two stores.\n\nIf Takahashi reaches Store i at time t, he can do shopping there after standing in a queue for a_i \\times t + b_i units of time. (We assume that it takes no time other than waiting.)\n\nAll the stores close at time T + 0.5. If Takahashi is standing in a queue for some store then, he cannot do shopping there.\n\nTakahashi does not do shopping more than once in the same store.\n\nFind the maximum number of times he can do shopping before time T + 0.5.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq a_i \\leq 10^9\n\n0 \\leq b_i \\leq 10^9\n\n0 \\leq T \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\na_1 b_1\na_2 b_2\n\\vdots\na_N b_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 7\n2 0\n3 2\n0 3\n\nSample Output 1\n\n2\n\nHere is one possible way to visit stores:\n\nFrom time 0 to time 1: in 1 unit of time, he travels from his house to Store 1.\n\nFrom time 1 to time 3: for 2 units of time, he stands in a queue for Store 1 to do shopping.\n\nFrom time 3 to time 4: in 1 unit of time, he travels from Store 1 to Store 3.\n\nFrom time 4 to time 7: for 3 units of time, he stands in a queue for Store 3 to do shopping.\n\nIn this way, he can do shopping twice before time 7.5.\n\nSample Input 2\n\n1 3\n0 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 21600\n2 14\n3 22\n1 3\n1 10\n1 9\n\nSample Output 3\n\n5\n\nSample Input 4\n\n7 57\n0 25\n3 10\n2 4\n5 15\n3 22\n2 14\n1 15\n\nSample Output 4\n\n3", "sample_input": "3 7\n2 0\n3 2\n0 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02750", "source_text": "Score : 800 points\n\nProblem Statement\n\nThere are N stores called Store 1, Store 2, \\cdots, Store N. Takahashi, who is at his house at time 0, is planning to visit some of these stores.\n\nIt takes Takahashi one unit of time to travel from his house to one of the stores, or between any two stores.\n\nIf Takahashi reaches Store i at time t, he can do shopping there after standing in a queue for a_i \\times t + b_i units of time. (We assume that it takes no time other than waiting.)\n\nAll the stores close at time T + 0.5. If Takahashi is standing in a queue for some store then, he cannot do shopping there.\n\nTakahashi does not do shopping more than once in the same store.\n\nFind the maximum number of times he can do shopping before time T + 0.5.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq a_i \\leq 10^9\n\n0 \\leq b_i \\leq 10^9\n\n0 \\leq T \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\na_1 b_1\na_2 b_2\n\\vdots\na_N b_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 7\n2 0\n3 2\n0 3\n\nSample Output 1\n\n2\n\nHere is one possible way to visit stores:\n\nFrom time 0 to time 1: in 1 unit of time, he travels from his house to Store 1.\n\nFrom time 1 to time 3: for 2 units of time, he stands in a queue for Store 1 to do shopping.\n\nFrom time 3 to time 4: in 1 unit of time, he travels from Store 1 to Store 3.\n\nFrom time 4 to time 7: for 3 units of time, he stands in a queue for Store 3 to do shopping.\n\nIn this way, he can do shopping twice before time 7.5.\n\nSample Input 2\n\n1 3\n0 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 21600\n2 14\n3 22\n1 3\n1 10\n1 9\n\nSample Output 3\n\n5\n\nSample Input 4\n\n7 57\n0 25\n3 10\n2 4\n5 15\n3 22\n2 14\n1 15\n\nSample Output 4\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 959, "cpu_time_ms": 2111, "memory_kb": 128100}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s257227349", "group_id": "codeNet:p02751", "input_text": "$/=+<;\nchomp $s;\nif ($s eq 'AAA' or $s eq 'BBB') {\n print 'No';\n}\nelse {\n print 'Yes';\n}", "language": "Perl", "metadata": {"date": 1584282459, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02753.html", "problem_id": "p02753", "resource_group": "low_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/Perl/s008438445.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s008438445", "user_id": "u651946876"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $s = ;\nchomp $s;\nif ($s eq 'AAA' or $s eq 'BBB') {\n print 'No';\n}\nelse {\n print 'Yes';\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 104, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s946903590", "group_id": "codeNet:p02753", "input_text": "if ($S eq 'AAA' or $S eq 'BBB') {\n print \"No\";\n}\nelse {\n print \"Yes\";\n}", "language": "Perl", "metadata": {"date": 1584282233, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02753.html", "problem_id": "p02753", "resource_group": "low_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/Perl/s946903590.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s946903590", "user_id": "u651946876"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "if ($S eq 'AAA' or $S eq 'BBB') {\n print \"No\";\n}\nelse {\n print \"Yes\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 77, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s227141225", "group_id": "codeNet:p02754", "input_text": "sub min {\n ($a, $b) = @_;\n return $a < $b ? $a : $b;\n}\n\nuse integer;\n($n, $a, $b) = glob <>;\nprint $n / ($a + $b) * $a + min($n % ($a + $b), $a)\n", "language": "Perl", "metadata": {"date": 1600033148, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "low_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/Perl/s227141225.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s227141225", "user_id": "u172873334"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "sub min {\n ($a, $b) = @_;\n return $a < $b ? $a : $b;\n}\n\nuse integer;\n($n, $a, $b) = glob <>;\nprint $n / ($a + $b) * $a + min($n % ($a + $b), $a)\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 17, "memory_kb": 5332}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s871381517", "group_id": "codeNet:p02754", "input_text": "print$&*(<>!~/ .* /|$`/($&+$'))+$&-($-=$&-$`%($&+$'))", "language": "Perl", "metadata": {"date": 1583633518, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "low_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/Perl/s871381517.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s871381517", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "print$&*(<>!~/ .* /|$`/($&+$'))+$&-($-=$&-$`%($&+$'))", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s047468154", "group_id": "codeNet:p02755", "input_text": "($A,$B)=glob<>;printf grep(($_*.08|0)==$A&/^$B/,1..$<),-1", "language": "Perl", "metadata": {"date": 1583638150, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02755.html", "problem_id": "p02755", "resource_group": "low_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/Perl/s047468154.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s047468154", "user_id": "u657913472"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "($A,$B)=glob<>;printf grep(($_*.08|0)==$A&/^$B/,1..$<),-1", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 6, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s398650824", "group_id": "codeNet:p02756", "input_text": "my $s = <>;\nchomp $s;\nmy $Q = <>;\nmy $stat = 0;\nfor(my $i=0;$i<$Q;$i++){\n my @dat = split(/\\s+/,<>);\n if($dat[0]==1){\n if($stat){\n $stat = 0;\n }else{\n $stat = 1;\n }\n }else{\n if(($dat[1]+$stat)%2){\n $s = \"$dat[2]$s\";\n }else{\n $s .= \"$dat[2]\";\n }\n }\n}\nif($stat==1){\n $s = reverse($s);\n}\nprint \"$s\";\n", "language": "Perl", "metadata": {"date": 1589343480, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "low_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/Perl/s398650824.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s398650824", "user_id": "u464700044"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "my $s = <>;\nchomp $s;\nmy $Q = <>;\nmy $stat = 0;\nfor(my $i=0;$i<$Q;$i++){\n my @dat = split(/\\s+/,<>);\n if($dat[0]==1){\n if($stat){\n $stat = 0;\n }else{\n $stat = 1;\n }\n }else{\n if(($dat[1]+$stat)%2){\n $s = \"$dat[2]$s\";\n }else{\n $s .= \"$dat[2]\";\n }\n }\n}\nif($stat==1){\n $s = reverse($s);\n}\nprint \"$s\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2103, "memory_kb": 1404}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s996974349", "group_id": "codeNet:p02756", "input_text": "@_=<>=~/./g;/ . (.)/?splice(@_,$|+1-$&?0:@_,0,$1):--$|for<>;print$|?@_:reverse@_", "language": "Perl", "metadata": {"date": 1583644207, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "low_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/Perl/s996974349.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s996974349", "user_id": "u657913472"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "@_=<>=~/./g;/ . (.)/?splice(@_,$|+1-$&?0:@_,0,$1):--$|for<>;print$|?@_:reverse@_", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2106, "memory_kb": 42112}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s343170828", "group_id": "codeNet:p02756", "input_text": "$r_flg = 0;\n\nwhile(<>){\n\tchomp;\n\t$s = $_ if($. == 1);\n\tnext if($. == 2);\n\tif(/^1/){\n\t\tif($r_flg == 1){\n\t\t\t$r_flg = 0;\n\t\t}else{\n\t\t\t$r_flg = 1;\n\t\t}\n\t}else{\n\t\t($n , $f , $c) = split(/ /, $_);\n\t\tif($r_flg == 0){\n\t\t\tif($f == 1){\n\t\t\t\t$s = $c . $s;\n\t\t\t}else{\n\t\t\t\t$s = $s . $c;\n\t\t\t}\n\t\t}else{\n\t\t\tif($f == 1){\n\t\t\t\t$s = $s . $c;\n\t\t\t}else{\n\t\t\t\t$s = $c . $s;\n\t\t\t}\n\t\t}\n\t}\n}\n\n$s = reverse $s if($r_flg == 1);\nprint \"$s\\n\";\n", "language": "Perl", "metadata": {"date": 1583643068, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "low_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/Perl/s343170828.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s343170828", "user_id": "u609426052"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "$r_flg = 0;\n\nwhile(<>){\n\tchomp;\n\t$s = $_ if($. == 1);\n\tnext if($. == 2);\n\tif(/^1/){\n\t\tif($r_flg == 1){\n\t\t\t$r_flg = 0;\n\t\t}else{\n\t\t\t$r_flg = 1;\n\t\t}\n\t}else{\n\t\t($n , $f , $c) = split(/ /, $_);\n\t\tif($r_flg == 0){\n\t\t\tif($f == 1){\n\t\t\t\t$s = $c . $s;\n\t\t\t}else{\n\t\t\t\t$s = $s . $c;\n\t\t\t}\n\t\t}else{\n\t\t\tif($f == 1){\n\t\t\t\t$s = $s . $c;\n\t\t\t}else{\n\t\t\t\t$s = $c . $s;\n\t\t\t}\n\t\t}\n\t}\n}\n\n$s = reverse $s if($r_flg == 1);\nprint \"$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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 408, "cpu_time_ms": 2103, "memory_kb": 2176}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s430077980", "group_id": "codeNet:p02756", "input_text": "$b=glob<>;<>;/ .+ (.)/?$|+1-$&?$b:$a.=$1:--$|for<>;$_=reverse($a).$b;print$|?~~reverse:$_", "language": "Perl", "metadata": {"date": 1583641090, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "low_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/Perl/s430077980.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s430077980", "user_id": "u049095189"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "$b=glob<>;<>;/ .+ (.)/?$|+1-$&?$b:$a.=$1:--$|for<>;$_=reverse($a).$b;print$|?~~reverse:$_", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 241, "memory_kb": 32000}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s256490959", "group_id": "codeNet:p02757", "input_text": "($n,$p)=glob<>;@c=1;$\\+=10%$p?$c[($a+=$_*($.=$.*10%$p))%=$p]++:$n--*!($_%$p)for reverse`dd`=~/./g;print", "language": "Perl", "metadata": {"date": 1583651270, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02757.html", "problem_id": "p02757", "resource_group": "low_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/Perl/s256490959.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s256490959", "user_id": "u049095189"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "($n,$p)=glob<>;@c=1;$\\+=10%$p?$c[($a+=$_*($.=$.*10%$p))%=$p]++:$n--*!($_%$p)for reverse`dd`=~/./g;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 255, "memory_kb": 23244}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s748172691", "group_id": "codeNet:p02757", "input_text": "($n,$p)=glob<>;@c=$t=1;$\\+=10%$p?$c[$a=($a+$_*($t=$t*10%$p))%$p]++:$n--*!($_%$p)for reverse<>=~/./g;print", "language": "Perl", "metadata": {"date": 1583646908, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02757.html", "problem_id": "p02757", "resource_group": "low_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/Perl/s748172691.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s748172691", "user_id": "u049095189"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "($n,$p)=glob<>;@c=$t=1;$\\+=10%$p?$c[$a=($a+$_*($t=$t*10%$p))%$p]++:$n--*!($_%$p)for reverse<>=~/./g;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 105, "cpu_time_ms": 214, "memory_kb": 23296}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s990974335", "group_id": "codeNet:p02759", "input_text": "print int((<>+1)/2)", "language": "Perl", "metadata": {"date": 1599961805, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "low_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/Perl/s990974335.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s990974335", "user_id": "u172873334"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "print int((<>+1)/2)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 19, "cpu_time_ms": 3, "memory_kb": 4568}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s694256492", "group_id": "codeNet:p02759", "input_text": "#!/usr/bin/perl\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,scalar());\n\nmy $r = int(( $n + 1 ) / 2);\n\nprint \"$r\\n\";\n", "language": "Perl", "metadata": {"date": 1598209549, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "low_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/Perl/s694256492.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s694256492", "user_id": "u750383873"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,scalar());\n\nmy $r = int(( $n + 1 ) / 2);\n\nprint \"$r\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 117, "cpu_time_ms": 8, "memory_kb": 4820}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s584683346", "group_id": "codeNet:p02759", "input_text": "#!/usr/bin/perl\n\n# 引数取り込み\nmy $a = <>;\n\n# 処理開始\nmy $ans = ( $a + 1 ) / 2;\n\nprint $ans;\n\n1;", "language": "Perl", "metadata": {"date": 1594058454, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "low_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/Perl/s584683346.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s584683346", "user_id": "u286255470"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\n# 引数取り込み\nmy $a = <>;\n\n# 処理開始\nmy $ans = ( $a + 1 ) / 2;\n\nprint $ans;\n\n1;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 108, "cpu_time_ms": 3, "memory_kb": 4588}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s693957449", "group_id": "codeNet:p02759", "input_text": "use strict;\nuse warnings;\n\nmy $n = ;\nchomp $n;\n\nif ($n%2==0) {\n $n /= 2;\n} else {\n $n = int($n / 2) + 1;\n}\nprint $n, \"\\n\";", "language": "Perl", "metadata": {"date": 1583117237, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "low_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/Perl/s693957449.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s693957449", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $n = ;\nchomp $n;\n\nif ($n%2==0) {\n $n /= 2;\n} else {\n $n = int($n / 2) + 1;\n}\nprint $n, \"\\n\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 131, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s367307899", "group_id": "codeNet:p02759", "input_text": "use POSIX qw(floor ceil);\n$N = glob<>;\nprint ceil($N/2);", "language": "Perl", "metadata": {"date": 1583115772, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "low_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/Perl/s367307899.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s367307899", "user_id": "u616750926"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use POSIX qw(floor ceil);\n$N = glob<>;\nprint ceil($N/2);", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 56, "cpu_time_ms": 12, "memory_kb": 1792}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s724658491", "group_id": "codeNet:p02760", "input_text": "print( solve() ? \"Yes\" : \"No\", \"\\n\");\n\nsub solve {\n my $card = [];\n for (0..2) {\n my $l = ;\n chomp $l;\n $card->[$_] = [ split / /, $l ];\n }\n my $n = ;\n chomp $n;\n my $b_set = {};\n for (1..$n) {\n my $b = ;\n chomp $b;\n $b_set->{$b} = 1;\n }\n\n my $bingo = {};\n for my $i (0..2) {\n if ( %{$b_set}{ @{ $card->[$i] } } ) {\n return 1;\n }\n }\n\n for my $j (0..2) {\n if ( %{ $b_set }{ ( $card->[0]->[$j], $card->[1]->[$j], $card->[2]->[$j] ) } ) {\n return 1;\n }\n }\n\n if ( %{ $b_set }{ map { $card->[$_]->[$_] } 0,1,2 } ) {\n return 1;\n }\n\n if ( %{ $b_set }{ ( $card->[0]->[2], $card->[1]->[1], $card->[2]->[0] ) } ) {\n return 1;\n }\n\n return 0;\n}\n", "language": "Perl", "metadata": {"date": 1583118146, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02760.html", "problem_id": "p02760", "resource_group": "low_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/Perl/s724658491.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s724658491", "user_id": "u706084687"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print( solve() ? \"Yes\" : \"No\", \"\\n\");\n\nsub solve {\n my $card = [];\n for (0..2) {\n my $l = ;\n chomp $l;\n $card->[$_] = [ split / /, $l ];\n }\n my $n = ;\n chomp $n;\n my $b_set = {};\n for (1..$n) {\n my $b = ;\n chomp $b;\n $b_set->{$b} = 1;\n }\n\n my $bingo = {};\n for my $i (0..2) {\n if ( %{$b_set}{ @{ $card->[$i] } } ) {\n return 1;\n }\n }\n\n for my $j (0..2) {\n if ( %{ $b_set }{ ( $card->[0]->[$j], $card->[1]->[$j], $card->[2]->[$j] ) } ) {\n return 1;\n }\n }\n\n if ( %{ $b_set }{ map { $card->[$_]->[$_] } 0,1,2 } ) {\n return 1;\n }\n\n if ( %{ $b_set }{ ( $card->[0]->[2], $card->[1]->[1], $card->[2]->[0] ) } ) {\n return 1;\n }\n\n return 0;\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 252, "memory_kb": 62424}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s249944810", "group_id": "codeNet:p02760", "input_text": "use strict;\n\nprint( solve() ? \"Yes\" : \"No\", \"\\n\");\n\n\nsub solve {\n my $card = [];\n for (0..2) {\n my $l = ;\n chomp $l;\n $card->[$_] = [ split / /, $l ];\n }\n my $n = ;\n chomp $n;\n my $b_set = {};\n for (1..$n) {\n my $b = ;\n chomp $b;\n $b_set->{$b} = 1;\n }\n\n my $bingo = {};\n for my $i (0..2) {\n if ( %{$b_set}{ @{ $card->[$i] } } ) {\n return 1;\n }\n }\n\n for my $j (0..2) {\n if ( %{ $b_set }{ ( $card->[0]->[$j], $card->[1]->[$j], $card->[2]->[$j] ) } ) {\n return 1;\n }\n }\n\n if ( %{ $b_set }{ map { $card->[$_]->[$_] } 0,1,2 } ) {\n return 1;\n }\n\n if ( %{ $b_set }{ ( $card->[0]->[2], $card->[1]->[1], $card->[2]->[0] ) } ) {\n return 1;\n }\n\n return 0;\n}\n~", "language": "Perl", "metadata": {"date": 1583117189, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02760.html", "problem_id": "p02760", "resource_group": "low_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/Perl/s249944810.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s249944810", "user_id": "u706084687"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use strict;\n\nprint( solve() ? \"Yes\" : \"No\", \"\\n\");\n\n\nsub solve {\n my $card = [];\n for (0..2) {\n my $l = ;\n chomp $l;\n $card->[$_] = [ split / /, $l ];\n }\n my $n = ;\n chomp $n;\n my $b_set = {};\n for (1..$n) {\n my $b = ;\n chomp $b;\n $b_set->{$b} = 1;\n }\n\n my $bingo = {};\n for my $i (0..2) {\n if ( %{$b_set}{ @{ $card->[$i] } } ) {\n return 1;\n }\n }\n\n for my $j (0..2) {\n if ( %{ $b_set }{ ( $card->[0]->[$j], $card->[1]->[$j], $card->[2]->[$j] ) } ) {\n return 1;\n }\n }\n\n if ( %{ $b_set }{ map { $card->[$_]->[$_] } 0,1,2 } ) {\n return 1;\n }\n\n if ( %{ $b_set }{ ( $card->[0]->[2], $card->[1]->[1], $card->[2]->[0] ) } ) {\n return 1;\n }\n\n return 0;\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1021, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s754964585", "group_id": "codeNet:p02766", "input_text": "use strict;\nuse warnings;\n\nchomp(my $nk = <>);\nmy ($n, $k) = split(/ /, $nk);\n\nmy $index = 0;\nmy $check = 1;\n\nwhile ($check > 0){\n $index++;\n $check = int ($n / ($k ** $index) );\n}\n\nprint \"$index\\n\";", "language": "Perl", "metadata": {"date": 1582425597, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02766.html", "problem_id": "p02766", "resource_group": "low_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/Perl/s754964585.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s754964585", "user_id": "u783415940"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nchomp(my $nk = <>);\nmy ($n, $k) = split(/ /, $nk);\n\nmy $index = 0;\nmy $check = 1;\n\nwhile ($check > 0){\n $index++;\n $check = int ($n / ($k ** $index) );\n}\n\nprint \"$index\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s603324154", "group_id": "codeNet:p02767", "input_text": "get;say min map {sum (@($||=words)X-$_)>>²},^99", "language": "Perl", "metadata": {"date": 1596791117, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02767.html", "problem_id": "p02767", "resource_group": "low_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/Perl/s603324154.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s603324154", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "get;say min map {sum (@($||=words)X-$_)>>²},^99", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 48, "cpu_time_ms": 327, "memory_kb": 95336}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s876778756", "group_id": "codeNet:p02771", "input_text": "say [get.words.Set==2]", "language": "Perl", "metadata": {"date": 1581883340, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02771.html", "problem_id": "p02771", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02771/input.txt", "sample_output_relpath": "derived/input_output/data/p02771/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02771/Perl/s876778756.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s876778756", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "say [get.words.Set==2]", "problem_context": "Score: 100 points\n\nProblem Statement\n\nA triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.\n\nYou will be given three integers A, B, and C. If this triple is poor, print Yes; otherwise, print No.\n\nConstraints\n\nA, B, and C are all integers between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the given triple is poor, print Yes; otherwise, print No.\n\nSample Input 1\n\n5 7 5\n\nSample Output 1\n\nYes\n\nA and C are equal, but B is different from those two numbers, so this triple is poor.\n\nSample Input 2\n\n4 4 4\n\nSample Output 2\n\nNo\n\nA, B, and C are all equal, so this triple is not poor.\n\nSample Input 3\n\n4 9 6\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3 3 4\n\nSample Output 4\n\nYes", "sample_input": "5 7 5\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02771", "source_text": "Score: 100 points\n\nProblem Statement\n\nA triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.\n\nYou will be given three integers A, B, and C. If this triple is poor, print Yes; otherwise, print No.\n\nConstraints\n\nA, B, and C are all integers between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the given triple is poor, print Yes; otherwise, print No.\n\nSample Input 1\n\n5 7 5\n\nSample Output 1\n\nYes\n\nA and C are equal, but B is different from those two numbers, so this triple is poor.\n\nSample Input 2\n\n4 4 4\n\nSample Output 2\n\nNo\n\nA, B, and C are all equal, so this triple is not poor.\n\nSample Input 3\n\n4 9 6\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3 3 4\n\nSample Output 4\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 446, "memory_kb": 62328}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s523684017", "group_id": "codeNet:p02772", "input_text": "my $N = glob<>;\nmy @A = glob<>;\nmy $r = 1;\nmy $i = 0;\nwhile($r && $i < $N){\n if($A[$i]%2==0){\n $r = (!$A[$i]%3 || !$A[$i]%5) ? 1 : 0;\n }\n $i++;\n}\nmy $m = $r ? \"APPROVED\" : \"DENIED\";\nprint $m;", "language": "Perl", "metadata": {"date": 1582567900, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02772.html", "problem_id": "p02772", "resource_group": "low_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/Perl/s523684017.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s523684017", "user_id": "u616750926"}, "prompt_components": {"gold_output": "APPROVED\n", "input_to_evaluate": "my $N = glob<>;\nmy @A = glob<>;\nmy $r = 1;\nmy $i = 0;\nwhile($r && $i < $N){\n if($A[$i]%2==0){\n $r = (!$A[$i]%3 || !$A[$i]%5) ? 1 : 0;\n }\n $i++;\n}\nmy $m = $r ? \"APPROVED\" : \"DENIED\";\nprint $m;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s161133158", "group_id": "codeNet:p02772", "input_text": "print<>*grep($_%3*/[248]$/,glob<>)?DENI:APPROV,ED\n", "language": "Perl", "metadata": {"date": 1582151545, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02772.html", "problem_id": "p02772", "resource_group": "low_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/Perl/s161133158.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s161133158", "user_id": "u049095189"}, "prompt_components": {"gold_output": "APPROVED\n", "input_to_evaluate": "print<>*grep($_%3*/[248]$/,glob<>)?DENI:APPROV,ED\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 50, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s103065072", "group_id": "codeNet:p02772", "input_text": "use v6;\n\nmy $n = +get;\nmy @a = +<;print grep$-=$$_-=@_-2,grep\\$_[++$$_],`sort`", "language": "Perl", "metadata": {"date": 1583971470, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02773.html", "problem_id": "p02773", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02773/input.txt", "sample_output_relpath": "derived/input_output/data/p02773/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02773/Perl/s346004727.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s346004727", "user_id": "u657913472"}, "prompt_components": {"gold_output": "beet\nvet\n", "input_to_evaluate": "<>;print grep$-=$$_-=@_-2,grep\\$_[++$$_],`sort`", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "sample_input": "7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n"}, "reference_outputs": ["beet\nvet\n"], "source_document_id": "p02773", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 784, "memory_kb": 80152}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s228953050", "group_id": "codeNet:p02775", "input_text": "$\\+=$'.$_>54?++$_+10-2*$':$_,/^/ for<>=~/./gs;print", "language": "Perl", "metadata": {"date": 1582344623, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02775.html", "problem_id": "p02775", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02775/input.txt", "sample_output_relpath": "derived/input_output/data/p02775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02775/Perl/s228953050.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s228953050", "user_id": "u283869437"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "$\\+=$'.$_>54?++$_+10-2*$':$_,/^/ for<>=~/./gs;print", "problem_context": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "sample_input": "36\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02775", "source_text": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 1371, "memory_kb": 112548}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s155441082", "group_id": "codeNet:p02775", "input_text": "$\\+=$'.int>54?10-$'+!++$_:$',/^/ for<>=~/./gs,0;print", "language": "Perl", "metadata": {"date": 1582245466, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02775.html", "problem_id": "p02775", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02775/input.txt", "sample_output_relpath": "derived/input_output/data/p02775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02775/Perl/s155441082.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s155441082", "user_id": "u657913472"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "$\\+=$'.int>54?10-$'+!++$_:$',/^/ for<>=~/./gs,0;print", "problem_context": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "sample_input": "36\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02775", "source_text": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1379, "memory_kb": 112548}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s621854223", "group_id": "codeNet:p02778", "input_text": "my $S = glob<>;\n$S =~ s/./x/g;\nprint $S;\n", "language": "Perl", "metadata": {"date": 1582997409, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02778.html", "problem_id": "p02778", "resource_group": "low_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/Perl/s621854223.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s621854223", "user_id": "u616750926"}, "prompt_components": {"gold_output": "xxxxxxx\n", "input_to_evaluate": "my $S = glob<>;\n$S =~ s/./x/g;\nprint $S;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 41, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s926285828", "group_id": "codeNet:p02779", "input_text": "<>;\nfor(split /\\s+/, <>){\n if($h{$_}++ > 1){\n print \"NO\";\n exit;\n }\n}\nprint \"YES\";\n", "language": "Perl", "metadata": {"date": 1588888155, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "low_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/Perl/s926285828.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s926285828", "user_id": "u020604402"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "<>;\nfor(split /\\s+/, <>){\n if($h{$_}++ > 1){\n print \"NO\";\n exit;\n }\n}\nprint \"YES\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 134, "memory_kb": 45732}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s564797769", "group_id": "codeNet:p02779", "input_text": "<>;\nfor(split / /, <>){\n $h{$_}++;\n}\nfor(values %h){\n if($_ > 1){\n print \"No\";\n exit;\n }\n}\nprint \"Yes\";\n", "language": "Perl", "metadata": {"date": 1588887846, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "low_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/Perl/s564797769.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s564797769", "user_id": "u020604402"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "<>;\nfor(split / /, <>){\n $h{$_}++;\n}\nfor(values %h){\n if($_ > 1){\n print \"No\";\n exit;\n }\n}\nprint \"Yes\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 127, "cpu_time_ms": 140, "memory_kb": 45644}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s683229723", "group_id": "codeNet:p02779", "input_text": "print<>*grep(++$#$_,glob<>)?NO:YES", "language": "Perl", "metadata": {"date": 1581279278, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "low_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/Perl/s683229723.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s683229723", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "print<>*grep(++$#$_,glob<>)?NO:YES", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 34, "cpu_time_ms": 793, "memory_kb": 178092}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s065500420", "group_id": "codeNet:p02780", "input_text": "<>=~$\";$%+=$-=-$S[-$']+($S[@S]=$S+=++$_)-$%for@_=glob<>;print$%/2", "language": "Perl", "metadata": {"date": 1581282511, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "low_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/Perl/s065500420.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s065500420", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7.000000000000\n", "input_to_evaluate": "<>=~$\";$%+=$-=-$S[-$']+($S[@S]=$S+=++$_)-$%for@_=glob<>;print$%/2", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 385, "memory_kb": 63532}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s442046242", "group_id": "codeNet:p02780", "input_text": "#!/usr/bin/perl\nmy ($n,$k) = map { $_ - 0 } split(/\\s+/,);\nmy @p = map { $_ - 0 } split(/\\s+/,);\n\nmy @t = ();\n$#t = 1+$#p;\n$t[0] = 0;\nfor(my $i = 0; $i<$n;$i++){\n my $pp = $p[$i];\n $t[$i+1] = $t[$i] + ( 0.5 * (1 + $pp) );\n}\n\nmy $mx = -1;\nfor(my $i = $k; $i<=$n;$i++){\n my $s = $t[$i] - $t[$i - $k];\n $mx = $s if $s - 0 > $mx;\n}\nprint \"$mx\\n\";\n\n", "language": "Perl", "metadata": {"date": 1581279236, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "low_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/Perl/s442046242.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s442046242", "user_id": "u750383873"}, "prompt_components": {"gold_output": "7.000000000000\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n,$k) = map { $_ - 0 } split(/\\s+/,);\nmy @p = map { $_ - 0 } split(/\\s+/,);\n\nmy @t = ();\n$#t = 1+$#p;\n$t[0] = 0;\nfor(my $i = 0; $i<$n;$i++){\n my $pp = $p[$i];\n $t[$i+1] = $t[$i] + ( 0.5 * (1 + $pp) );\n}\n\nmy $mx = -1;\nfor(my $i = $k; $i<=$n;$i++){\n my $s = $t[$i] - $t[$i - $k];\n $mx = $s if $s - 0 > $mx;\n}\nprint \"$mx\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 362, "cpu_time_ms": 246, "memory_kb": 40396}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s301254022", "group_id": "codeNet:p02781", "input_text": "$_={\n\t$^a*$^b>0??$_($^a div 10,$^b)+$^a%10*$_($^a div 10,$^b-1)+ +^$^a%10*$_($^a div 10-1,$^b-1)!!$^a>=$^b\n}\nsay $_(+get,+get)", "language": "Perl", "metadata": {"date": 1581362460, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02781.html", "problem_id": "p02781", "resource_group": "low_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/Perl/s301254022.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s301254022", "user_id": "u657913472"}, "prompt_components": {"gold_output": "19\n", "input_to_evaluate": "$_={\n\t$^a*$^b>0??$_($^a div 10,$^b)+$^a%10*$_($^a div 10,$^b-1)+ +^$^a%10*$_($^a div 10-1,$^b-1)!!$^a>=$^b\n}\nsay $_(+get,+get)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2109, "memory_kb": 81288}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s863854520", "group_id": "codeNet:p02783", "input_text": "<>=~$\";print int(($`+$'-1)/$')", "language": "Perl", "metadata": {"date": 1599943955, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02783.html", "problem_id": "p02783", "resource_group": "low_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/Perl/s863854520.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s863854520", "user_id": "u172873334"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>=~$\";print int(($`+$'-1)/$')", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 6, "memory_kb": 4740}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s040962183", "group_id": "codeNet:p02783", "input_text": "$a = ;\n$a =~ s/\\s+$//;\n($hp, $at) = split (/ /, $a);\n$num = int(($hp-1)/$at)+1;\nprint $num", "language": "Perl", "metadata": {"date": 1581253371, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02783.html", "problem_id": "p02783", "resource_group": "low_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/Perl/s040962183.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s040962183", "user_id": "u865563390"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$a = ;\n$a =~ s/\\s+$//;\n($hp, $at) = split (/ /, $a);\n$num = int(($hp-1)/$at)+1;\nprint $num", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s040617995", "group_id": "codeNet:p02783", "input_text": "use POSIX qw(ceil);\nmy $s = ;\nmy @s = split(/ /,$s);\nmy $ans = ceil($s[0]/$s[1]);\nprint \"$ans\";", "language": "Perl", "metadata": {"date": 1580249719, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02783.html", "problem_id": "p02783", "resource_group": "low_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/Perl/s040617995.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s040617995", "user_id": "u464700044"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use POSIX qw(ceil);\nmy $s = ;\nmy @s = split(/ /,$s);\nmy $ans = ceil($s[0]/$s[1]);\nprint \"$ans\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 102, "cpu_time_ms": 12, "memory_kb": 1920}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s742827966", "group_id": "codeNet:p02784", "input_text": "$s-=<>;grep{$s+=$_}split$\",<>;print$s<0?No:Yes", "language": "Perl", "metadata": {"date": 1580073785, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02784.html", "problem_id": "p02784", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02784/input.txt", "sample_output_relpath": "derived/input_output/data/p02784/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02784/Perl/s742827966.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s742827966", "user_id": "u207056619"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$s-=<>;grep{$s+=$_}split$\",<>;print$s<0?No:Yes", "problem_context": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\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\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "sample_input": "10 3\n4 5 6\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02784", "source_text": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\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\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 36, "memory_kb": 12068}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s433541581", "group_id": "codeNet:p02784", "input_text": "$/=get.words;say [$0>get.words.sum]", "language": "Perl", "metadata": {"date": 1580069112, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02784.html", "problem_id": "p02784", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02784/input.txt", "sample_output_relpath": "derived/input_output/data/p02784/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02784/Perl/s433541581.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s433541581", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$/=get.words;say [$0>get.words.sum]", "problem_context": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\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\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "sample_input": "10 3\n4 5 6\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02784", "source_text": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\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\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 2109, "memory_kb": 76236}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s832695450", "group_id": "codeNet:p02785", "input_text": "use List::Util qw/sum/;\nmy($N,$K) = glob<>;\nmy(@H) = glob<>;\n@H = sort {@a > @b} @H;\nmy $count = 0;\nfor(my $i = 0; $i < $N){\n if($K > 0){\n $count ++;\n continue;\n }\n for(my $point = @H[$i] ; $point > 0; $point--){\n $count++;\n }\n}\nprint $count;", "language": "Perl", "metadata": {"date": 1581172454, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02785.html", "problem_id": "p02785", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02785/input.txt", "sample_output_relpath": "derived/input_output/data/p02785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02785/Perl/s832695450.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s832695450", "user_id": "u616750926"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "use List::Util qw/sum/;\nmy($N,$K) = glob<>;\nmy(@H) = glob<>;\n@H = sort {@a > @b} @H;\nmy $count = 0;\nfor(my $i = 0; $i < $N){\n if($K > 0){\n $count ++;\n continue;\n }\n for(my $point = @H[$i] ; $point > 0; $point--){\n $count++;\n }\n}\nprint $count;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_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\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 1\n4 1 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02785", "source_text": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_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\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s668002093", "group_id": "codeNet:p02786", "input_text": "my $s = ;\n\n$ans = 0;\n$N = 1;\nfor(my $i=0;$i<50;$i++){\n#print \"$i $N \\n\";\n $s = int($s/2);\n $ans = $ans + $N;\n if($s==0){\n print $ans;\n exit;\n }\n $N = $N *2;\n}\n", "language": "Perl", "metadata": {"date": 1580071466, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02786.html", "problem_id": "p02786", "resource_group": "low_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/Perl/s668002093.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s668002093", "user_id": "u464700044"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my $s = ;\n\n$ans = 0;\n$N = 1;\nfor(my $i=0;$i<50;$i++){\n#print \"$i $N \\n\";\n $s = int($s/2);\n $ans = $ans + $N;\n if($s==0){\n print $ans;\n exit;\n }\n $N = $N *2;\n}\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 177, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s288488666", "group_id": "codeNet:p02787", "input_text": "use strict;\nmy $s = ;\n\n\nmy @data ;# \nmy ($H,$N) = split(/ /,$s);\nchomp($N);\n$data[0]=0;\n#print \"0 \";\nfor(my $i=1;$i<=$H;$i++){\n $data[$i] = 10**8;#モンスターの体力を i 減らすため消耗する魔力の最小値\n #print \"$i \";\n}\n#print \"\\n\";\nmy @AP;\nmy @MP;\nfor(my $i=0;$i<=$N;$i++){\n $s = ;\n ($AP[$i],$MP[$i]) = split(/ /,$s);\n chomp($MP[$i]);\n}\n\nfor(my $i=$N;$i>0;$i--){#逆からにしてみる\n my $chflag = 0;\n for(my $j=1;$j<=$H;$j++){\n if( ($j-$AP[$i]) <= 0 ){\n if( $data[$j] >= $MP[$i] ){\n $data[$j] = $MP[$i];\n $chflag = 1;\n }\n }else{\n if( $chflag == 0){last;}\n if( $data[$j] > $data[$j-$AP[$i]] + $MP[$i] ){\n $data[$j] = $data[$j-$AP[$i]] + $MP[$i];\n }\n } \n }\n} \nprint \"$data[$H]\";", "language": "Perl", "metadata": {"date": 1580775045, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02787.html", "problem_id": "p02787", "resource_group": "low_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/Perl/s288488666.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s288488666", "user_id": "u464700044"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use strict;\nmy $s = ;\n\n\nmy @data ;# \nmy ($H,$N) = split(/ /,$s);\nchomp($N);\n$data[0]=0;\n#print \"0 \";\nfor(my $i=1;$i<=$H;$i++){\n $data[$i] = 10**8;#モンスターの体力を i 減らすため消耗する魔力の最小値\n #print \"$i \";\n}\n#print \"\\n\";\nmy @AP;\nmy @MP;\nfor(my $i=0;$i<=$N;$i++){\n $s = ;\n ($AP[$i],$MP[$i]) = split(/ /,$s);\n chomp($MP[$i]);\n}\n\nfor(my $i=$N;$i>0;$i--){#逆からにしてみる\n my $chflag = 0;\n for(my $j=1;$j<=$H;$j++){\n if( ($j-$AP[$i]) <= 0 ){\n if( $data[$j] >= $MP[$i] ){\n $data[$j] = $MP[$i];\n $chflag = 1;\n }\n }else{\n if( $chflag == 0){last;}\n if( $data[$j] > $data[$j-$AP[$i]] + $MP[$i] ){\n $data[$j] = $data[$j-$AP[$i]] + $MP[$i];\n }\n } \n }\n} \nprint \"$data[$H]\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 811, "cpu_time_ms": 2103, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s872561720", "group_id": "codeNet:p02789", "input_text": "print<>=~/(\\d+)\\s\\1/?Yes:No", "language": "Perl", "metadata": {"date": 1599944013, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02789.html", "problem_id": "p02789", "resource_group": "low_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/Perl/s872561720.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s872561720", "user_id": "u172873334"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print<>=~/(\\d+)\\s\\1/?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 27, "cpu_time_ms": 3, "memory_kb": 4844}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s181542358", "group_id": "codeNet:p02789", "input_text": "$/=$\";print<>-<>?NO:YES", "language": "Perl", "metadata": {"date": 1579798469, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02789.html", "problem_id": "p02789", "resource_group": "low_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/Perl/s181542358.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s181542358", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$/=$\";print<>-<>?NO:YES", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 23, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s180744890", "group_id": "codeNet:p02790", "input_text": "($/,$_)=words.sort;put $/x$_", "language": "Perl", "metadata": {"date": 1579494117, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02790.html", "problem_id": "p02790", "resource_group": "low_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/Perl/s180744890.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s180744890", "user_id": "u207056619"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": "($/,$_)=words.sort;put $/x$_", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 28, "cpu_time_ms": 266, "memory_kb": 64028}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s312937491", "group_id": "codeNet:p02791", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nmy @p = split / /, ;\nmy $ans = 0;\nmy $m = $p[0];\nfor (my $i=0; $i<$n; $i++) {\n if($m >= $p[$i]) {\n $ans++;\n $m = $p[$i];\n }\n}\nsay $ans;", "language": "Perl", "metadata": {"date": 1584605824, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "low_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/Perl/s312937491.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s312937491", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nmy @p = split / /, ;\nmy $ans = 0;\nmy $m = $p[0];\nfor (my $i=0; $i<$n; $i++) {\n if($m >= $p[$i]) {\n $ans++;\n $m = $p[$i];\n }\n}\nsay $ans;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 123, "memory_kb": 33572}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s598202248", "group_id": "codeNet:p02791", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nmy @p = split / /, ;\nmy $ans = 0;\nfor (my $i=0; $i<$n; $i++) {\n my @q = @p[0..$i];\n my $m = min @q;\n if($m == $q[$#q]) {\n $ans++;\n }\n}\nsay $ans;", "language": "Perl", "metadata": {"date": 1584605553, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "low_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/Perl/s598202248.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s598202248", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nmy @p = split / /, ;\nmy $ans = 0;\nfor (my $i=0; $i<$n; $i++) {\n my @q = @p[0..$i];\n my $m = min @q;\n if($m == $q[$#q]) {\n $ans++;\n }\n}\nsay $ans;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2105, "memory_kb": 31012}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s103183666", "group_id": "codeNet:p02791", "input_text": "$:=<>;$\\+=$_<=($:-=$-=$:-$_)for glob<>;print", "language": "Perl", "metadata": {"date": 1579468081, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "low_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/Perl/s103183666.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s103183666", "user_id": "u049095189"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$:=<>;$\\+=$_<=($:-=$-=$:-$_)for glob<>;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 44, "cpu_time_ms": 861, "memory_kb": 41656}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s552896926", "group_id": "codeNet:p02791", "input_text": "$.+=<>;print 0+grep{$.-=$-=$.-$_,$-}glob<>", "language": "Perl", "metadata": {"date": 1579467428, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "low_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/Perl/s552896926.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s552896926", "user_id": "u032223772"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$.+=<>;print 0+grep{$.-=$-=$.-$_,$-}glob<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 777, "memory_kb": 41708}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s959295539", "group_id": "codeNet:p02791", "input_text": "$:=<>;$:-=$-=$:-$_,$\\+=$_<=$:for glob<>;print", "language": "Perl", "metadata": {"date": 1579466653, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "low_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/Perl/s959295539.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s959295539", "user_id": "u049095189"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$:=<>;$:-=$-=$:-$_,$\\+=$_<=$:for glob<>;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 751, "memory_kb": 41656}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s996501448", "group_id": "codeNet:p02791", "input_text": "get;say +get.words", "language": "Perl", "metadata": {"date": 1579464985, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "low_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/Perl/s996501448.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s996501448", "user_id": "u032223772"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "get;say +get.words", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 18, "cpu_time_ms": 537, "memory_kb": 80128}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s698937777", "group_id": "codeNet:p02792", "input_text": "map{/./,$_[$&.$_%10]++for//..<>;$\\+=$_[$_.$']*$_[$'.$_]for 0..9}0..9;print", "language": "Perl", "metadata": {"date": 1579467882, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02792.html", "problem_id": "p02792", "resource_group": "low_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/Perl/s698937777.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s698937777", "user_id": "u657913472"}, "prompt_components": {"gold_output": "17\n", "input_to_evaluate": "map{/./,$_[$&.$_%10]++for//..<>;$\\+=$_[$_.$']*$_[$'.$_]for 0..9}0..9;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 110, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s748605570", "group_id": "codeNet:p02795", "input_text": "say + ^min 1/get xx 2 X*get", "language": "Perl", "metadata": {"date": 1579418222, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02795.html", "problem_id": "p02795", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02795/input.txt", "sample_output_relpath": "derived/input_output/data/p02795/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02795/Perl/s748605570.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s748605570", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "say + ^min 1/get xx 2 X*get", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "sample_input": "3\n7\n10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02795", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 27, "cpu_time_ms": 265, "memory_kb": 62104}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s972109311", "group_id": "codeNet:p02795", "input_text": "#! /usr/bin/env perl\nuse strict;\nuse warnings;\nuse POSIX qw(ceil);\n\nmy $H = <>;\nchomp $H;\n\nmy $W = <>;\nchomp $W;\n\nmy $N = <>;\nchomp $N;\n\nmy $tmp1 = $N/$W;\nmy $tmp2 = $N/$H;\n\nif($tmp1 > $tmp2){\n print ceil($tmp2);\n}\nelse{\n print ceil($tmp1);\n}\n", "language": "Perl", "metadata": {"date": 1579378028, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02795.html", "problem_id": "p02795", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02795/input.txt", "sample_output_relpath": "derived/input_output/data/p02795/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02795/Perl/s972109311.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s972109311", "user_id": "u379254887"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#! /usr/bin/env perl\nuse strict;\nuse warnings;\nuse POSIX qw(ceil);\n\nmy $H = <>;\nchomp $H;\n\nmy $W = <>;\nchomp $W;\n\nmy $N = <>;\nchomp $N;\n\nmy $tmp1 = $N/$W;\nmy $tmp2 = $N/$H;\n\nif($tmp1 > $tmp2){\n print ceil($tmp2);\n}\nelse{\n print ceil($tmp1);\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "sample_input": "3\n7\n10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02795", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 249, "cpu_time_ms": 12, "memory_kb": 1792}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s685949670", "group_id": "codeNet:p02796", "input_text": "<>;print~~grep$'<;print~~grep$'<;\nmy (@x, @l);\n{\n for (my $i=0; $i<$n; $i++)\n {\n my $in = ;\n ($x[$i], $l[$i]) = split(\" \", $in);\n }\n}\nmy %h;\nmy %l2;\nfor (my $i=0; $i<$n; $i++) {\n $h{$x[$i]} = $l[$i]+$l[$i];\n $l2{$x[$i]} = $x[$i]-$l[$i];\n}\n{\n my $i=0;\n for my $key (sort {$a <=> $b} keys %h)\n {\n $x[$i] = $key;\n $i++;\n }\n}\n\nmy $rn = $n;\nfor (my $i=0; $i<$rn; $i++)\n{\n for (my $j=$i+1; $j<$rn; $j++)\n {\n if ($h[$i]>$l2[$j])\n {\n $rn--;\n splice(@x, $i+1, 1);\n }\n }\n}\n\nprint \"$rn\\n\";", "language": "Perl", "metadata": {"date": 1579448514, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02796.html", "problem_id": "p02796", "resource_group": "low_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/Perl/s189042402.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s189042402", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nmy (@x, @l);\n{\n for (my $i=0; $i<$n; $i++)\n {\n my $in = ;\n ($x[$i], $l[$i]) = split(\" \", $in);\n }\n}\nmy %h;\nmy %l2;\nfor (my $i=0; $i<$n; $i++) {\n $h{$x[$i]} = $l[$i]+$l[$i];\n $l2{$x[$i]} = $x[$i]-$l[$i];\n}\n{\n my $i=0;\n for my $key (sort {$a <=> $b} keys %h)\n {\n $x[$i] = $key;\n $i++;\n }\n}\n\nmy $rn = $n;\nfor (my $i=0; $i<$rn; $i++)\n{\n for (my $j=$i+1; $j<$rn; $j++)\n {\n if ($h[$i]>$l2[$j])\n {\n $rn--;\n splice(@x, $i+1, 1);\n }\n }\n}\n\nprint \"$rn\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s941795960", "group_id": "codeNet:p02796", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nmy (@x, @l);\n{\n for (my $i=0; $i<$n; $i++)\n {\n my $in = ;\n ($x[$i], $l[$i]) = split(\" \", $in);\n }\n}\nmy %h;\nfor (my $i=0; $i<$n; $i++) {\n $h{$x[$i]} = $l[$i];\n}\n{\n my $i=0;\n for my $key (sort {$a <=> $b} keys %h)\n {\n $x[$i] = $key;\n $l[$i] = $h{$key};\n $i++;\n }\n}\nmy $func2 = sub\n{\n my $cnt = 0;\n $cnt = 1 if $x[$_[0]]+$l[$_[0]]>$x[$_[1]]-$l[$_[1]];\n return $cnt;\n};\n\nmy $rn = $n;\nfor (my $i=0; $i<$rn; $i++)\n{\n for (my $j=$i+1; $j<$rn; $j++)\n {\n if ($func2->($i, $j)==1)\n {\n $rn--;\n splice(@x, $i+1, 1);\n splice(@l, $i+1, 1);\n }\n }\n}\n\nprint \"$rn\\n\";", "language": "Perl", "metadata": {"date": 1579446160, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02796.html", "problem_id": "p02796", "resource_group": "low_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/Perl/s941795960.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s941795960", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nmy (@x, @l);\n{\n for (my $i=0; $i<$n; $i++)\n {\n my $in = ;\n ($x[$i], $l[$i]) = split(\" \", $in);\n }\n}\nmy %h;\nfor (my $i=0; $i<$n; $i++) {\n $h{$x[$i]} = $l[$i];\n}\n{\n my $i=0;\n for my $key (sort {$a <=> $b} keys %h)\n {\n $x[$i] = $key;\n $l[$i] = $h{$key};\n $i++;\n }\n}\nmy $func2 = sub\n{\n my $cnt = 0;\n $cnt = 1 if $x[$_[0]]+$l[$_[0]]>$x[$_[1]]-$l[$_[1]];\n return $cnt;\n};\n\nmy $rn = $n;\nfor (my $i=0; $i<$rn; $i++)\n{\n for (my $j=$i+1; $j<$rn; $j++)\n {\n if ($func2->($i, $j)==1)\n {\n $rn--;\n splice(@x, $i+1, 1);\n splice(@l, $i+1, 1);\n }\n }\n}\n\nprint \"$rn\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 748, "cpu_time_ms": 2106, "memory_kb": 48368}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s619173207", "group_id": "codeNet:p02796", "input_text": "<>;$p=-99;print~~grep$p<=/ /*$'&&($p=$_),`awk '\\$0=\\$1+\\$2FS\\$1-\\$2'|sort -n`", "language": "Perl", "metadata": {"date": 1579387863, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02796.html", "problem_id": "p02796", "resource_group": "low_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/Perl/s619173207.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s619173207", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;$p=-99;print~~grep$p<=/ /*$'&&($p=$_),`awk '\\$0=\\$1+\\$2FS\\$1-\\$2'|sort -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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 77, "cpu_time_ms": 260, "memory_kb": 23656}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s083412939", "group_id": "codeNet:p02797", "input_text": "$/=get.words;($1 xx$2,$1%1e9+1 xx$0-$2).put", "language": "Perl", "metadata": {"date": 1579385759, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02797.html", "problem_id": "p02797", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02797/input.txt", "sample_output_relpath": "derived/input_output/data/p02797/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02797/Perl/s083412939.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s083412939", "user_id": "u032223772"}, "prompt_components": {"gold_output": "1 2 3 4\n", "input_to_evaluate": "$/=get.words;($1 xx$2,$1%1e9+1 xx$0-$2).put", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are three integers N, K, and S.\n\nFind a sequence A_1, A_2, ..., A_N of N integers between 1 and 10^9 (inclusive) that satisfies the condition below.\nWe can prove that, under the conditions in Constraints, such a sequence always exists.\n\nThere are exactly K pairs (l, r) of integers such that 1 \\leq l \\leq r \\leq N and A_l + A_{l + 1} + \\cdots + A_r = S.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K \\leq N\n\n1 \\leq S \\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 S\n\nOutput\n\nPrint a sequence satisfying the condition, in the following format:\n\nA_1 A_2 ... A_N\n\nSample Input 1\n\n4 2 3\n\nSample Output 1\n\n1 2 3 4\n\nTwo pairs (l, r) = (1, 2) and (3, 3) satisfy the condition in the statement.\n\nSample Input 2\n\n5 3 100\n\nSample Output 2\n\n50 50 50 30 70", "sample_input": "4 2 3\n"}, "reference_outputs": ["1 2 3 4\n"], "source_document_id": "p02797", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are three integers N, K, and S.\n\nFind a sequence A_1, A_2, ..., A_N of N integers between 1 and 10^9 (inclusive) that satisfies the condition below.\nWe can prove that, under the conditions in Constraints, such a sequence always exists.\n\nThere are exactly K pairs (l, r) of integers such that 1 \\leq l \\leq r \\leq N and A_l + A_{l + 1} + \\cdots + A_r = S.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K \\leq N\n\n1 \\leq S \\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 S\n\nOutput\n\nPrint a sequence satisfying the condition, in the following format:\n\nA_1 A_2 ... A_N\n\nSample Input 1\n\n4 2 3\n\nSample Output 1\n\n1 2 3 4\n\nTwo pairs (l, r) = (1, 2) and (3, 3) satisfy the condition in the statement.\n\nSample Input 2\n\n5 3 100\n\nSample Output 2\n\n50 50 50 30 70", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 2109, "memory_kb": 78560}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s882597665", "group_id": "codeNet:p02802", "input_text": "<>;\nmap{\n/AC/?$c[$_]++:($c[$_]>=0&&($s++,$p+=$c[$_]),$c[$_]=-1e9)\n}<>;\nprint\"$s $p\";", "language": "Perl", "metadata": {"date": 1583990564, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02802.html", "problem_id": "p02802", "resource_group": "low_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/Perl/s882597665.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s882597665", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "<>;\nmap{\n/AC/?$c[$_]++:($c[$_]>=0&&($s++,$p+=$c[$_]),$c[$_]=-1e9)\n}<>;\nprint\"$s $p\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 96, "memory_kb": 23808}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s500574077", "group_id": "codeNet:p02804", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\nuse Math::BigInt;\nuse Memoize;\n\nmy ($n, $k) = split / /, ;\nmy @a = split / /, ;\n@a = sort { $a <=> $b } @a;\nmy $MOD = 1e9 + 7;\nsub modinv {\n my $a = shift;\n Math::BigInt->new($a)->bmodinv($MOD);\n}\nsub combi {\n my ($n, $k) = @_;\n my $c = reduce {$a * $b % $MOD} (($n-$k+1)..$n);\n my $d = reduce {$a * $b % $MOD} (1..$k);\n $c * modinv($d) % $MOD;\n}\nmemoize('combi');\nmy @e;\nfor (my $i=1; $i<$n; $i++) {\n for (my $j=1; $j<=$i; $j++) {\n $e[$i][$j] = combi($i, $j);\n }\n}\nmy $ans = 0;\nfor (my $i=0; $i<$n; $i++) {\n for (my $j=$i+$k-1; $j<$n; $j++) {\n my $c = $a[$j] - $a[$i];\n $c *= $e[$j-$i-1][$k-2] if $k>2;\n $ans += $c;\n $ans %= $MOD;\n }\n}\nsay $ans;", "language": "Perl", "metadata": {"date": 1584290435, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02804.html", "problem_id": "p02804", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02804/input.txt", "sample_output_relpath": "derived/input_output/data/p02804/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02804/Perl/s500574077.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s500574077", "user_id": "u979552932"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\nuse Math::BigInt;\nuse Memoize;\n\nmy ($n, $k) = split / /, ;\nmy @a = split / /, ;\n@a = sort { $a <=> $b } @a;\nmy $MOD = 1e9 + 7;\nsub modinv {\n my $a = shift;\n Math::BigInt->new($a)->bmodinv($MOD);\n}\nsub combi {\n my ($n, $k) = @_;\n my $c = reduce {$a * $b % $MOD} (($n-$k+1)..$n);\n my $d = reduce {$a * $b % $MOD} (1..$k);\n $c * modinv($d) % $MOD;\n}\nmemoize('combi');\nmy @e;\nfor (my $i=1; $i<$n; $i++) {\n for (my $j=1; $j<=$i; $j++) {\n $e[$i][$j] = combi($i, $j);\n }\n}\nmy $ans = 0;\nfor (my $i=0; $i<$n; $i++) {\n for (my $j=$i+$k-1; $j<$n; $j++) {\n my $c = $a[$j] - $a[$i];\n $c *= $e[$j-$i-1][$k-2] if $k>2;\n $ans += $c;\n $ans %= $MOD;\n }\n}\nsay $ans;", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor a finite set of integers X, let f(X)=\\max X - \\min X.\n\nGiven are N integers A_1,...,A_N.\n\nWe will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even when their values are the same, there are {}_N C_K ways to make this choice. Find the sum of f(S) over all those ways.\n\nSince the answer can be enormous, print it \\bmod (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 ... A_N\n\nOutput\n\nPrint the answer \\bmod (10^9+7).\n\nSample Input 1\n\n4 2\n1 1 3 4\n\nSample Output 1\n\n11\n\nThere are six ways to choose S: \\{1,1\\},\\{1,3\\},\\{1,4\\},\\{1,3\\},\\{1,4\\}, \\{3,4\\} (we distinguish the two 1s). The value of f(S) for these choices are 0,2,3,2,3,1, respectively, for the total of 11.\n\nSample Input 2\n\n6 3\n10 10 10 -10 -10 -10\n\nSample Output 2\n\n360\n\nThere are 20 ways to choose S. In 18 of them, f(S)=20, and in 2 of them, f(S)=0.\n\nSample Input 3\n\n3 1\n1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n10 6\n1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0\n\nSample Output 4\n\n999998537\n\nPrint the sum \\bmod (10^9+7).", "sample_input": "4 2\n1 1 3 4\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02804", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor a finite set of integers X, let f(X)=\\max X - \\min X.\n\nGiven are N integers A_1,...,A_N.\n\nWe will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even when their values are the same, there are {}_N C_K ways to make this choice. Find the sum of f(S) over all those ways.\n\nSince the answer can be enormous, print it \\bmod (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 ... A_N\n\nOutput\n\nPrint the answer \\bmod (10^9+7).\n\nSample Input 1\n\n4 2\n1 1 3 4\n\nSample Output 1\n\n11\n\nThere are six ways to choose S: \\{1,1\\},\\{1,3\\},\\{1,4\\},\\{1,3\\},\\{1,4\\}, \\{3,4\\} (we distinguish the two 1s). The value of f(S) for these choices are 0,2,3,2,3,1, respectively, for the total of 11.\n\nSample Input 2\n\n6 3\n10 10 10 -10 -10 -10\n\nSample Output 2\n\n360\n\nThere are 20 ways to choose S. In 18 of them, f(S)=20, and in 2 of them, f(S)=0.\n\nSample Input 3\n\n3 1\n1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n10 6\n1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0\n\nSample Output 4\n\n999998537\n\nPrint the sum \\bmod (10^9+7).", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2105, "memory_kb": 26572}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s959105991", "group_id": "codeNet:p02804", "input_text": "$c=<>=~$\";($\\+=($_[$_-1]-$_[-$_])*$c)%=$%=1e9+7,$c=$c*$_%$%*($i[$j]=$j++?$%-($%/$j|0)*$i[$%%$j]%$%:1)%$%for$'..(@_=sort{$a-$b}glob<>);print", "language": "Perl", "metadata": {"date": 1579243209, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02804.html", "problem_id": "p02804", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02804/input.txt", "sample_output_relpath": "derived/input_output/data/p02804/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02804/Perl/s959105991.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s959105991", "user_id": "u657913472"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "$c=<>=~$\";($\\+=($_[$_-1]-$_[-$_])*$c)%=$%=1e9+7,$c=$c*$_%$%*($i[$j]=$j++?$%-($%/$j|0)*$i[$%%$j]%$%:1)%$%for$'..(@_=sort{$a-$b}glob<>);print", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor a finite set of integers X, let f(X)=\\max X - \\min X.\n\nGiven are N integers A_1,...,A_N.\n\nWe will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even when their values are the same, there are {}_N C_K ways to make this choice. Find the sum of f(S) over all those ways.\n\nSince the answer can be enormous, print it \\bmod (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 ... A_N\n\nOutput\n\nPrint the answer \\bmod (10^9+7).\n\nSample Input 1\n\n4 2\n1 1 3 4\n\nSample Output 1\n\n11\n\nThere are six ways to choose S: \\{1,1\\},\\{1,3\\},\\{1,4\\},\\{1,3\\},\\{1,4\\}, \\{3,4\\} (we distinguish the two 1s). The value of f(S) for these choices are 0,2,3,2,3,1, respectively, for the total of 11.\n\nSample Input 2\n\n6 3\n10 10 10 -10 -10 -10\n\nSample Output 2\n\n360\n\nThere are 20 ways to choose S. In 18 of them, f(S)=20, and in 2 of them, f(S)=0.\n\nSample Input 3\n\n3 1\n1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n10 6\n1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0\n\nSample Output 4\n\n999998537\n\nPrint the sum \\bmod (10^9+7).", "sample_input": "4 2\n1 1 3 4\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02804", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor a finite set of integers X, let f(X)=\\max X - \\min X.\n\nGiven are N integers A_1,...,A_N.\n\nWe will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even when their values are the same, there are {}_N C_K ways to make this choice. Find the sum of f(S) over all those ways.\n\nSince the answer can be enormous, print it \\bmod (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 ... A_N\n\nOutput\n\nPrint the answer \\bmod (10^9+7).\n\nSample Input 1\n\n4 2\n1 1 3 4\n\nSample Output 1\n\n11\n\nThere are six ways to choose S: \\{1,1\\},\\{1,3\\},\\{1,4\\},\\{1,3\\},\\{1,4\\}, \\{3,4\\} (we distinguish the two 1s). The value of f(S) for these choices are 0,2,3,2,3,1, respectively, for the total of 11.\n\nSample Input 2\n\n6 3\n10 10 10 -10 -10 -10\n\nSample Output 2\n\n360\n\nThere are 20 ways to choose S. In 18 of them, f(S)=20, and in 2 of them, f(S)=0.\n\nSample Input 3\n\n3 1\n1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n10 6\n1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0\n\nSample Output 4\n\n999998537\n\nPrint the sum \\bmod (10^9+7).", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 139, "cpu_time_ms": 416, "memory_kb": 31728}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s940320912", "group_id": "codeNet:p02806", "input_text": "use strict;\n#use Tie::IxHash;\n\nmy $i = 0;\nmy @mlist = ();\nwhile(defined(my $line = )){\n chomp;\n $mlist[$i] = $line;\n $i ++;\n}\n\nmy $n = shift @mlist;\nif($n == 1){\n print 0;\n exit;\n}\n\nmy $x = pop @mlist;\n\n=pod\nprint \"$n\\n\";\nprint \"$x\\n\";\nprint \"@mlist\\n\";\n=cut\n\nmy @mlists = ();\nmy @mlistt = ();\nfor(my $i = 1; $i <= $n; $i++){\n my @kari;\n @kari = split(/ /,$mlist[$i - 1]);\n $mlists[$i - 1] = $kari[0];\n $mlistt[$i - 1] = $kari[1];\n}\n\nmy $i = 0 ;\nwhile(@mlistt) {\n if ($mlists[$i] eq $x){\n shift @mlistt;\n my $total = 0;\n my $i = 0;\n while(@mlistt){\n $total = $total + $mlistt[$i];\n shift @mlistt;\n }\n #@mlistt = @$mlistt;\n #print (&sum(\\@mlistt));\n print $total;\n last;\n }else{\n shift @mlistt;\n shift @mlists;\n }\n}", "language": "Perl", "metadata": {"date": 1578797774, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02806.html", "problem_id": "p02806", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02806/input.txt", "sample_output_relpath": "derived/input_output/data/p02806/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02806/Perl/s940320912.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s940320912", "user_id": "u137038354"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "use strict;\n#use Tie::IxHash;\n\nmy $i = 0;\nmy @mlist = ();\nwhile(defined(my $line = )){\n chomp;\n $mlist[$i] = $line;\n $i ++;\n}\n\nmy $n = shift @mlist;\nif($n == 1){\n print 0;\n exit;\n}\n\nmy $x = pop @mlist;\n\n=pod\nprint \"$n\\n\";\nprint \"$x\\n\";\nprint \"@mlist\\n\";\n=cut\n\nmy @mlists = ();\nmy @mlistt = ();\nfor(my $i = 1; $i <= $n; $i++){\n my @kari;\n @kari = split(/ /,$mlist[$i - 1]);\n $mlists[$i - 1] = $kari[0];\n $mlistt[$i - 1] = $kari[1];\n}\n\nmy $i = 0 ;\nwhile(@mlistt) {\n if ($mlists[$i] eq $x){\n shift @mlistt;\n my $total = 0;\n my $i = 0;\n while(@mlistt){\n $total = $total + $mlistt[$i];\n shift @mlistt;\n }\n #@mlistt = @$mlistt;\n #print (&sum(\\@mlistt));\n print $total;\n last;\n }else{\n shift @mlistt;\n shift @mlists;\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nNiwango created a playlist of N songs.\nThe title and the duration of the i-th song are s_i and t_i seconds, respectively.\nIt is guaranteed that s_1,\\ldots,s_N are all distinct.\n\nNiwango was doing some work while playing this playlist. (That is, all the songs were played once, in the order they appear in the playlist, without any pause in between.)\nHowever, he fell asleep during his work, and he woke up after all the songs were played.\nAccording to his record, it turned out that he fell asleep at the very end of the song titled X.\n\nFind the duration of time when some song was played while Niwango was asleep.\n\nConstraints\n\n1 \\leq N \\leq 50\n\ns_i and X are strings of length between 1 and 100 (inclusive) consisting of lowercase English letters.\n\ns_1,\\ldots,s_N are distinct.\n\nThere exists an integer i such that s_i = X.\n\n1 \\leq t_i \\leq 1000\n\nt_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1 t_1\n\\vdots\ns_{N} t_N\nX\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\ndwango 2\nsixth 5\nprelims 25\ndwango\n\nSample Output 1\n\n30\n\nWhile Niwango was asleep, two songs were played: sixth and prelims.\n\nThe answer is the total duration of these songs, 30.\n\nSample Input 2\n\n1\nabcde 1000\nabcde\n\nSample Output 2\n\n0\n\nNo songs were played while Niwango was asleep.\n\nIn such a case, the total duration of songs is 0.\n\nSample Input 3\n\n15\nypnxn 279\nkgjgwx 464\nqquhuwq 327\nrxing 549\npmuduhznoaqu 832\ndagktgdarveusju 595\nwunfagppcoi 200\ndhavrncwfw 720\njpcmigg 658\nwrczqxycivdqn 639\nmcmkkbnjfeod 992\nhtqvkgkbhtytsz 130\ntwflegsjz 467\ndswxxrxuzzfhkp 989\nszfwtzfpnscgue 958\npmuduhznoaqu\n\nSample Output 3\n\n6348", "sample_input": "3\ndwango 2\nsixth 5\nprelims 25\ndwango\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02806", "source_text": "Score : 200 points\n\nProblem Statement\n\nNiwango created a playlist of N songs.\nThe title and the duration of the i-th song are s_i and t_i seconds, respectively.\nIt is guaranteed that s_1,\\ldots,s_N are all distinct.\n\nNiwango was doing some work while playing this playlist. (That is, all the songs were played once, in the order they appear in the playlist, without any pause in between.)\nHowever, he fell asleep during his work, and he woke up after all the songs were played.\nAccording to his record, it turned out that he fell asleep at the very end of the song titled X.\n\nFind the duration of time when some song was played while Niwango was asleep.\n\nConstraints\n\n1 \\leq N \\leq 50\n\ns_i and X are strings of length between 1 and 100 (inclusive) consisting of lowercase English letters.\n\ns_1,\\ldots,s_N are distinct.\n\nThere exists an integer i such that s_i = X.\n\n1 \\leq t_i \\leq 1000\n\nt_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1 t_1\n\\vdots\ns_{N} t_N\nX\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\ndwango 2\nsixth 5\nprelims 25\ndwango\n\nSample Output 1\n\n30\n\nWhile Niwango was asleep, two songs were played: sixth and prelims.\n\nThe answer is the total duration of these songs, 30.\n\nSample Input 2\n\n1\nabcde 1000\nabcde\n\nSample Output 2\n\n0\n\nNo songs were played while Niwango was asleep.\n\nIn such a case, the total duration of songs is 0.\n\nSample Input 3\n\n15\nypnxn 279\nkgjgwx 464\nqquhuwq 327\nrxing 549\npmuduhznoaqu 832\ndagktgdarveusju 595\nwunfagppcoi 200\ndhavrncwfw 720\njpcmigg 658\nwrczqxycivdqn 639\nmcmkkbnjfeod 992\nhtqvkgkbhtytsz 130\ntwflegsjz 467\ndswxxrxuzzfhkp 989\nszfwtzfpnscgue 958\npmuduhznoaqu\n\nSample Output 3\n\n6348", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 856, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s068754953", "group_id": "codeNet:p02806", "input_text": "use strict;\n#use Tie::IxHash;\n\nmy $i = 0;\nmy @mlist = ();\nwhile(defined(my $line = )){\n chomp;\n $mlist[$i] = $line;\n $i ++;\n}\n\nmy $n = shift @mlist;\nmy $x = pop @mlist;\n\n=pod\nprint \"$n\\n\";\nprint \"$x\\n\";\nprint \"@mlist\\n\";\n=cut\n\nmy @mlists = ();\nmy @mlistt = ();\nfor(my $i = 1; $i <= $n; $i++){\n my @kari;\n my @kari = split(/ /,@mlist[$i - 1]);\n @mlists[$i - 1] = $kari[0];\n @mlistt[$i - 1] = $kari[1];\n}\n\nmy $i = 0 ;\nwhile(@mlistt) {\n if ($mlists[$i] == $x){\n shift @mlistt;\n my $total = 0;\n my $i = 0;\n while(@mlistt){\n $total = $total + $mlistt[$i];\n shift @mlistt;\n }\n #@mlistt = @$mlistt;\n #print (&sum(\\@mlistt));\n print $total;\n last;\n }else{\n shift @mlistt;\n $i ++;\n }\n}", "language": "Perl", "metadata": {"date": 1578796913, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02806.html", "problem_id": "p02806", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02806/input.txt", "sample_output_relpath": "derived/input_output/data/p02806/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02806/Perl/s068754953.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s068754953", "user_id": "u137038354"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "use strict;\n#use Tie::IxHash;\n\nmy $i = 0;\nmy @mlist = ();\nwhile(defined(my $line = )){\n chomp;\n $mlist[$i] = $line;\n $i ++;\n}\n\nmy $n = shift @mlist;\nmy $x = pop @mlist;\n\n=pod\nprint \"$n\\n\";\nprint \"$x\\n\";\nprint \"@mlist\\n\";\n=cut\n\nmy @mlists = ();\nmy @mlistt = ();\nfor(my $i = 1; $i <= $n; $i++){\n my @kari;\n my @kari = split(/ /,@mlist[$i - 1]);\n @mlists[$i - 1] = $kari[0];\n @mlistt[$i - 1] = $kari[1];\n}\n\nmy $i = 0 ;\nwhile(@mlistt) {\n if ($mlists[$i] == $x){\n shift @mlistt;\n my $total = 0;\n my $i = 0;\n while(@mlistt){\n $total = $total + $mlistt[$i];\n shift @mlistt;\n }\n #@mlistt = @$mlistt;\n #print (&sum(\\@mlistt));\n print $total;\n last;\n }else{\n shift @mlistt;\n $i ++;\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nNiwango created a playlist of N songs.\nThe title and the duration of the i-th song are s_i and t_i seconds, respectively.\nIt is guaranteed that s_1,\\ldots,s_N are all distinct.\n\nNiwango was doing some work while playing this playlist. (That is, all the songs were played once, in the order they appear in the playlist, without any pause in between.)\nHowever, he fell asleep during his work, and he woke up after all the songs were played.\nAccording to his record, it turned out that he fell asleep at the very end of the song titled X.\n\nFind the duration of time when some song was played while Niwango was asleep.\n\nConstraints\n\n1 \\leq N \\leq 50\n\ns_i and X are strings of length between 1 and 100 (inclusive) consisting of lowercase English letters.\n\ns_1,\\ldots,s_N are distinct.\n\nThere exists an integer i such that s_i = X.\n\n1 \\leq t_i \\leq 1000\n\nt_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1 t_1\n\\vdots\ns_{N} t_N\nX\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\ndwango 2\nsixth 5\nprelims 25\ndwango\n\nSample Output 1\n\n30\n\nWhile Niwango was asleep, two songs were played: sixth and prelims.\n\nThe answer is the total duration of these songs, 30.\n\nSample Input 2\n\n1\nabcde 1000\nabcde\n\nSample Output 2\n\n0\n\nNo songs were played while Niwango was asleep.\n\nIn such a case, the total duration of songs is 0.\n\nSample Input 3\n\n15\nypnxn 279\nkgjgwx 464\nqquhuwq 327\nrxing 549\npmuduhznoaqu 832\ndagktgdarveusju 595\nwunfagppcoi 200\ndhavrncwfw 720\njpcmigg 658\nwrczqxycivdqn 639\nmcmkkbnjfeod 992\nhtqvkgkbhtytsz 130\ntwflegsjz 467\ndswxxrxuzzfhkp 989\nszfwtzfpnscgue 958\npmuduhznoaqu\n\nSample Output 3\n\n6348", "sample_input": "3\ndwango 2\nsixth 5\nprelims 25\ndwango\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02806", "source_text": "Score : 200 points\n\nProblem Statement\n\nNiwango created a playlist of N songs.\nThe title and the duration of the i-th song are s_i and t_i seconds, respectively.\nIt is guaranteed that s_1,\\ldots,s_N are all distinct.\n\nNiwango was doing some work while playing this playlist. (That is, all the songs were played once, in the order they appear in the playlist, without any pause in between.)\nHowever, he fell asleep during his work, and he woke up after all the songs were played.\nAccording to his record, it turned out that he fell asleep at the very end of the song titled X.\n\nFind the duration of time when some song was played while Niwango was asleep.\n\nConstraints\n\n1 \\leq N \\leq 50\n\ns_i and X are strings of length between 1 and 100 (inclusive) consisting of lowercase English letters.\n\ns_1,\\ldots,s_N are distinct.\n\nThere exists an integer i such that s_i = X.\n\n1 \\leq t_i \\leq 1000\n\nt_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1 t_1\n\\vdots\ns_{N} t_N\nX\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\ndwango 2\nsixth 5\nprelims 25\ndwango\n\nSample Output 1\n\n30\n\nWhile Niwango was asleep, two songs were played: sixth and prelims.\n\nThe answer is the total duration of these songs, 30.\n\nSample Input 2\n\n1\nabcde 1000\nabcde\n\nSample Output 2\n\n0\n\nNo songs were played while Niwango was asleep.\n\nIn such a case, the total duration of songs is 0.\n\nSample Input 3\n\n15\nypnxn 279\nkgjgwx 464\nqquhuwq 327\nrxing 549\npmuduhznoaqu 832\ndagktgdarveusju 595\nwunfagppcoi 200\ndhavrncwfw 720\njpcmigg 658\nwrczqxycivdqn 639\nmcmkkbnjfeod 992\nhtqvkgkbhtytsz 130\ntwflegsjz 467\ndswxxrxuzzfhkp 989\nszfwtzfpnscgue 958\npmuduhznoaqu\n\nSample Output 3\n\n6348", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 812, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s460052508", "group_id": "codeNet:p02811", "input_text": "print<>!~$\",$`*500>=$'?Yes:No", "language": "Perl", "metadata": {"date": 1581100371, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02811.html", "problem_id": "p02811", "resource_group": "low_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/Perl/s460052508.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s460052508", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print<>!~$\",$`*500>=$'?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 29, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s753657340", "group_id": "codeNet:p02812", "input_text": "<>;\n$_ = <>;\n$ans = 0;\n$ans++ while s/ABC//;\nprint \"$ans\\n\";\n", "language": "Perl", "metadata": {"date": 1588898530, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02812.html", "problem_id": "p02812", "resource_group": "low_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/Perl/s753657340.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s753657340", "user_id": "u020604402"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>;\n$_ = <>;\n$ans = 0;\n$ans++ while s/ABC//;\nprint \"$ans\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s167633916", "group_id": "codeNet:p02812", "input_text": "print s/ABC//g for<>", "language": "Perl", "metadata": {"date": 1578708492, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02812.html", "problem_id": "p02812", "resource_group": "low_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/Perl/s167633916.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s167633916", "user_id": "u207056619"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print s/ABC//g for<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s978789757", "group_id": "codeNet:p02813", "input_text": "say abs [-] map {+grep *lt$_,.words.permutations},lines", "language": "Perl", "metadata": {"date": 1596050955, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02813.html", "problem_id": "p02813", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02813/input.txt", "sample_output_relpath": "derived/input_output/data/p02813/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02813/Perl/s978789757.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s978789757", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "say abs [-] map {+grep *lt$_,.words.permutations},lines", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two permutations P and Q of size N (that is, P and Q are both rearrangements of (1,~2,~...,~N)).\n\nThere are N! possible permutations of size N. Among them, let P and Q be the a-th and b-th lexicographically smallest permutations, respectively. Find |a - b|.\n\nNotes\n\nFor two sequences X and Y, X is said to be lexicographically smaller than Y if and only if there exists an integer k such that X_i = Y_i~(1 \\leq i < k) and X_k < Y_k.\n\nConstraints\n\n2 \\leq N \\leq 8\n\nP and Q are permutations of size N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 ... P_N\nQ_1 Q_2 ... Q_N\n\nOutput\n\nPrint |a - b|.\n\nSample Input 1\n\n3\n1 3 2\n3 1 2\n\nSample Output 1\n\n3\n\nThere are 6 permutations of size 3: (1,~2,~3), (1,~3,~2), (2,~1,~3), (2,~3,~1), (3,~1,~2), and (3,~2,~1). Among them, (1,~3,~2) and (3,~1,~2) come 2-nd and 5-th in lexicographical order, so the answer is |2 - 5| = 3.\n\nSample Input 2\n\n8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n\nSample Output 2\n\n17517\n\nSample Input 3\n\n3\n1 2 3\n1 2 3\n\nSample Output 3\n\n0", "sample_input": "3\n1 3 2\n3 1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02813", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two permutations P and Q of size N (that is, P and Q are both rearrangements of (1,~2,~...,~N)).\n\nThere are N! possible permutations of size N. Among them, let P and Q be the a-th and b-th lexicographically smallest permutations, respectively. Find |a - b|.\n\nNotes\n\nFor two sequences X and Y, X is said to be lexicographically smaller than Y if and only if there exists an integer k such that X_i = Y_i~(1 \\leq i < k) and X_k < Y_k.\n\nConstraints\n\n2 \\leq N \\leq 8\n\nP and Q are permutations of size N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 ... P_N\nQ_1 Q_2 ... Q_N\n\nOutput\n\nPrint |a - b|.\n\nSample Input 1\n\n3\n1 3 2\n3 1 2\n\nSample Output 1\n\n3\n\nThere are 6 permutations of size 3: (1,~2,~3), (1,~3,~2), (2,~1,~3), (2,~3,~1), (3,~1,~2), and (3,~2,~1). Among them, (1,~3,~2) and (3,~1,~2) come 2-nd and 5-th in lexicographical order, so the answer is |2 - 5| = 3.\n\nSample Input 2\n\n8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n\nSample Output 2\n\n17517\n\nSample Input 3\n\n3\n1 2 3\n1 2 3\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 55, "cpu_time_ms": 563, "memory_kb": 105700}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s443740007", "group_id": "codeNet:p02817", "input_text": "my ($S, $T) = split \" \", <>;\nprint $T.$S;\n", "language": "Perl", "metadata": {"date": 1582418251, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02817.html", "problem_id": "p02817", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02817/input.txt", "sample_output_relpath": "derived/input_output/data/p02817/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02817/Perl/s443740007.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s443740007", "user_id": "u469420552"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "my ($S, $T) = split \" \", <>;\nprint $T.$S;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "sample_input": "oder atc\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p02817", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s974442064", "group_id": "codeNet:p02818", "input_text": "print<>!~/ .+ /+($-=$_-=$'),$\",$-=$&-($-=-$_)", "language": "Perl", "metadata": {"date": 1577674646, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/Perl/s974442064.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s974442064", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "print<>!~/ .+ /+($-=$_-=$'),$\",$-=$&-($-=-$_)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\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 the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\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 the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s324365104", "group_id": "codeNet:p02818", "input_text": "print<>!~/ .+ /+($-=$`-$'),$\",$-=$&-($-=$'-$`)", "language": "Perl", "metadata": {"date": 1577674453, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/Perl/s324365104.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s324365104", "user_id": "u019489252"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "print<>!~/ .+ /+($-=$`-$'),$\",$-=$&-($-=$'-$`)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\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 the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\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 the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s373031301", "group_id": "codeNet:p02819", "input_text": "my $x = glob <>;\nmy @prime;\n\n$i = 1;\nwhile (1) {\n $i++;\n\n my $is_prime = 1;\n for ( my $j = 2 ; $j < $i // 2 ; $j++ ) {\n if ( $i % $j == 0 ) {\n $is_prime = 0;\n last;\n }\n }\n\n if ( not $is_prime ) {\n next;\n }\n\n if ( $i >= $x ) {\n last;\n }\n push( @prime, $i );\n}\n\nprint($i)", "language": "Perl", "metadata": {"date": 1584827210, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02819.html", "problem_id": "p02819", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02819/input.txt", "sample_output_relpath": "derived/input_output/data/p02819/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02819/Perl/s373031301.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s373031301", "user_id": "u569322757"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "my $x = glob <>;\nmy @prime;\n\n$i = 1;\nwhile (1) {\n $i++;\n\n my $is_prime = 1;\n for ( my $j = 2 ; $j < $i // 2 ; $j++ ) {\n if ( $i % $j == 0 ) {\n $is_prime = 0;\n last;\n }\n }\n\n if ( not $is_prime ) {\n next;\n }\n\n if ( $i >= $x ) {\n last;\n }\n push( @prime, $i );\n}\n\nprint($i)", "problem_context": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 346, "cpu_time_ms": 2103, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s182685711", "group_id": "codeNet:p02819", "input_text": "$_=<>-1;{(1x++$_)=~/^(11+?)\\1+$/&&redo};print", "language": "Perl", "metadata": {"date": 1577672502, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02819.html", "problem_id": "p02819", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02819/input.txt", "sample_output_relpath": "derived/input_output/data/p02819/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02819/Perl/s182685711.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s182685711", "user_id": "u832039789"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "$_=<>-1;{(1x++$_)=~/^(11+?)\\1+$/&&redo};print", "problem_context": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 652, "memory_kb": 5560}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s333872036", "group_id": "codeNet:p02820", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy ($n, $k);\n{\n my $in = ;\n ($n, $k) = split(\" \", $in);\n}\nmy ($r, $s, $p);\n{\n my $in = ;\n ($r, $s, $p) = split(\" \", $in);\n}\nmy $t = ;\n\nmy $h = sub {\n my $num = shift;\n if (\"r\" eq $num) {\n return \"p\";\n } elsif (\"s\" eq $num) {\n return \"r\";\n } elsif (\"p\" eq $num) {\n return \"s\";\n }\n};\nmy $score = sub {\n my $num = shift;\n if (\"p\" eq $num) {\n return $p;\n } elsif (\"r\" eq $num) {\n return $r;\n } elsif (\"s\" eq $num) {\n return $s;\n }\n};\n\nmy @c;\nfor (my $i=0; $i<$n; $i++) {\n $c[$i] = $h->(substr($t, $i, 1));\n}\nfor (my $i=0; $i<$n-$k; $i++) {\n if ($c[$i] eq $c[$i+$k]) {\n $c[$i+$k] = \"x\";\n }\n}\nmy $sum;\nfor (my $i=0; $i<$n; $i++) {\n $sum += $score->($c[$i]);\n}\nprint \"$sum\\n\";", "language": "Perl", "metadata": {"date": 1577802445, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02820.html", "problem_id": "p02820", "resource_group": "low_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/Perl/s333872036.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s333872036", "user_id": "u979552932"}, "prompt_components": {"gold_output": "27\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy ($n, $k);\n{\n my $in = ;\n ($n, $k) = split(\" \", $in);\n}\nmy ($r, $s, $p);\n{\n my $in = ;\n ($r, $s, $p) = split(\" \", $in);\n}\nmy $t = ;\n\nmy $h = sub {\n my $num = shift;\n if (\"r\" eq $num) {\n return \"p\";\n } elsif (\"s\" eq $num) {\n return \"r\";\n } elsif (\"p\" eq $num) {\n return \"s\";\n }\n};\nmy $score = sub {\n my $num = shift;\n if (\"p\" eq $num) {\n return $p;\n } elsif (\"r\" eq $num) {\n return $r;\n } elsif (\"s\" eq $num) {\n return $s;\n }\n};\n\nmy @c;\nfor (my $i=0; $i<$n; $i++) {\n $c[$i] = $h->(substr($t, $i, 1));\n}\nfor (my $i=0; $i<$n-$k; $i++) {\n if ($c[$i] eq $c[$i+$k]) {\n $c[$i+$k] = \"x\";\n }\n}\nmy $sum;\nfor (my $i=0; $i<$n; $i++) {\n $sum += $score->($c[$i]);\n}\nprint \"$sum\\n\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 841, "cpu_time_ms": 173, "memory_kb": 8704}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s746229806", "group_id": "codeNet:p02823", "input_text": "$/=get.words;say ($_=$2-$1)+>1+$_%2*min +$1,$0-$2+1", "language": "Perl", "metadata": {"date": 1577594010, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02823.html", "problem_id": "p02823", "resource_group": "low_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/Perl/s746229806.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s746229806", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$/=get.words;say ($_=$2-$1)+>1+$_%2*min +$1,$0-$2+1", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 322, "memory_kb": 64640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s913717521", "group_id": "codeNet:p02829", "input_text": "print<>^<>", "language": "Perl", "metadata": {"date": 1577083712, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02829.html", "problem_id": "p02829", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02829/input.txt", "sample_output_relpath": "derived/input_output/data/p02829/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02829/Perl/s913717521.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s913717521", "user_id": "u675296835"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print<>^<>", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "sample_input": "3\n1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02829", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 10, "cpu_time_ms": 6, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s623716684", "group_id": "codeNet:p02830", "input_text": "$n = <>;\n($s, $t) = glob <>;\nfor (0 .. $n - 1) {\n print substr($s, $_, 1), substr($t, $_, 1);\n}", "language": "Perl", "metadata": {"date": 1600043954, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02830.html", "problem_id": "p02830", "resource_group": "low_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/Perl/s623716684.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s623716684", "user_id": "u172873334"}, "prompt_components": {"gold_output": "icpc\n", "input_to_evaluate": "$n = <>;\n($s, $t) = glob <>;\nfor (0 .. $n - 1) {\n print substr($s, $_, 1), substr($t, $_, 1);\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 98, "cpu_time_ms": 17, "memory_kb": 5328}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s627649680", "group_id": "codeNet:p02830", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $N = <>;\nchomp(my $in = );\nmy($S, $T) = split(\" \", $in);\n\nmy $ans = \"\";\nfor (my $i=0; $i<$N; $i++) {\n $ans = $ans . substr($S, $i, 1);\n $ans = $ans . substr($T, $i, 1);\n}\nprint \"$ans\\n\";\n", "language": "Perl", "metadata": {"date": 1577175270, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02830.html", "problem_id": "p02830", "resource_group": "low_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/Perl/s627649680.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s627649680", "user_id": "u979552932"}, "prompt_components": {"gold_output": "icpc\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $N = <>;\nchomp(my $in = );\nmy($S, $T) = split(\" \", $in);\n\nmy $ans = \"\";\nfor (my $i=0; $i<$N; $i++) {\n $ans = $ans . substr($S, $i, 1);\n $ans = $ans . substr($T, $i, 1);\n}\nprint \"$ans\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s007556447", "group_id": "codeNet:p02831", "input_text": "say [lcm] words", "language": "Perl", "metadata": {"date": 1589428280, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02831.html", "problem_id": "p02831", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02831/input.txt", "sample_output_relpath": "derived/input_output/data/p02831/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02831/Perl/s007556447.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s007556447", "user_id": "u657913472"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "say [lcm] words", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\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 B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\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 B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 15, "cpu_time_ms": 169, "memory_kb": 82436}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s656300875", "group_id": "codeNet:p02831", "input_text": "say [lcm] words", "language": "Perl", "metadata": {"date": 1577066671, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02831.html", "problem_id": "p02831", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02831/input.txt", "sample_output_relpath": "derived/input_output/data/p02831/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02831/Perl/s656300875.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s656300875", "user_id": "u657913472"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "say [lcm] words", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\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 B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\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 B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 15, "cpu_time_ms": 262, "memory_kb": 63640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s423615825", "group_id": "codeNet:p02833", "input_text": "my $N = ;\n$mod = $N % 2;\nif( $mod == 1){\n print \"0\";\n exit;\n}\n$ans = 0;\n$a = $N/2;\nfor($i=0;$i<10000;$i++){ \n $a = int($a / 5);\n $ans = $ans + $a;\n if($a ==0){last;}\n}\nprint \"$ans\\n\";", "language": "Perl", "metadata": {"date": 1577070678, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02833.html", "problem_id": "p02833", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02833/input.txt", "sample_output_relpath": "derived/input_output/data/p02833/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02833/Perl/s423615825.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s423615825", "user_id": "u464700044"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "my $N = ;\n$mod = $N % 2;\nif( $mod == 1){\n print \"0\";\n exit;\n}\n$ans = 0;\n$a = $N/2;\nfor($i=0;$i<10000;$i++){ \n $a = int($a / 5);\n $ans = $ans + $a;\n if($a ==0){last;}\n}\nprint \"$ans\\n\";", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "sample_input": "12\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02833", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s928982509", "group_id": "codeNet:p02834", "input_text": "($N,$T,$A)=glob<>;\nmap{push@$_,$_[--$|]for@_=glob}<>;\nsub f{$a[$_]=$d++;$a[$_]//&f for@$_;$d--}\nf$_=${*a=T};f$_=${*a=A};\n$T[$_]<$A[$_]&&\\$_[$A[$_]]for 1..$N;\nprint@_-2", "language": "Perl", "metadata": {"date": 1577074618, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02834.html", "problem_id": "p02834", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02834/input.txt", "sample_output_relpath": "derived/input_output/data/p02834/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02834/Perl/s928982509.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s928982509", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "($N,$T,$A)=glob<>;\nmap{push@$_,$_[--$|]for@_=glob}<>;\nsub f{$a[$_]=$d++;$a[$_]//&f for@$_;$d--}\nf$_=${*a=T};f$_=${*a=A};\n$T[$_]<$A[$_]&&\\$_[$A[$_]]for 1..$N;\nprint@_-2", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The i-th edge connects Vertex A_i and B_i bidirectionally.\n\nTakahashi is standing at Vertex u, and Aoki is standing at Vertex v.\n\nNow, they will play a game of tag as follows:\n\n1. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Takahashi moves to a vertex of his choice that is adjacent to his current vertex.\n\n2. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Aoki moves to a vertex of his choice that is adjacent to his current vertex.\n\n3. Go back to step 1.\n\nTakahashi performs his moves so that the game ends as late as possible, while Aoki performs his moves so that the game ends as early as possible.\n\nFind the number of moves Aoki will perform before the end of the game if both Takahashi and Aoki know each other's position and strategy.\n\nIt can be proved that the game is bound to end.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq u,v \\leq N\n\nu \\neq v\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 u v\nA_1 B_1\n:\nA_{N-1} B_{N-1}\n\nOutput\n\nPrint the number of moves Aoki will perform before the end of the game.\n\nSample Input 1\n\n5 4 1\n1 2\n2 3\n3 4\n3 5\n\nSample Output 1\n\n2\n\nIf both players play optimally, the game will progress as follows:\n\nTakahashi moves to Vertex 3.\n\nAoki moves to Vertex 2.\n\nTakahashi moves to Vertex 5.\n\nAoki moves to Vertex 3.\n\nTakahashi moves to Vertex 3.\n\nHere, Aoki performs two moves.\n\nNote that, in each move, it is prohibited to stay at the current vertex.\n\nSample Input 2\n\n5 4 5\n1 2\n1 3\n1 4\n1 5\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2 1 2\n1 2\n\nSample Output 3\n\n0\n\nSample Input 4\n\n9 6 1\n1 2\n2 3\n3 4\n4 5\n5 6\n4 7\n7 8\n8 9\n\nSample Output 4\n\n5", "sample_input": "5 4 1\n1 2\n2 3\n3 4\n3 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02834", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The i-th edge connects Vertex A_i and B_i bidirectionally.\n\nTakahashi is standing at Vertex u, and Aoki is standing at Vertex v.\n\nNow, they will play a game of tag as follows:\n\n1. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Takahashi moves to a vertex of his choice that is adjacent to his current vertex.\n\n2. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Aoki moves to a vertex of his choice that is adjacent to his current vertex.\n\n3. Go back to step 1.\n\nTakahashi performs his moves so that the game ends as late as possible, while Aoki performs his moves so that the game ends as early as possible.\n\nFind the number of moves Aoki will perform before the end of the game if both Takahashi and Aoki know each other's position and strategy.\n\nIt can be proved that the game is bound to end.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq u,v \\leq N\n\nu \\neq v\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 u v\nA_1 B_1\n:\nA_{N-1} B_{N-1}\n\nOutput\n\nPrint the number of moves Aoki will perform before the end of the game.\n\nSample Input 1\n\n5 4 1\n1 2\n2 3\n3 4\n3 5\n\nSample Output 1\n\n2\n\nIf both players play optimally, the game will progress as follows:\n\nTakahashi moves to Vertex 3.\n\nAoki moves to Vertex 2.\n\nTakahashi moves to Vertex 5.\n\nAoki moves to Vertex 3.\n\nTakahashi moves to Vertex 3.\n\nHere, Aoki performs two moves.\n\nNote that, in each move, it is prohibited to stay at the current vertex.\n\nSample Input 2\n\n5 4 5\n1 2\n1 3\n1 4\n1 5\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2 1 2\n1 2\n\nSample Output 3\n\n0\n\nSample Input 4\n\n9 6 1\n1 2\n2 3\n3 4\n4 5\n5 6\n4 7\n7 8\n8 9\n\nSample Output 4\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 167, "cpu_time_ms": 1556, "memory_kb": 142592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s913608373", "group_id": "codeNet:p02835", "input_text": "<>=~/ .+ /;print$`+$&+$'<22?win:bust", "language": "Perl", "metadata": {"date": 1579582142, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "low_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/Perl/s913608373.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s913608373", "user_id": "u657913472"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "<>=~/ .+ /;print$`+$&+$'<22?win:bust", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s819998199", "group_id": "codeNet:p02835", "input_text": "my $s = ;\nmy @s = split(/ /,$s);\nmy $ans = $s[0]+$s[1]+$s[2];\nif($ans > 21){\n print \"bust\";\n}else{\n print \"win\";\n}", "language": "Perl", "metadata": {"date": 1577065609, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "low_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/Perl/s819998199.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s819998199", "user_id": "u464700044"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "my $s = ;\nmy @s = split(/ /,$s);\nmy $ans = $s[0]+$s[1]+$s[2];\nif($ans > 21){\n print \"bust\";\n}else{\n print \"win\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s160193216", "group_id": "codeNet:p02835", "input_text": "print((eval join\"+\",split\" \",<>)>21?bust:win)", "language": "Perl", "metadata": {"date": 1576093760, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "low_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/Perl/s160193216.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s160193216", "user_id": "u573154728"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "print((eval join\"+\",split\" \",<>)>21?bust:win)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s734437847", "group_id": "codeNet:p02836", "input_text": "chomp(my $S = <>);\nmy @S = split \"\", $S;\n\nmy $i = 0;\nfor (1..int(scalar @S / 2)) {\n unless ($S[$_-1] eq $S[-$_]) {\n $i++;\n }\n}\nprint $i;\n", "language": "Perl", "metadata": {"date": 1582470420, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/Perl/s734437847.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s734437847", "user_id": "u469420552"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "chomp(my $S = <>);\nmy @S = split \"\", $S;\n\nmy $i = 0;\nfor (1..int(scalar @S / 2)) {\n unless ($S[$_-1] eq $S[-$_]) {\n $i++;\n }\n}\nprint $i;\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\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\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\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\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s577996515", "group_id": "codeNet:p02836", "input_text": "print+(($_=<>)^reverse)=~y/\u0001-///2", "language": "Perl", "metadata": {"date": 1580108549, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/Perl/s577996515.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s577996515", "user_id": "u832039789"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "print+(($_=<>)^reverse)=~y/\u0001-///2", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\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\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\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\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 34, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s287671411", "group_id": "codeNet:p02836", "input_text": "$_=get;say sum .ords Z>.flip.ords", "language": "Perl", "metadata": {"date": 1575862936, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/Perl/s287671411.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287671411", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$_=get;say sum .ords Z>.flip.ords", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\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\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\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\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 270, "memory_kb": 62852}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s140691193", "group_id": "codeNet:p02837", "input_text": "my $people_num = prompt('');\nmy $data = {};\nfor 1..$people_num -> $witness_plus_one {\n my $testimony_num = prompt('');\n for 1..$testimony_num {\n my ($person_plus_one, $is_honest) = prompt('').split(/\\s/);\n $data.{$witness_plus_one-1}.{$person_plus_one-1} = $is_honest;\n }\n}\n\nmy $answer = 0;\nfor 0..2**$people_num-1 -> $x {\n my $assumption = {};\n for 0..$people_num-1 -> $person {\n $assumption.{$person} = ($x +> $person) +& 1;\n }\n my $has_contradict_testimony = False;\n for 0..$people_num-1 -> $witness {\n next unless $assumption.{$witness};\n next unless $data.{$witness}:exists;\n $has_contradict_testimony = first {\n my ($person, $is_honest) = $_.kv;\n $assumption.{$person} != $is_honest;\n }, $data.{$witness}.list;\n last if ?$has_contradict_testimony;\n }\n if (!?$has_contradict_testimony) {\n my $honest_people_num = [+] $assumption.values; \n $answer = $honest_people_num if $honest_people_num > $answer;\n }\n}\nsay $answer;", "language": "Perl", "metadata": {"date": 1576688618, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02837.html", "problem_id": "p02837", "resource_group": "low_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/Perl/s140691193.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s140691193", "user_id": "u729566299"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my $people_num = prompt('');\nmy $data = {};\nfor 1..$people_num -> $witness_plus_one {\n my $testimony_num = prompt('');\n for 1..$testimony_num {\n my ($person_plus_one, $is_honest) = prompt('').split(/\\s/);\n $data.{$witness_plus_one-1}.{$person_plus_one-1} = $is_honest;\n }\n}\n\nmy $answer = 0;\nfor 0..2**$people_num-1 -> $x {\n my $assumption = {};\n for 0..$people_num-1 -> $person {\n $assumption.{$person} = ($x +> $person) +& 1;\n }\n my $has_contradict_testimony = False;\n for 0..$people_num-1 -> $witness {\n next unless $assumption.{$witness};\n next unless $data.{$witness}:exists;\n $has_contradict_testimony = first {\n my ($person, $is_honest) = $_.kv;\n $assumption.{$person} != $is_honest;\n }, $data.{$witness}.list;\n last if ?$has_contradict_testimony;\n }\n if (!?$has_contradict_testimony) {\n my $honest_people_num = [+] $assumption.values; \n $answer = $honest_people_num if $honest_people_num > $answer;\n }\n}\nsay $answer;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1059, "cpu_time_ms": 2109, "memory_kb": 83212}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s942661667", "group_id": "codeNet:p02837", "input_text": "my $people_num = prompt('');\nmy $data = {};\nfor 0..$people_num-1 -> $witness {\n my $testimony_num = prompt('');\n for 1..$testimony_num {\n my ($person_plus_one, $is_honest) = prompt('').split(' ');\n $data.{$witness}.{$person_plus_one-1} = $is_honest;\n }\n}\n\n# e.g. $people_num == 3:\n# => [(0 0 0) (0 0 1) (0 1 0) (0 1 1) (1 0 0) (1 0 1) (1 1 0) (1 1 1)]\nmy @assumption = [X] (0, 1) xx $people_num;\n\nmy @answer = (0);\nfor @assumption -> $assum {\n my $has_contradict_testimony = False;\n for $assum.kv -> $witness, $assum_is_honest {\n next unless $assum_is_honest;\n $has_contradict_testimony = first {\n next unless $_;\n my ($person, $is_honest) = $_.kv;\n $assum.[$person] != $is_honest;\n }, $data.{$witness}.list;\n last if ?$has_contradict_testimony;\n }\n push @answer, [+] $assum.values unless ?$has_contradict_testimony;\n}\nsay @answer.max;", "language": "Perl", "metadata": {"date": 1576505008, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02837.html", "problem_id": "p02837", "resource_group": "low_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/Perl/s942661667.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s942661667", "user_id": "u729566299"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my $people_num = prompt('');\nmy $data = {};\nfor 0..$people_num-1 -> $witness {\n my $testimony_num = prompt('');\n for 1..$testimony_num {\n my ($person_plus_one, $is_honest) = prompt('').split(' ');\n $data.{$witness}.{$person_plus_one-1} = $is_honest;\n }\n}\n\n# e.g. $people_num == 3:\n# => [(0 0 0) (0 0 1) (0 1 0) (0 1 1) (1 0 0) (1 0 1) (1 1 0) (1 1 1)]\nmy @assumption = [X] (0, 1) xx $people_num;\n\nmy @answer = (0);\nfor @assumption -> $assum {\n my $has_contradict_testimony = False;\n for $assum.kv -> $witness, $assum_is_honest {\n next unless $assum_is_honest;\n $has_contradict_testimony = first {\n next unless $_;\n my ($person, $is_honest) = $_.kv;\n $assum.[$person] != $is_honest;\n }, $data.{$witness}.list;\n last if ?$has_contradict_testimony;\n }\n push @answer, [+] $assum.values unless ?$has_contradict_testimony;\n}\nsay @answer.max;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 936, "cpu_time_ms": 2111, "memory_kb": 101588}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s603103069", "group_id": "codeNet:p02837", "input_text": "map{/ /?vec($$I,$`-1,8)=$':$I--for<>;$\\+=!/1(??{$_ eq$_|${-pos}&&a})/*y/1//-$\\}glob'{0,1}'x<>;print", "language": "Perl", "metadata": {"date": 1575929568, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02837.html", "problem_id": "p02837", "resource_group": "low_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/Perl/s603103069.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s603103069", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "map{/ /?vec($$I,$`-1,8)=$':$I--for<>;$\\+=!/1(??{$_ eq$_|${-pos}&&a})/*y/1//-$\\}glob'{0,1}'x<>;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 935, "memory_kb": 7056}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s229168910", "group_id": "codeNet:p02838", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse Memoize;\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nmy (@b, @c);\nfor my $i (0..($n-1)) {\n $b = $a[$i];\n my $j = 0;\n while ($b) {\n $c[$j] += $b % 2;\n $b >>= 1;\n $j++;\n }\n}\nmy $MOD = 1e9 + 7;\nsub modpow {\n my ($a, $n) = @_;\n my $r = 1;\n my $MOD = 1e9 + 7;\n while ($n > 0) {\n $r = $r * $a % $MOD if $n & 1;\n $a = $a * $a % $MOD;\n $n >>= 1;\n }\n return $r;\n}\nmemoize('modpow');\nmy @in;\nfor my $i (0..60) {\n $in[$i] = modpow(2, $i);\n}\nmy $ans = 0;\nfor my $i (0..@c-1) {\n my $b = $in[$i];\n $b *= $c[$i];\n $b %= $MOD;\n $b *= $n - $c[$i];\n $b %= $MOD;\n $ans += $b;\n $ans %= $MOD;\n}\nsay $ans;", "language": "Perl", "metadata": {"date": 1585238165, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02838.html", "problem_id": "p02838", "resource_group": "low_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/Perl/s229168910.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s229168910", "user_id": "u979552932"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse Memoize;\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nmy (@b, @c);\nfor my $i (0..($n-1)) {\n $b = $a[$i];\n my $j = 0;\n while ($b) {\n $c[$j] += $b % 2;\n $b >>= 1;\n $j++;\n }\n}\nmy $MOD = 1e9 + 7;\nsub modpow {\n my ($a, $n) = @_;\n my $r = 1;\n my $MOD = 1e9 + 7;\n while ($n > 0) {\n $r = $r * $a % $MOD if $n & 1;\n $a = $a * $a % $MOD;\n $n >>= 1;\n }\n return $r;\n}\nmemoize('modpow');\nmy @in;\nfor my $i (0..60) {\n $in[$i] = modpow(2, $i);\n}\nmy $ans = 0;\nfor my $i (0..@c-1) {\n my $b = $in[$i];\n $b *= $c[$i];\n $b %= $MOD;\n $b *= $n - $c[$i];\n $b %= $MOD;\n $ans += $b;\n $ans %= $MOD;\n}\nsay $ans;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 685, "cpu_time_ms": 2106, "memory_kb": 49004}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s436826216", "group_id": "codeNet:p02841", "input_text": "print<>!=<>|0", "language": "Perl", "metadata": {"date": 1575252114, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02841.html", "problem_id": "p02841", "resource_group": "low_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/Perl/s436826216.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s436826216", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "print<>!=<>|0", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 13, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s175900718", "group_id": "codeNet:p02842", "input_text": "use POSIX qw(floor ceil);\n\nmy $n = <>; chomp $n;\nmy $ans1 = floor($n / (1.08));\nmy $ans2 = ceil($n / (1.08));\n\nif (floor($ans1 * 1.08) == $n) {\n print $ans1;\n}\nelsif (floor($ans2 * 1.08) == $n) {\n print $ans2;\n}\nelse {\n print ':(';\n}\n", "language": "Perl", "metadata": {"date": 1575335649, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02842.html", "problem_id": "p02842", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02842/input.txt", "sample_output_relpath": "derived/input_output/data/p02842/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02842/Perl/s175900718.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s175900718", "user_id": "u698551366"}, "prompt_components": {"gold_output": "400\n", "input_to_evaluate": "use POSIX qw(floor ceil);\n\nmy $n = <>; chomp $n;\nmy $ans1 = floor($n / (1.08));\nmy $ans2 = ceil($n / (1.08));\n\nif (floor($ans1 * 1.08) == $n) {\n print $ans1;\n}\nelsif (floor($ans2 * 1.08) == $n) {\n print $ans2;\n}\nelse {\n print ':(';\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nTakahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it.\n\nThe consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \\times 1.08 yen (rounded down to the nearest integer).\n\nTakahashi forgot the price of his apple pie before tax, X, and wants to know it again. Write a program that takes N as input and finds X. We assume X is an integer.\n\nIf there are multiple possible values for X, find any one of them. Also, Takahashi's memory of N, the amount he paid, may be incorrect. If no value could be X, report that fact.\n\nConstraints\n\n1 \\leq N \\leq 50000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there are values that could be X, the price of the apple pie before tax, print any one of them.\n\nIf there are multiple such values, printing any one of them will be accepted.\n\nIf no value could be X, print :(.\n\nSample Input 1\n\n432\n\nSample Output 1\n\n400\n\nIf the apple pie is priced at 400 yen before tax, you have to pay 400 \\times 1.08 = 432 yen to buy one.\n\nOtherwise, the amount you have to pay will not be 432 yen.\n\nSample Input 2\n\n1079\n\nSample Output 2\n\n:(\n\nThere is no possible price before tax for which you have to pay 1079 yen with tax.\n\nSample Input 3\n\n1001\n\nSample Output 3\n\n927\n\nIf the apple pie is priced 927 yen before tax, by rounding down 927 \\times 1.08 = 1001.16, you have to pay 1001 yen.", "sample_input": "432\n"}, "reference_outputs": ["400\n"], "source_document_id": "p02842", "source_text": "Score: 200 points\n\nProblem Statement\n\nTakahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it.\n\nThe consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \\times 1.08 yen (rounded down to the nearest integer).\n\nTakahashi forgot the price of his apple pie before tax, X, and wants to know it again. Write a program that takes N as input and finds X. We assume X is an integer.\n\nIf there are multiple possible values for X, find any one of them. Also, Takahashi's memory of N, the amount he paid, may be incorrect. If no value could be X, report that fact.\n\nConstraints\n\n1 \\leq N \\leq 50000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there are values that could be X, the price of the apple pie before tax, print any one of them.\n\nIf there are multiple such values, printing any one of them will be accepted.\n\nIf no value could be X, print :(.\n\nSample Input 1\n\n432\n\nSample Output 1\n\n400\n\nIf the apple pie is priced at 400 yen before tax, you have to pay 400 \\times 1.08 = 432 yen to buy one.\n\nOtherwise, the amount you have to pay will not be 432 yen.\n\nSample Input 2\n\n1079\n\nSample Output 2\n\n:(\n\nThere is no possible price before tax for which you have to pay 1079 yen with tax.\n\nSample Input 3\n\n1001\n\nSample Output 3\n\n927\n\nIf the apple pie is priced 927 yen before tax, by rounding down 927 \\times 1.08 = 1001.16, you have to pay 1001 yen.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 243, "cpu_time_ms": 12, "memory_kb": 1920}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s812319920", "group_id": "codeNet:p02843", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $x = ;\n\nif ($x<100) {\n print \"0\\n\";\n exit;\n}\nmy $y = $x % 100;\nmy $cnt = ($x - $y) / 100;\nif ($y<=5*$cnt) {\n print \"1\\n\";\n} else {\n print \"0\\n\";\n}", "language": "Perl", "metadata": {"date": 1578186791, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02843.html", "problem_id": "p02843", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02843/input.txt", "sample_output_relpath": "derived/input_output/data/p02843/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02843/Perl/s812319920.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s812319920", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $x = ;\n\nif ($x<100) {\n print \"0\\n\";\n exit;\n}\nmy $y = $x % 100;\nmy $cnt = ($x - $y) / 100;\nif ($y<=5*$cnt) {\n print \"1\\n\";\n} else {\n print \"0\\n\";\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "sample_input": "615\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02843", "source_text": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 212, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s066881976", "group_id": "codeNet:p02843", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $x = ;\n\nif ($x<100) {\n print \"0/n\";\n exit;\n}\nmy $cnt = 0;\nmy $y;\nwhile ($x>=100) {\n $x -= 100;\n $y = $x;\n $cnt++;\n}\nif ($y<=5*$cnt) {\n print \"1\\n\";\n} else {\n print \"0\\n\";\n}", "language": "Perl", "metadata": {"date": 1578186233, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02843.html", "problem_id": "p02843", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02843/input.txt", "sample_output_relpath": "derived/input_output/data/p02843/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02843/Perl/s066881976.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s066881976", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $x = ;\n\nif ($x<100) {\n print \"0/n\";\n exit;\n}\nmy $cnt = 0;\nmy $y;\nwhile ($x>=100) {\n $x -= 100;\n $y = $x;\n $cnt++;\n}\nif ($y<=5*$cnt) {\n print \"1\\n\";\n} else {\n print \"0\\n\";\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "sample_input": "615\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02843", "source_text": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s611735337", "group_id": "codeNet:p02844", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nmy $s = ;\n\nmy @c;\nmy $cnt = 0;\nfor (my $i=0; $i<$n-2; $i++) {\n for (my $j=$i+1; $j<$n-1; $j++) {\n for (my $k=$j+1; $k<$n; $k++) {\n $c[$cnt++] = substr($s, $i, 1) . substr($s, $j, 1) . substr($s, $k, 1);\n }\n }\n}\nmy %uniq = map {$_ => 1} @c;\nmy $ans = keys %uniq;\n\nprint \"$ans\\n\";", "language": "Perl", "metadata": {"date": 1578188964, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02844.html", "problem_id": "p02844", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02844/input.txt", "sample_output_relpath": "derived/input_output/data/p02844/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02844/Perl/s611735337.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s611735337", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nmy $s = ;\n\nmy @c;\nmy $cnt = 0;\nfor (my $i=0; $i<$n-2; $i++) {\n for (my $j=$i+1; $j<$n-1; $j++) {\n for (my $k=$j+1; $k<$n; $k++) {\n $c[$cnt++] = substr($s, $i, 1) . substr($s, $j, 1) . substr($s, $k, 1);\n }\n }\n}\nmy %uniq = map {$_ => 1} @c;\nmy $ans = keys %uniq;\n\nprint \"$ans\\n\";", "problem_context": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "sample_input": "4\n0224\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02844", "source_text": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 377, "cpu_time_ms": 2124, "memory_kb": 345728}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s394291551", "group_id": "codeNet:p02846", "input_text": "$/=$*IN.words;$/=($3-$5)*$1-($_=($4-$2)*$0);say $/??0 max$_ div$/*2+?($_%$/)!!\"infinity\"", "language": "Perl", "metadata": {"date": 1575265337, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02846.html", "problem_id": "p02846", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02846/input.txt", "sample_output_relpath": "derived/input_output/data/p02846/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02846/Perl/s394291551.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s394291551", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$/=$*IN.words;$/=($3-$5)*$1-($_=($4-$2)*$0);say $/??0 max$_ div$/*2+?($_%$/)!!\"infinity\"", "problem_context": "Score: 600 points\n\nProblem Statement\n\nTakahashi and Aoki are training for long-distance races in an infinitely long straight course running from west to east.\n\nThey start simultaneously at the same point and moves as follows towards the east:\n\nTakahashi runs A_1 meters per minute for the first T_1 minutes, then runs at A_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.\n\nAoki runs B_1 meters per minute for the first T_1 minutes, then runs at B_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.\n\nHow many times will Takahashi and Aoki meet each other, that is, come to the same point? We do not count the start of the run. If they meet infinitely many times, report that fact.\n\nConstraints\n\n1 \\leq T_i \\leq 100000\n\n1 \\leq A_i \\leq 10^{10}\n\n1 \\leq B_i \\leq 10^{10}\n\nA_1 \\neq B_1\n\nA_2 \\neq B_2\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT_1 T_2\nA_1 A_2\nB_1 B_2\n\nOutput\n\nPrint the number of times Takahashi and Aoki will meet each other.\n\nIf they meet infinitely many times, print infinity instead.\n\nSample Input 1\n\n1 2\n10 10\n12 4\n\nSample Output 1\n\n1\n\nThey will meet just once, \\frac{4}{3} minutes after they start, at \\frac{40}{3} meters from where they start.\n\nSample Input 2\n\n100 1\n101 101\n102 1\n\nSample Output 2\n\ninfinity\n\nThey will meet 101, 202, 303, 404, 505, 606, ... minutes after they start, that is, they will meet infinitely many times.\n\nSample Input 3\n\n12000 15700\n3390000000 3810000000\n5550000000 2130000000\n\nSample Output 3\n\n113\n\nThe values in input may not fit into a 32-bit integer type.", "sample_input": "1 2\n10 10\n12 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02846", "source_text": "Score: 600 points\n\nProblem Statement\n\nTakahashi and Aoki are training for long-distance races in an infinitely long straight course running from west to east.\n\nThey start simultaneously at the same point and moves as follows towards the east:\n\nTakahashi runs A_1 meters per minute for the first T_1 minutes, then runs at A_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.\n\nAoki runs B_1 meters per minute for the first T_1 minutes, then runs at B_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.\n\nHow many times will Takahashi and Aoki meet each other, that is, come to the same point? We do not count the start of the run. If they meet infinitely many times, report that fact.\n\nConstraints\n\n1 \\leq T_i \\leq 100000\n\n1 \\leq A_i \\leq 10^{10}\n\n1 \\leq B_i \\leq 10^{10}\n\nA_1 \\neq B_1\n\nA_2 \\neq B_2\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT_1 T_2\nA_1 A_2\nB_1 B_2\n\nOutput\n\nPrint the number of times Takahashi and Aoki will meet each other.\n\nIf they meet infinitely many times, print infinity instead.\n\nSample Input 1\n\n1 2\n10 10\n12 4\n\nSample Output 1\n\n1\n\nThey will meet just once, \\frac{4}{3} minutes after they start, at \\frac{40}{3} meters from where they start.\n\nSample Input 2\n\n100 1\n101 101\n102 1\n\nSample Output 2\n\ninfinity\n\nThey will meet 101, 202, 303, 404, 505, 606, ... minutes after they start, that is, they will meet infinitely many times.\n\nSample Input 3\n\n12000 15700\n3390000000 3810000000\n5550000000 2130000000\n\nSample Output 3\n\n113\n\nThe values in input may not fit into a 32-bit integer type.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 88, "cpu_time_ms": 148, "memory_kb": 51452}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s816755257", "group_id": "codeNet:p02848", "input_text": "eval'print<>'.'=~y/A-Z/B-ZA/r'x<>", "language": "Perl", "metadata": {"date": 1574662031, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "low_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/Perl/s816755257.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s816755257", "user_id": "u283869437"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "eval'print<>'.'=~y/A-Z/B-ZA/r'x<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s973866128", "group_id": "codeNet:p02848", "input_text": "print eval'<>'.'=~y//\u0001-ZA/cr'x<>", "language": "Perl", "metadata": {"date": 1574653416, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "low_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/Perl/s973866128.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s973866128", "user_id": "u832039789"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "print eval'<>'.'=~y//\u0001-ZA/cr'x<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s157114053", "group_id": "codeNet:p02850", "input_text": "$i=%u=(),map{0while$m[$i]=$u{$_=++$i}}grep$_<++$u{$_},@A[@$_]for map{$%&&push@$_,$%for glob;++$%}<>;print\"$#m@A\"", "language": "Perl", "metadata": {"date": 1579494666, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02850.html", "problem_id": "p02850", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02850/input.txt", "sample_output_relpath": "derived/input_output/data/p02850/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02850/Perl/s157114053.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s157114053", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n1\n2\n", "input_to_evaluate": "$i=%u=(),map{0while$m[$i]=$u{$_=++$i}}grep$_<++$u{$_},@A[@$_]for map{$%&&push@$_,$%for glob;++$%}<>;print\"$#m@A\"", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\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\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "sample_input": "3\n1 2\n2 3\n"}, "reference_outputs": ["2\n1\n2\n"], "source_document_id": "p02850", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\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\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 112, "cpu_time_ms": 1319, "memory_kb": 98460}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s917717887", "group_id": "codeNet:p02850", "input_text": "map{$i=%u=0;map{0while$u{$_=++$i}}grep++$u{$_}*!$_,@A[@$_];$m+=$-=$i-$m}map{$%&&push@$_,$%for glob;++$%}<>;print\"$m@A\"", "language": "Perl", "metadata": {"date": 1574670838, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02850.html", "problem_id": "p02850", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02850/input.txt", "sample_output_relpath": "derived/input_output/data/p02850/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02850/Perl/s917717887.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s917717887", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n1\n2\n", "input_to_evaluate": "map{$i=%u=0;map{0while$u{$_=++$i}}grep++$u{$_}*!$_,@A[@$_];$m+=$-=$i-$m}map{$%&&push@$_,$%for glob;++$%}<>;print\"$m@A\"", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\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\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "sample_input": "3\n1 2\n2 3\n"}, "reference_outputs": ["2\n1\n2\n"], "source_document_id": "p02850", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\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\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1298, "memory_kb": 99224}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s712377942", "group_id": "codeNet:p02851", "input_text": "push(@_,($n+=$_-1)%=$')>$'&&$#{shift@_}--,$\\+=++$#$n for<>=~$\",glob<>;print", "language": "Perl", "metadata": {"date": 1574666495, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02851.html", "problem_id": "p02851", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02851/input.txt", "sample_output_relpath": "derived/input_output/data/p02851/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02851/Perl/s712377942.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s712377942", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "push(@_,($n+=$_-1)%=$')>$'&&$#{shift@_}--,$\\+=++$#$n for<>=~$\",glob<>;print", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\n\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequences different if they are taken from different positions, even if they are equal sequences.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\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 K\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the number of subsequences that satisfy the condition.\n\nSample Input 1\n\n5 4\n1 4 2 3 5\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: (1), (4,2), (1,4,2), and (5).\n\nSample Input 2\n\n8 4\n4 2 4 2 4 2 4 2\n\nSample Output 2\n\n7\n\n(4,2) is counted four times, and (2,4) is counted three times.\n\nSample Input 3\n\n10 7\n14 15 92 65 35 89 79 32 38 46\n\nSample Output 3\n\n8", "sample_input": "5 4\n1 4 2 3 5\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02851", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\n\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequences different if they are taken from different positions, even if they are equal sequences.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\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 K\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the number of subsequences that satisfy the condition.\n\nSample Input 1\n\n5 4\n1 4 2 3 5\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: (1), (4,2), (1,4,2), and (5).\n\nSample Input 2\n\n8 4\n4 2 4 2 4 2 4 2\n\nSample Output 2\n\n7\n\n(4,2) is counted four times, and (2,4) is counted three times.\n\nSample Input 3\n\n10 7\n14 15 92 65 35 89 79 32 38 46\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 75, "cpu_time_ms": 1049, "memory_kb": 194348}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s451493618", "group_id": "codeNet:p02851", "input_text": "push(@_,($n+=$_-1)%=$')>$'&&$_{shift@_}--,$\\+=$_{$n}++for<>=~$\",glob<>;print", "language": "Perl", "metadata": {"date": 1574666303, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02851.html", "problem_id": "p02851", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02851/input.txt", "sample_output_relpath": "derived/input_output/data/p02851/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02851/Perl/s451493618.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s451493618", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "push(@_,($n+=$_-1)%=$')>$'&&$_{shift@_}--,$\\+=$_{$n}++for<>=~$\",glob<>;print", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\n\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequences different if they are taken from different positions, even if they are equal sequences.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\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 K\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the number of subsequences that satisfy the condition.\n\nSample Input 1\n\n5 4\n1 4 2 3 5\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: (1), (4,2), (1,4,2), and (5).\n\nSample Input 2\n\n8 4\n4 2 4 2 4 2 4 2\n\nSample Output 2\n\n7\n\n(4,2) is counted four times, and (2,4) is counted three times.\n\nSample Input 3\n\n10 7\n14 15 92 65 35 89 79 32 38 46\n\nSample Output 3\n\n8", "sample_input": "5 4\n1 4 2 3 5\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02851", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\n\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequences different if they are taken from different positions, even if they are equal sequences.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\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 K\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the number of subsequences that satisfy the condition.\n\nSample Input 1\n\n5 4\n1 4 2 3 5\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: (1), (4,2), (1,4,2), and (5).\n\nSample Input 2\n\n8 4\n4 2 4 2 4 2 4 2\n\nSample Output 2\n\n7\n\n(4,2) is counted four times, and (2,4) is counted three times.\n\nSample Input 3\n\n10 7\n14 15 92 65 35 89 79 32 38 46\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 742, "memory_kb": 79788}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s196970898", "group_id": "codeNet:p02851", "input_text": "--$#{0+shift@_},$\\+=++$#{$_[$'-1]=($s+=$_-1)%=$'}for<>!~$\",glob<>;print", "language": "Perl", "metadata": {"date": 1574664982, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02851.html", "problem_id": "p02851", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02851/input.txt", "sample_output_relpath": "derived/input_output/data/p02851/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02851/Perl/s196970898.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s196970898", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "--$#{0+shift@_},$\\+=++$#{$_[$'-1]=($s+=$_-1)%=$'}for<>!~$\",glob<>;print", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\n\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequences different if they are taken from different positions, even if they are equal sequences.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\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 K\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the number of subsequences that satisfy the condition.\n\nSample Input 1\n\n5 4\n1 4 2 3 5\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: (1), (4,2), (1,4,2), and (5).\n\nSample Input 2\n\n8 4\n4 2 4 2 4 2 4 2\n\nSample Output 2\n\n7\n\n(4,2) is counted four times, and (2,4) is counted three times.\n\nSample Input 3\n\n10 7\n14 15 92 65 35 89 79 32 38 46\n\nSample Output 3\n\n8", "sample_input": "5 4\n1 4 2 3 5\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02851", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\n\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequences different if they are taken from different positions, even if they are equal sequences.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\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 K\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the number of subsequences that satisfy the condition.\n\nSample Input 1\n\n5 4\n1 4 2 3 5\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: (1), (4,2), (1,4,2), and (5).\n\nSample Input 2\n\n8 4\n4 2 4 2 4 2 4 2\n\nSample Output 2\n\n7\n\n(4,2) is counted four times, and (2,4) is counted three times.\n\nSample Input 3\n\n10 7\n14 15 92 65 35 89 79 32 38 46\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1906, "memory_kb": 1991040}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s366863160", "group_id": "codeNet:p02852", "input_text": "($n,$k)=glob<>;$,=$\";@_=<>=~/./g;$n-=$i=(-1,grep$n>=$_&!$_[$n-$_],1..$k)[-1],$i<0?@a=$n=-1:unshift@a,$i while$n>0;print@a", "language": "Perl", "metadata": {"date": 1574667154, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02852.html", "problem_id": "p02852", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02852/input.txt", "sample_output_relpath": "derived/input_output/data/p02852/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02852/Perl/s366863160.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s366863160", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1 3 2 3\n", "input_to_evaluate": "($n,$k)=glob<>;$,=$\";@_=<>=~/./g;$n-=$i=(-1,grep$n>=$_&!$_[$n-$_],1..$k)[-1],$i<0?@a=$n=-1:unshift@a,$i while$n>0;print@a", "problem_context": "Score : 600 points\n\nProblem Statement\n\nTakahashi is playing a board game called Sugoroku.\n\nOn the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.\n\nThe game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.\n\nAdditionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \\leq i \\leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.\n\nFind the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n|S| = N + 1\n\nS consists of 0 and 1.\n\nS[0] = 0\n\nS[N] = 0\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\n\nOutput\n\nIf Takahashi can win the game, print the lexicographically smallest sequence among the shortest sequences of numbers coming up in the roulette in which Takahashi can win the game, with spaces in between.\n\nIf Takahashi cannot win the game, print -1.\n\nSample Input 1\n\n9 3\n0001000100\n\nSample Output 1\n\n1 3 2 3\n\nIf the numbers 1, 3, 2, 3 come up in this order, Takahashi can reach Square 9 via Square 1, 4, and 6. He cannot reach Square 9 in three or fewer turns, and this is the lexicographically smallest sequence in which he reaches Square 9 in four turns.\n\nSample Input 2\n\n5 4\n011110\n\nSample Output 2\n\n-1\n\nTakahashi cannot reach Square 5.\n\nSample Input 3\n\n6 6\n0101010\n\nSample Output 3\n\n6", "sample_input": "9 3\n0001000100\n"}, "reference_outputs": ["1 3 2 3\n"], "source_document_id": "p02852", "source_text": "Score : 600 points\n\nProblem Statement\n\nTakahashi is playing a board game called Sugoroku.\n\nOn the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.\n\nThe game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.\n\nAdditionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \\leq i \\leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.\n\nFind the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n|S| = N + 1\n\nS consists of 0 and 1.\n\nS[0] = 0\n\nS[N] = 0\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\n\nOutput\n\nIf Takahashi can win the game, print the lexicographically smallest sequence among the shortest sequences of numbers coming up in the roulette in which Takahashi can win the game, with spaces in between.\n\nIf Takahashi cannot win the game, print -1.\n\nSample Input 1\n\n9 3\n0001000100\n\nSample Output 1\n\n1 3 2 3\n\nIf the numbers 1, 3, 2, 3 come up in this order, Takahashi can reach Square 9 via Square 1, 4, and 6. He cannot reach Square 9 in three or fewer turns, and this is the lexicographically smallest sequence in which he reaches Square 9 in four turns.\n\nSample Input 2\n\n5 4\n011110\n\nSample Output 2\n\n-1\n\nTakahashi cannot reach Square 5.\n\nSample Input 3\n\n6 6\n0101010\n\nSample Output 3\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 117, "memory_kb": 15616}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s185628907", "group_id": "codeNet:p02854", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nmy @a;\n{\n my $in = ;\n @a = split(\" \", $in);\n}\nmy $l = 0;\nmy $r = 0;\nmy $li = 0;\nmy $ri = $n - 1;\nwhile ($ri-$li>=0) {\n if ($l<=$r) {\n $l += $a[$li];\n $li++;\n } else {\n $r += $a[$ri];\n $ri--;\n }\n}\nmy $ans = abs($l-$r);\n\nprint \"$ans\\n\";", "language": "Perl", "metadata": {"date": 1578235695, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02854.html", "problem_id": "p02854", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02854/input.txt", "sample_output_relpath": "derived/input_output/data/p02854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02854/Perl/s185628907.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s185628907", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nmy @a;\n{\n my $in = ;\n @a = split(\" \", $in);\n}\nmy $l = 0;\nmy $r = 0;\nmy $li = 0;\nmy $ri = $n - 1;\nwhile ($ri-$li>=0) {\n if ($l<=$r) {\n $l += $a[$li];\n $li++;\n } else {\n $r += $a[$ri];\n $ri--;\n }\n}\nmy $ans = abs($l-$r);\n\nprint \"$ans\\n\";", "problem_context": "Score: 200 points\n\nProblem Statement\n\nTakahashi, who works at DISCO, is standing before an iron bar.\nThe bar has N-1 notches, which divide the bar into N sections. The i-th section from the left has a length of A_i millimeters.\n\nTakahashi wanted to choose a notch and cut the bar at that point into two parts with the same length.\nHowever, this may not be possible as is, so he will do the following operations some number of times before he does the cut:\n\nChoose one section and expand it, increasing its length by 1 millimeter. Doing this operation once costs 1 yen (the currency of Japan).\n\nChoose one section of length at least 2 millimeters and shrink it, decreasing its length by 1 millimeter. Doing this operation once costs 1 yen.\n\nFind the minimum amount of money needed before cutting the bar into two parts with the same length.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 2020202020\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_3 ... A_N\n\nOutput\n\nPrint an integer representing the minimum amount of money needed before cutting the bar into two parts with the same length.\n\nSample Input 1\n\n3\n2 4 3\n\nSample Output 1\n\n3\n\nThe initial lengths of the sections are [2, 4, 3] (in millimeters). Takahashi can cut the bar equally after doing the following operations for 3 yen:\n\nShrink the second section from the left. The lengths of the sections are now [2, 3, 3].\n\nShrink the first section from the left. The lengths of the sections are now [1, 3, 3].\n\nShrink the second section from the left. The lengths of the sections are now [1, 2, 3], and we can cut the bar at the second notch from the left into two parts of length 3 each.\n\nSample Input 2\n\n12\n100 104 102 105 103 103 101 105 104 102 104 101\n\nSample Output 2\n\n0", "sample_input": "3\n2 4 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02854", "source_text": "Score: 200 points\n\nProblem Statement\n\nTakahashi, who works at DISCO, is standing before an iron bar.\nThe bar has N-1 notches, which divide the bar into N sections. The i-th section from the left has a length of A_i millimeters.\n\nTakahashi wanted to choose a notch and cut the bar at that point into two parts with the same length.\nHowever, this may not be possible as is, so he will do the following operations some number of times before he does the cut:\n\nChoose one section and expand it, increasing its length by 1 millimeter. Doing this operation once costs 1 yen (the currency of Japan).\n\nChoose one section of length at least 2 millimeters and shrink it, decreasing its length by 1 millimeter. Doing this operation once costs 1 yen.\n\nFind the minimum amount of money needed before cutting the bar into two parts with the same length.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 2020202020\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_3 ... A_N\n\nOutput\n\nPrint an integer representing the minimum amount of money needed before cutting the bar into two parts with the same length.\n\nSample Input 1\n\n3\n2 4 3\n\nSample Output 1\n\n3\n\nThe initial lengths of the sections are [2, 4, 3] (in millimeters). Takahashi can cut the bar equally after doing the following operations for 3 yen:\n\nShrink the second section from the left. The lengths of the sections are now [2, 3, 3].\n\nShrink the first section from the left. The lengths of the sections are now [1, 3, 3].\n\nShrink the second section from the left. The lengths of the sections are now [1, 2, 3], and we can cut the bar at the second notch from the left into two parts of length 3 each.\n\nSample Input 2\n\n12\n100 104 102 105 103 103 101 105 104 102 104 101\n\nSample Output 2\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 123, "memory_kb": 34212}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s388098371", "group_id": "codeNet:p02856", "input_text": "<>;/ /,$s+=$'+$'*$`/9for<>;print$s-1|0", "language": "Perl", "metadata": {"date": 1574567752, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02856.html", "problem_id": "p02856", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02856/input.txt", "sample_output_relpath": "derived/input_output/data/p02856/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02856/Perl/s388098371.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s388098371", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;/ /,$s+=$'+$'*$`/9for<>;print$s-1|0", "problem_context": "Score: 500 points\n\nProblem Statement\n\nN programmers are going to participate in the preliminary stage of DDCC 20XX. Due to the size of the venue, however, at most 9 contestants can participate in the finals.\n\nThe preliminary stage consists of several rounds, which will take place as follows:\n\nAll the N contestants will participate in the first round.\n\nWhen X contestants participate in some round, the number of contestants advancing to the next round will be decided as follows:\n\nThe organizer will choose two consecutive digits in the decimal notation of X, and replace them with the sum of these digits. The number resulted will be the number of contestants advancing to the next round.\n\nFor example, when X = 2378, the number of contestants advancing to the next round will be 578 (if 2 and 3 are chosen), 2108 (if 3 and 7 are chosen), or 2315 (if 7 and 8 are chosen).\n\nWhen X = 100, the number of contestants advancing to the next round will be 10, no matter which two digits are chosen.\n\nThe preliminary stage ends when 9 or fewer contestants remain.\n\nRingo, the chief organizer, wants to hold as many rounds as possible.\nFind the maximum possible number of rounds in the preliminary stage.\n\nSince the number of contestants, N, can be enormous, it is given to you as two integer sequences d_1, \\ldots, d_M and c_1, \\ldots, c_M, which means the following: the decimal notation of N consists of c_1 + c_2 + \\ldots + c_M digits, whose first c_1 digits are all d_1, the following c_2 digits are all d_2, \\ldots, and the last c_M digits are all d_M.\n\nConstraints\n\n1 \\leq M \\leq 200000\n\n0 \\leq d_i \\leq 9\n\nd_1 \\neq 0\n\nd_i \\neq d_{i+1}\n\nc_i \\geq 1\n\n2 \\leq c_1 + \\ldots + c_M \\leq 10^{15}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\nd_1 c_1\nd_2 c_2\n:\nd_M c_M\n\nOutput\n\nPrint the maximum possible number of rounds in the preliminary stage.\n\nSample Input 1\n\n2\n2 2\n9 1\n\nSample Output 1\n\n3\n\nIn this case, N = 229 contestants will participate in the first round. One possible progression of the preliminary stage is as follows:\n\n229 contestants participate in Round 1, 49 contestants participate in Round 2, 13 contestants participate in Round 3, and 4 contestants advance to the finals.\n\nHere, three rounds take place in the preliminary stage, which is the maximum possible number.\n\nSample Input 2\n\n3\n1 1\n0 8\n7 1\n\nSample Output 2\n\n9\n\nIn this case, 1000000007 will participate in the first round.", "sample_input": "2\n2 2\n9 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02856", "source_text": "Score: 500 points\n\nProblem Statement\n\nN programmers are going to participate in the preliminary stage of DDCC 20XX. Due to the size of the venue, however, at most 9 contestants can participate in the finals.\n\nThe preliminary stage consists of several rounds, which will take place as follows:\n\nAll the N contestants will participate in the first round.\n\nWhen X contestants participate in some round, the number of contestants advancing to the next round will be decided as follows:\n\nThe organizer will choose two consecutive digits in the decimal notation of X, and replace them with the sum of these digits. The number resulted will be the number of contestants advancing to the next round.\n\nFor example, when X = 2378, the number of contestants advancing to the next round will be 578 (if 2 and 3 are chosen), 2108 (if 3 and 7 are chosen), or 2315 (if 7 and 8 are chosen).\n\nWhen X = 100, the number of contestants advancing to the next round will be 10, no matter which two digits are chosen.\n\nThe preliminary stage ends when 9 or fewer contestants remain.\n\nRingo, the chief organizer, wants to hold as many rounds as possible.\nFind the maximum possible number of rounds in the preliminary stage.\n\nSince the number of contestants, N, can be enormous, it is given to you as two integer sequences d_1, \\ldots, d_M and c_1, \\ldots, c_M, which means the following: the decimal notation of N consists of c_1 + c_2 + \\ldots + c_M digits, whose first c_1 digits are all d_1, the following c_2 digits are all d_2, \\ldots, and the last c_M digits are all d_M.\n\nConstraints\n\n1 \\leq M \\leq 200000\n\n0 \\leq d_i \\leq 9\n\nd_1 \\neq 0\n\nd_i \\neq d_{i+1}\n\nc_i \\geq 1\n\n2 \\leq c_1 + \\ldots + c_M \\leq 10^{15}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\nd_1 c_1\nd_2 c_2\n:\nd_M c_M\n\nOutput\n\nPrint the maximum possible number of rounds in the preliminary stage.\n\nSample Input 1\n\n2\n2 2\n9 1\n\nSample Output 1\n\n3\n\nIn this case, N = 229 contestants will participate in the first round. One possible progression of the preliminary stage is as follows:\n\n229 contestants participate in Round 1, 49 contestants participate in Round 2, 13 contestants participate in Round 3, and 4 contestants advance to the finals.\n\nHere, three rounds take place in the preliminary stage, which is the maximum possible number.\n\nSample Input 2\n\n3\n1 1\n0 8\n7 1\n\nSample Output 2\n\n9\n\nIn this case, 1000000007 will participate in the first round.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 228, "memory_kb": 30080}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s258060154", "group_id": "codeNet:p02859", "input_text": "print<>**2", "language": "Perl", "metadata": {"date": 1599966270, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02859.html", "problem_id": "p02859", "resource_group": "low_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/Perl/s258060154.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s258060154", "user_id": "u172873334"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "print<>**2", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 10, "cpu_time_ms": 6, "memory_kb": 4688}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s509727167", "group_id": "codeNet:p02860", "input_text": "my $n = glob<>;\nmy $s = glob<>;\n\nmy $len = length $s;\nprint substr($s, 0, $len + 1 >> 1) eq substr($s, $len + 1 >> 1) ? \"Yes\" : \"No\";", "language": "Perl", "metadata": {"date": 1587879249, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02860.html", "problem_id": "p02860", "resource_group": "low_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/Perl/s509727167.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s509727167", "user_id": "u569322757"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $n = glob<>;\nmy $s = glob<>;\n\nmy $len = length $s;\nprint substr($s, 0, $len + 1 >> 1) eq substr($s, $len + 1 >> 1) ? \"Yes\" : \"No\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s742189166", "group_id": "codeNet:p02860", "input_text": "<>;print<>=~/^(.*)\\1$/?Yes:No", "language": "Perl", "metadata": {"date": 1573956332, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02860.html", "problem_id": "p02860", "resource_group": "low_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/Perl/s742189166.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s742189166", "user_id": "u207056619"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "<>;print<>=~/^(.*)\\1$/?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 29, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s928544701", "group_id": "codeNet:p02865", "input_text": "#A \n\n$in_N = ;\n\n$in_int_N = int($in_N);\n$ans = ($in_int_N - ($in_int_N % 2)) / 2;\n\nprint \"$ans\\n\";\n", "language": "Perl", "metadata": {"date": 1573356010, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02865.html", "problem_id": "p02865", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02865/input.txt", "sample_output_relpath": "derived/input_output/data/p02865/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02865/Perl/s928544701.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s928544701", "user_id": "u365612501"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#A \n\n$in_N = ;\n\n$in_int_N = int($in_N);\n$ans = ($in_int_N - ($in_int_N % 2)) / 2;\n\nprint \"$ans\\n\";\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\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.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "sample_input": "4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02865", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\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.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s070825688", "group_id": "codeNet:p02866", "input_text": "#!/usr/bin/perl\n\nmy $md = 998244353;\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @d = map { $_ - 0 } split(/\\s+/,);\n\nif( $d[0] != 0 ){\n print \"0\\n\";\n exit(0);\n}\n\nif( $n == 1 ){\n print \"1\\n\";\n exit(0);\n}\n\nmy $mx = 0;\nmy @ct = ();\n$#ct = $n;\nfor(my $i=1;$i<$n;$i++){\n $ct[$d[$i]] ++;\n $mx = $d[$i] if $d[$i] > $mx;\n}\n\nmy $r = 1;\nmy $c = 1;\nfor(my $i=1;$i<=$mx;$i++){\n my $c1 = $ct[$i] - 0;\n my $a = 1;\n for(my $j=0;$j<$c1;$j++){\n $a = ( $a * $c ) % $md;\n }\n $r = ( $r * $a ) % $md;\n $c = $c1;\n}\nprint \"$r\\n\";\n", "language": "Perl", "metadata": {"date": 1573352672, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02866.html", "problem_id": "p02866", "resource_group": "low_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/Perl/s070825688.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s070825688", "user_id": "u750383873"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy $md = 998244353;\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @d = map { $_ - 0 } split(/\\s+/,);\n\nif( $d[0] != 0 ){\n print \"0\\n\";\n exit(0);\n}\n\nif( $n == 1 ){\n print \"1\\n\";\n exit(0);\n}\n\nmy $mx = 0;\nmy @ct = ();\n$#ct = $n;\nfor(my $i=1;$i<$n;$i++){\n $ct[$d[$i]] ++;\n $mx = $d[$i] if $d[$i] > $mx;\n}\n\nmy $r = 1;\nmy $c = 1;\nfor(my $i=1;$i<=$mx;$i++){\n my $c1 = $ct[$i] - 0;\n my $a = 1;\n for(my $j=0;$j<$c1;$j++){\n $a = ( $a * $c ) % $md;\n }\n $r = ( $r * $a ) % $md;\n $c = $c1;\n}\nprint \"$r\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 536, "cpu_time_ms": 140, "memory_kb": 19148}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s122109755", "group_id": "codeNet:p02867", "input_text": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @A = map { $_ - 0 } split(/\\s+/,);\nmy @B = map { $_ - 0 } split(/\\s+/,);\n\nmy @sA = sort { $a <=> $b } @A;\nmy @sB = sort { $a <=> $b } @B;\n\nfor(my $i=0;$i<$n;$i++){\n if( $sA[$i] > $sB[$i] ){\n print \"No\\n\"; exit(0);\n }\n}\n\nmy $j = $n - 1;\nmy $c = 0;\nfor(my $i=0;$i<$n;$i++){\n my $k = $sA[$n-1-$i];\n while( $sB[$j] >= $k and $j>=0 ){\n $c ++;\n $j --;\n }\n if( ( 1 + $i ) < $k ){\n print \"Yes\\n\"; exit(0);\n }\n}\n\nprint \"No\\n\"; exit(0);\n\n", "language": "Perl", "metadata": {"date": 1573354397, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02867.html", "problem_id": "p02867", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02867/input.txt", "sample_output_relpath": "derived/input_output/data/p02867/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02867/Perl/s122109755.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s122109755", "user_id": "u750383873"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @A = map { $_ - 0 } split(/\\s+/,);\nmy @B = map { $_ - 0 } split(/\\s+/,);\n\nmy @sA = sort { $a <=> $b } @A;\nmy @sB = sort { $a <=> $b } @B;\n\nfor(my $i=0;$i<$n;$i++){\n if( $sA[$i] > $sB[$i] ){\n print \"No\\n\"; exit(0);\n }\n}\n\nmy $j = $n - 1;\nmy $c = 0;\nfor(my $i=0;$i<$n;$i++){\n my $k = $sA[$n-1-$i];\n while( $sB[$j] >= $k and $j>=0 ){\n $c ++;\n $j --;\n }\n if( ( 1 + $i ) < $k ){\n print \"Yes\\n\"; exit(0);\n }\n}\n\nprint \"No\\n\"; exit(0);\n\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are two integer sequences of N elements each: A_1,...,A_N and B_1,...,B_N.\nDetermine if it is possible to do the following operation at most N-2 times (possibly zero) so that, for every integer i from 1 to N, A_i \\leq B_i holds:\n\nChoose two distinct integers x and y between 1 and N (inclusive), and swap the values of A_x and A_y.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i,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\nB_1 B_2 ... B_N\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\n3\n1 3 2\n1 2 3\n\nSample Output 1\n\nYes\n\nWe should swap the values of A_2 and A_3.\n\nSample Input 2\n\n3\n1 2 3\n2 2 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n3 1 2 6 3 4\n2 2 8 3 4 3\n\nSample Output 3\n\nYes", "sample_input": "3\n1 3 2\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02867", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are two integer sequences of N elements each: A_1,...,A_N and B_1,...,B_N.\nDetermine if it is possible to do the following operation at most N-2 times (possibly zero) so that, for every integer i from 1 to N, A_i \\leq B_i holds:\n\nChoose two distinct integers x and y between 1 and N (inclusive), and swap the values of A_x and A_y.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i,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\nB_1 B_2 ... B_N\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\n3\n1 3 2\n1 2 3\n\nSample Output 1\n\nYes\n\nWe should swap the values of A_2 and A_3.\n\nSample Input 2\n\n3\n1 2 3\n2 2 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n3 1 2 6 3 4\n2 2 8 3 4 3\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 143, "memory_kb": 23616}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s768528365", "group_id": "codeNet:p02873", "input_text": "!/$~/&&($\\+=/>/?0:$%<$u?$u:$%,$u=$%,$%=0),$~=$_,$\\+=$%++for<>=~/./sg;print", "language": "Perl", "metadata": {"date": 1572988619, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02873.html", "problem_id": "p02873", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02873/input.txt", "sample_output_relpath": "derived/input_output/data/p02873/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02873/Perl/s768528365.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s768528365", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "!/$~/&&($\\+=/>/?0:$%<$u?$u:$%,$u=$%,$%=0),$~=$_,$\\+=$%++for<>=~/./sg;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S of length N-1.\nEach character in S is < or >.\n\nA sequence of N non-negative integers, a_1,a_2,\\cdots,a_N, is said to be good when the following condition is satisfied for all i (1 \\leq i \\leq N-1):\n\nIf S_i= <: a_i: a_i>a_{i+1}\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^5\n\nS is a string of length N-1 consisting of < and >.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nSample Input 1\n\n<>>\n\nSample Output 1\n\n3\n\na=(0,2,1,0) is a good sequence whose sum is 3.\nThere is no good sequence whose sum is less than 3.\n\nSample Input 2\n\n<>>><<><<<<<>>><\n\nSample Output 2\n\n28", "sample_input": "<>>\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02873", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S of length N-1.\nEach character in S is < or >.\n\nA sequence of N non-negative integers, a_1,a_2,\\cdots,a_N, is said to be good when the following condition is satisfied for all i (1 \\leq i \\leq N-1):\n\nIf S_i= <: a_i: a_i>a_{i+1}\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^5\n\nS is a string of length N-1 consisting of < and >.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nSample Input 1\n\n<>>\n\nSample Output 1\n\n3\n\na=(0,2,1,0) is a good sequence whose sum is 3.\nThere is no good sequence whose sum is less than 3.\n\nSample Input 2\n\n<>>><<><<<<<>>><\n\nSample Output 2\n\n28", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1298, "memory_kb": 44108}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s362192925", "group_id": "codeNet:p02873", "input_text": "!/$~/&&($\\-=/$u?$u:$%:0,$u=$%,$%=0),$~=$_,$\\+=++$%for<>=~/./mg;print", "language": "Perl", "metadata": {"date": 1572988301, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02873.html", "problem_id": "p02873", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02873/input.txt", "sample_output_relpath": "derived/input_output/data/p02873/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02873/Perl/s362192925.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s362192925", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "!/$~/&&($\\-=/$u?$u:$%:0,$u=$%,$%=0),$~=$_,$\\+=++$%for<>=~/./mg;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S of length N-1.\nEach character in S is < or >.\n\nA sequence of N non-negative integers, a_1,a_2,\\cdots,a_N, is said to be good when the following condition is satisfied for all i (1 \\leq i \\leq N-1):\n\nIf S_i= <: a_i: a_i>a_{i+1}\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^5\n\nS is a string of length N-1 consisting of < and >.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nSample Input 1\n\n<>>\n\nSample Output 1\n\n3\n\na=(0,2,1,0) is a good sequence whose sum is 3.\nThere is no good sequence whose sum is less than 3.\n\nSample Input 2\n\n<>>><<><<<<<>>><\n\nSample Output 2\n\n28", "sample_input": "<>>\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02873", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S of length N-1.\nEach character in S is < or >.\n\nA sequence of N non-negative integers, a_1,a_2,\\cdots,a_N, is said to be good when the following condition is satisfied for all i (1 \\leq i \\leq N-1):\n\nIf S_i= <: a_i: a_i>a_{i+1}\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^5\n\nS is a string of length N-1 consisting of < and >.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nSample Input 1\n\n<>>\n\nSample Output 1\n\n3\n\na=(0,2,1,0) is a good sequence whose sum is 3.\nThere is no good sequence whose sum is less than 3.\n\nSample Input 2\n\n<>>><<><<<<<>>><\n\nSample Output 2\n\n28", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1317, "memory_kb": 46116}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s439379006", "group_id": "codeNet:p02880", "input_text": "[+get∈^10 X*^10].say", "language": "Perl", "metadata": {"date": 1572225956, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02880.html", "problem_id": "p02880", "resource_group": "low_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/Perl/s439379006.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s439379006", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "[+get∈^10 X*^10].say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 759, "memory_kb": 65016}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s419887099", "group_id": "codeNet:p02880", "input_text": "my $N = ;\nchomp($N);\nforeach my $i (1..9) {\n my $m = $N % $i;\n if ($m == 0) {\n my $a = $N/$i;\n if ( $a < 10 and $a > 0 ) {\n print \"Yes\";\n exit 0;\n }\n }\n}\nprint \"No\";", "language": "Perl", "metadata": {"date": 1572225360, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02880.html", "problem_id": "p02880", "resource_group": "low_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/Perl/s419887099.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s419887099", "user_id": "u807948625"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $N = ;\nchomp($N);\nforeach my $i (1..9) {\n my $m = $N % $i;\n if ($m == 0) {\n my $a = $N/$i;\n if ( $a < 10 and $a > 0 ) {\n print \"Yes\";\n exit 0;\n }\n }\n}\nprint \"No\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 224, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s316362268", "group_id": "codeNet:p02881", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nfor (my $i=int($n**0.5); $i>=1; $i--)\n{\n if ($n%$i==0)\n {\n my $ans = $i+$n/$i-2;\n print \"$ans\\n\";\n exit;\n }\n}", "language": "Perl", "metadata": {"date": 1578869065, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02881.html", "problem_id": "p02881", "resource_group": "low_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/Perl/s316362268.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s316362268", "user_id": "u979552932"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = ;\nfor (my $i=int($n**0.5); $i>=1; $i--)\n{\n if ($n%$i==0)\n {\n my $ans = $i+$n/$i-2;\n print \"$ans\\n\";\n exit;\n }\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 133, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s576712213", "group_id": "codeNet:p02881", "input_text": "$N=<>;$N%$_ or$\\=$N/$_+$_-2for 1..2e6;print", "language": "Perl", "metadata": {"date": 1572230526, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02881.html", "problem_id": "p02881", "resource_group": "low_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/Perl/s576712213.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s576712213", "user_id": "u032223772"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "$N=<>;$N%$_ or$\\=$N/$_+$_-2for 1..2e6;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 124, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s264804235", "group_id": "codeNet:p02881", "input_text": "$_=$a=<>;$a%$b||($_-=$-=$_-$b-$a/$b+2)while$b++<2e6;print", "language": "Perl", "metadata": {"date": 1572229167, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02881.html", "problem_id": "p02881", "resource_group": "low_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/Perl/s264804235.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s264804235", "user_id": "u032223772"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "$_=$a=<>;$a%$b||($_-=$-=$_-$b-$a/$b+2)while$b++<2e6;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 187, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s794438618", "group_id": "codeNet:p02882", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse Math::Trig qw/atan pi/;\n\nmy ($a, $b, $x);\n{\n my $in = ;\n ($a, $b, $x) = split(\" \", $in);\n}\nmy $ans = 0.0;\nif ($a*$a*$b/2>$x)\n{\n $ans = 90-atan($x*2/$b/$a/$b)*180/pi;\n}\nelsif ($a*$a*$b/2==$x)\n{\n $ans = atan($a/$b)*180/pi;\n}\nelse\n{\n $ans = atan(($a*$a*$b-$x)/$a/$a/$a*2)*180/pi;\n}\nprint \"$ans\\n\";", "language": "Perl", "metadata": {"date": 1578870405, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02882.html", "problem_id": "p02882", "resource_group": "low_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/Perl/s794438618.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s794438618", "user_id": "u979552932"}, "prompt_components": {"gold_output": "45.0000000000\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse Math::Trig qw/atan pi/;\n\nmy ($a, $b, $x);\n{\n my $in = ;\n ($a, $b, $x) = split(\" \", $in);\n}\nmy $ans = 0.0;\nif ($a*$a*$b/2>$x)\n{\n $ans = 90-atan($x*2/$b/$a/$b)*180/pi;\n}\nelsif ($a*$a*$b/2==$x)\n{\n $ans = atan($a/$b)*180/pi;\n}\nelse\n{\n $ans = atan(($a*$a*$b-$x)/$a/$a/$a*2)*180/pi;\n}\nprint \"$ans\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 18, "memory_kb": 2944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s011315853", "group_id": "codeNet:p02884", "input_text": "map$q[$_]+=$q[$N]/@$N,@{/ /,push@\n$`,$' for<>;++$N}for++$q[1]..<>;while(--$N){$b=1;$e[$N]=$b+=$_/@@for@@=@e[@$N];$a<($~=$q[$N]*($b-1-$_)/($#@||1))or$a=$~for@@}print$a+$b", "language": "Perl", "metadata": {"date": 1572317757, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02884.html", "problem_id": "p02884", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02884/input.txt", "sample_output_relpath": "derived/input_output/data/p02884/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02884/Perl/s011315853.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s011315853", "user_id": "u049095189"}, "prompt_components": {"gold_output": "1.5000000000\n", "input_to_evaluate": "map$q[$_]+=$q[$N]/@$N,@{/ /,push@\n$`,$' for<>;++$N}for++$q[1]..<>;while(--$N){$b=1;$e[$N]=$b+=$_/@@for@@=@e[@$N];$a<($~=$q[$N]*($b-1-$_)/($#@||1))or$a=$~for@@}print$a+$b", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a cave consisting of N rooms and M one-directional passages. The rooms are numbered 1 through N.\n\nTakahashi is now in Room 1, and Room N has the exit. The i-th passage connects Room s_i and Room t_i (s_i < t_i) and can only be traversed in the direction from Room s_i to Room t_i. It is known that, for each room except Room N, there is at least one passage going from that room.\n\nTakahashi will escape from the cave. Each time he reaches a room (assume that he has reached Room 1 at the beginning), he will choose a passage uniformly at random from the ones going from that room and take that passage.\n\nAoki, a friend of Takahashi's, can block one of the passages (or do nothing) before Takahashi leaves Room 1. However, it is not allowed to block a passage so that Takahashi is potentially unable to reach Room N.\n\nLet E be the expected number of passages Takahashi takes before he reaches Room N. Find the value of E when Aoki makes a choice that minimizes E.\n\nConstraints\n\n2 \\leq N \\leq 600\n\nN-1 \\leq M \\leq \\frac{N(N-1)}{2}\n\ns_i < t_i\n\nIf i != j, (s_i, t_i) \\neq (s_j, t_j). (Added 21:23 JST)\n\nFor every v = 1, 2, ..., N-1, there exists i such that v = s_i.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 t_1\n:\ns_M t_M\n\nOutput\n\nPrint the value of E when Aoki makes a choice that minimizes E.\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\n4 6\n1 4\n2 3\n1 3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n1.5000000000\n\nIf Aoki blocks the passage from Room 1 to Room 2, Takahashi will go along the path 1 → 3 → 4 with probability \\frac{1}{2} and 1 → 4 with probability \\frac{1}{2}. E = 1.5 here, and this is the minimum possible value of E.\n\nSample Input 2\n\n3 2\n1 2\n2 3\n\nSample Output 2\n\n2.0000000000\n\nBlocking any one passage makes Takahashi unable to reach Room N, so Aoki cannot block a passage.\n\nSample Input 3\n\n10 33\n3 7\n5 10\n8 9\n1 10\n4 6\n2 5\n1 7\n6 10\n1 4\n1 3\n8 10\n1 5\n2 6\n6 9\n5 6\n5 8\n3 6\n4 8\n2 7\n2 9\n6 7\n1 2\n5 9\n6 8\n9 10\n3 9\n7 8\n4 5\n2 10\n5 7\n3 5\n4 7\n4 9\n\nSample Output 3\n\n3.0133333333", "sample_input": "4 6\n1 4\n2 3\n1 3\n1 2\n3 4\n2 4\n"}, "reference_outputs": ["1.5000000000\n"], "source_document_id": "p02884", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a cave consisting of N rooms and M one-directional passages. The rooms are numbered 1 through N.\n\nTakahashi is now in Room 1, and Room N has the exit. The i-th passage connects Room s_i and Room t_i (s_i < t_i) and can only be traversed in the direction from Room s_i to Room t_i. It is known that, for each room except Room N, there is at least one passage going from that room.\n\nTakahashi will escape from the cave. Each time he reaches a room (assume that he has reached Room 1 at the beginning), he will choose a passage uniformly at random from the ones going from that room and take that passage.\n\nAoki, a friend of Takahashi's, can block one of the passages (or do nothing) before Takahashi leaves Room 1. However, it is not allowed to block a passage so that Takahashi is potentially unable to reach Room N.\n\nLet E be the expected number of passages Takahashi takes before he reaches Room N. Find the value of E when Aoki makes a choice that minimizes E.\n\nConstraints\n\n2 \\leq N \\leq 600\n\nN-1 \\leq M \\leq \\frac{N(N-1)}{2}\n\ns_i < t_i\n\nIf i != j, (s_i, t_i) \\neq (s_j, t_j). (Added 21:23 JST)\n\nFor every v = 1, 2, ..., N-1, there exists i such that v = s_i.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 t_1\n:\ns_M t_M\n\nOutput\n\nPrint the value of E when Aoki makes a choice that minimizes E.\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\n4 6\n1 4\n2 3\n1 3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n1.5000000000\n\nIf Aoki blocks the passage from Room 1 to Room 2, Takahashi will go along the path 1 → 3 → 4 with probability \\frac{1}{2} and 1 → 4 with probability \\frac{1}{2}. E = 1.5 here, and this is the minimum possible value of E.\n\nSample Input 2\n\n3 2\n1 2\n2 3\n\nSample Output 2\n\n2.0000000000\n\nBlocking any one passage makes Takahashi unable to reach Room N, so Aoki cannot block a passage.\n\nSample Input 3\n\n10 33\n3 7\n5 10\n8 9\n1 10\n4 6\n2 5\n1 7\n6 10\n1 4\n1 3\n8 10\n1 5\n2 6\n6 9\n5 6\n5 8\n3 6\n4 8\n2 7\n2 9\n6 7\n1 2\n5 9\n6 8\n9 10\n3 9\n7 8\n4 5\n2 10\n5 7\n3 5\n4 7\n4 9\n\nSample Output 3\n\n3.0133333333", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 982, "memory_kb": 108308}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s263695564", "group_id": "codeNet:p02884", "input_text": "map$q[$_]+=$q[$N]/@$N,@{/ /,push@\n$`,$' for<>;$N=$_}for++$q[1]..<>;${$e[$N]=$b+=$_/@@for@@=sort@e[@$N];a}<($~=$q[$N]*($b-1-$@[-1])/($#@||1))or$a=$~while$N-=$b=1;print$a+$b", "language": "Perl", "metadata": {"date": 1572254442, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02884.html", "problem_id": "p02884", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02884/input.txt", "sample_output_relpath": "derived/input_output/data/p02884/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02884/Perl/s263695564.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s263695564", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1.5000000000\n", "input_to_evaluate": "map$q[$_]+=$q[$N]/@$N,@{/ /,push@\n$`,$' for<>;$N=$_}for++$q[1]..<>;${$e[$N]=$b+=$_/@@for@@=sort@e[@$N];a}<($~=$q[$N]*($b-1-$@[-1])/($#@||1))or$a=$~while$N-=$b=1;print$a+$b", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a cave consisting of N rooms and M one-directional passages. The rooms are numbered 1 through N.\n\nTakahashi is now in Room 1, and Room N has the exit. The i-th passage connects Room s_i and Room t_i (s_i < t_i) and can only be traversed in the direction from Room s_i to Room t_i. It is known that, for each room except Room N, there is at least one passage going from that room.\n\nTakahashi will escape from the cave. Each time he reaches a room (assume that he has reached Room 1 at the beginning), he will choose a passage uniformly at random from the ones going from that room and take that passage.\n\nAoki, a friend of Takahashi's, can block one of the passages (or do nothing) before Takahashi leaves Room 1. However, it is not allowed to block a passage so that Takahashi is potentially unable to reach Room N.\n\nLet E be the expected number of passages Takahashi takes before he reaches Room N. Find the value of E when Aoki makes a choice that minimizes E.\n\nConstraints\n\n2 \\leq N \\leq 600\n\nN-1 \\leq M \\leq \\frac{N(N-1)}{2}\n\ns_i < t_i\n\nIf i != j, (s_i, t_i) \\neq (s_j, t_j). (Added 21:23 JST)\n\nFor every v = 1, 2, ..., N-1, there exists i such that v = s_i.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 t_1\n:\ns_M t_M\n\nOutput\n\nPrint the value of E when Aoki makes a choice that minimizes E.\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\n4 6\n1 4\n2 3\n1 3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n1.5000000000\n\nIf Aoki blocks the passage from Room 1 to Room 2, Takahashi will go along the path 1 → 3 → 4 with probability \\frac{1}{2} and 1 → 4 with probability \\frac{1}{2}. E = 1.5 here, and this is the minimum possible value of E.\n\nSample Input 2\n\n3 2\n1 2\n2 3\n\nSample Output 2\n\n2.0000000000\n\nBlocking any one passage makes Takahashi unable to reach Room N, so Aoki cannot block a passage.\n\nSample Input 3\n\n10 33\n3 7\n5 10\n8 9\n1 10\n4 6\n2 5\n1 7\n6 10\n1 4\n1 3\n8 10\n1 5\n2 6\n6 9\n5 6\n5 8\n3 6\n4 8\n2 7\n2 9\n6 7\n1 2\n5 9\n6 8\n9 10\n3 9\n7 8\n4 5\n2 10\n5 7\n3 5\n4 7\n4 9\n\nSample Output 3\n\n3.0133333333", "sample_input": "4 6\n1 4\n2 3\n1 3\n1 2\n3 4\n2 4\n"}, "reference_outputs": ["1.5000000000\n"], "source_document_id": "p02884", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a cave consisting of N rooms and M one-directional passages. The rooms are numbered 1 through N.\n\nTakahashi is now in Room 1, and Room N has the exit. The i-th passage connects Room s_i and Room t_i (s_i < t_i) and can only be traversed in the direction from Room s_i to Room t_i. It is known that, for each room except Room N, there is at least one passage going from that room.\n\nTakahashi will escape from the cave. Each time he reaches a room (assume that he has reached Room 1 at the beginning), he will choose a passage uniformly at random from the ones going from that room and take that passage.\n\nAoki, a friend of Takahashi's, can block one of the passages (or do nothing) before Takahashi leaves Room 1. However, it is not allowed to block a passage so that Takahashi is potentially unable to reach Room N.\n\nLet E be the expected number of passages Takahashi takes before he reaches Room N. Find the value of E when Aoki makes a choice that minimizes E.\n\nConstraints\n\n2 \\leq N \\leq 600\n\nN-1 \\leq M \\leq \\frac{N(N-1)}{2}\n\ns_i < t_i\n\nIf i != j, (s_i, t_i) \\neq (s_j, t_j). (Added 21:23 JST)\n\nFor every v = 1, 2, ..., N-1, there exists i such that v = s_i.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 t_1\n:\ns_M t_M\n\nOutput\n\nPrint the value of E when Aoki makes a choice that minimizes E.\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\n4 6\n1 4\n2 3\n1 3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n1.5000000000\n\nIf Aoki blocks the passage from Room 1 to Room 2, Takahashi will go along the path 1 → 3 → 4 with probability \\frac{1}{2} and 1 → 4 with probability \\frac{1}{2}. E = 1.5 here, and this is the minimum possible value of E.\n\nSample Input 2\n\n3 2\n1 2\n2 3\n\nSample Output 2\n\n2.0000000000\n\nBlocking any one passage makes Takahashi unable to reach Room N, so Aoki cannot block a passage.\n\nSample Input 3\n\n10 33\n3 7\n5 10\n8 9\n1 10\n4 6\n2 5\n1 7\n6 10\n1 4\n1 3\n8 10\n1 5\n2 6\n6 9\n5 6\n5 8\n3 6\n4 8\n2 7\n2 9\n6 7\n1 2\n5 9\n6 8\n9 10\n3 9\n7 8\n4 5\n2 10\n5 7\n3 5\n4 7\n4 9\n\nSample Output 3\n\n3.0133333333", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 171, "cpu_time_ms": 426, "memory_kb": 42368}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s832841413", "group_id": "codeNet:p02885", "input_text": "<>=~$\";print$-=$`-$'*2", "language": "Perl", "metadata": {"date": 1579582112, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02885.html", "problem_id": "p02885", "resource_group": "low_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/Perl/s832841413.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s832841413", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "<>=~$\";print$-=$`-$'*2", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 22, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s242563216", "group_id": "codeNet:p02886", "input_text": "get;say sum map {[*] @$_},get.words.combinations: 2", "language": "Perl", "metadata": {"date": 1571534141, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02886.html", "problem_id": "p02886", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02886/input.txt", "sample_output_relpath": "derived/input_output/data/p02886/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02886/Perl/s242563216.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s242563216", "user_id": "u657913472"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "get;say sum map {[*] @$_},get.words.combinations: 2", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt's now the season of TAKOYAKI FESTIVAL!\n\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\n\nAs is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \\times y health points.\n\nThere are \\frac{N \\times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \\frac{N \\times (N - 1)}{2} values.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\n0 \\leq d_i \\leq 100\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 sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.\n\nSample Input 1\n\n3\n3 1 2\n\nSample Output 1\n\n11\n\nThere are three possible choices:\n\nEat the first and second takoyaki. You will restore 3 health points.\n\nEat the second and third takoyaki. You will restore 2 health points.\n\nEat the first and third takoyaki. You will restore 6 health points.\n\nThe sum of these values is 11.\n\nSample Input 2\n\n7\n5 0 7 8 3 3 2\n\nSample Output 2\n\n312", "sample_input": "3\n3 1 2\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02886", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt's now the season of TAKOYAKI FESTIVAL!\n\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\n\nAs is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \\times y health points.\n\nThere are \\frac{N \\times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \\frac{N \\times (N - 1)}{2} values.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\n0 \\leq d_i \\leq 100\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 sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.\n\nSample Input 1\n\n3\n3 1 2\n\nSample Output 1\n\n11\n\nThere are three possible choices:\n\nEat the first and second takoyaki. You will restore 3 health points.\n\nEat the second and third takoyaki. You will restore 2 health points.\n\nEat the first and third takoyaki. You will restore 6 health points.\n\nThe sum of these values is 11.\n\nSample Input 2\n\n7\n5 0 7 8 3 3 2\n\nSample Output 2\n\n312", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 995, "memory_kb": 79644}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s320378756", "group_id": "codeNet:p02887", "input_text": "<>;print<>=~y///csr=~y///c", "language": "Perl", "metadata": {"date": 1583991438, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02887.html", "problem_id": "p02887", "resource_group": "low_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/Perl/s320378756.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s320378756", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "<>;print<>=~y///csr=~y///c", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 26, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s945142095", "group_id": "codeNet:p02887", "input_text": "#!/usr/bin/perl\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy $s = ;\n\nmy $cnt = 0;\nmy $prev = '';\nfor(my $i=0;$i<$n;$i++){\n my $c = substr($s,$i,1);\n $cnt += 1 if $c ne $prev;\n $prev = $c;\n}\nprint \"$cnt\\n\";\n\n", "language": "Perl", "metadata": {"date": 1571533635, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02887.html", "problem_id": "p02887", "resource_group": "low_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/Perl/s945142095.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s945142095", "user_id": "u750383873"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy $s = ;\n\nmy $cnt = 0;\nmy $prev = '';\nfor(my $i=0;$i<$n;$i++){\n my $c = substr($s,$i,1);\n $cnt += 1 if $c ne $prev;\n $prev = $c;\n}\nprint \"$cnt\\n\";\n\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 34, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s906070462", "group_id": "codeNet:p02888", "input_text": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @l = map { $_ - 0 } split(/\\s+/,);\n\nmy @d = ();\n$#d = 2000;\n\nfor(my $i=0;$i<$n-1;$i++){\n for(my $j=$i+1;$j<$n;$j++){\n my $v = $l[$i] + $l[$j];\n $d[$v] ++;\n }\n}\n\nmy @dsum = ();\n$#d = 2000;\nmy $sm = 0;\nfor(my $i=$#d;$i>=0;$i--){\n $sm += $d[$i];\n $dsum[$i] = $sm;\n}\n\nmy $r = 0;\nmy @sl = sort { $b <=> $a } @l;\nmy $a = 0;\nfor(my $i=0;$i<$n;$i++){\n my $h1 = $sl[$i];\n $a += ($n - 1 - $i) if ($n - 1 - $i)>=0;\n $r += ( $dsum[$h1+1] - $a );\n}\nprint \"$r\\n\";\n\nexit(0);\n\n", "language": "Perl", "metadata": {"date": 1571534765, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02888.html", "problem_id": "p02888", "resource_group": "low_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/Perl/s906070462.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s906070462", "user_id": "u750383873"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @l = map { $_ - 0 } split(/\\s+/,);\n\nmy @d = ();\n$#d = 2000;\n\nfor(my $i=0;$i<$n-1;$i++){\n for(my $j=$i+1;$j<$n;$j++){\n my $v = $l[$i] + $l[$j];\n $d[$v] ++;\n }\n}\n\nmy @dsum = ();\n$#d = 2000;\nmy $sm = 0;\nfor(my $i=$#d;$i>=0;$i--){\n $sm += $d[$i];\n $dsum[$i] = $sm;\n}\n\nmy $r = 0;\nmy @sl = sort { $b <=> $a } @l;\nmy $a = 0;\nfor(my $i=0;$i<$n;$i++){\n my $h1 = $sl[$i];\n $a += ($n - 1 - $i) if ($n - 1 - $i)>=0;\n $r += ( $dsum[$h1+1] - $a );\n}\nprint \"$r\\n\";\n\nexit(0);\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 514, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s421010666", "group_id": "codeNet:p02890", "input_text": "print sort{1}map{map$s[$_++]+=!$i,@c[glob<>];$a-=$s[$i++]until$a>$_*$i;$/,$i-1}-<>..-1", "language": "Perl", "metadata": {"date": 1571544004, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02890.html", "problem_id": "p02890", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02890/input.txt", "sample_output_relpath": "derived/input_output/data/p02890/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02890/Perl/s421010666.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s421010666", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n1\n0\n", "input_to_evaluate": "print sort{1}map{map$s[$_++]+=!$i,@c[glob<>];$a-=$s[$i++]until$a>$_*$i;$/,$i-1}-<>..-1", "problem_context": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N cards. The i-th of these cards has an integer A_i written on it.\n\nTakahashi will choose an integer K, and then repeat the following operation some number of times:\n\nChoose exactly K cards such that the integers written on them are all different, and eat those cards. (The eaten cards disappear.)\n\nFor each K = 1,2, \\ldots, N, find the maximum number of times Takahashi can do the operation.\n\nConstraints\n\n1 \\le N \\le 3 \\times 10^5\n\n1 \\le A_i \\le 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 \\ldots A_N\n\nOutput\n\nPrint N integers.\nThe t-th (1 \\le t \\le N) of them should be the answer for the case K=t.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n3\n1\n0\n\nFor K = 1, we can do the operation as follows:\n\nChoose the first card to eat.\n\nChoose the second card to eat.\n\nChoose the third card to eat.\n\nFor K = 2, we can do the operation as follows:\n\nChoose the first and second cards to eat.\n\nFor K = 3, we cannot do the operation at all. Note that we cannot choose the first and third cards at the same time.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n5\n2\n1\n1\n1\n\nSample Input 3\n\n4\n1 3 3 3\n\nSample Output 3\n\n4\n1\n0\n0", "sample_input": "3\n2 1 2\n"}, "reference_outputs": ["3\n1\n0\n"], "source_document_id": "p02890", "source_text": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N cards. The i-th of these cards has an integer A_i written on it.\n\nTakahashi will choose an integer K, and then repeat the following operation some number of times:\n\nChoose exactly K cards such that the integers written on them are all different, and eat those cards. (The eaten cards disappear.)\n\nFor each K = 1,2, \\ldots, N, find the maximum number of times Takahashi can do the operation.\n\nConstraints\n\n1 \\le N \\le 3 \\times 10^5\n\n1 \\le A_i \\le 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 \\ldots A_N\n\nOutput\n\nPrint N integers.\nThe t-th (1 \\le t \\le N) of them should be the answer for the case K=t.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n3\n1\n0\n\nFor K = 1, we can do the operation as follows:\n\nChoose the first card to eat.\n\nChoose the second card to eat.\n\nChoose the third card to eat.\n\nFor K = 2, we can do the operation as follows:\n\nChoose the first and second cards to eat.\n\nFor K = 3, we cannot do the operation at all. Note that we cannot choose the first and third cards at the same time.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n5\n2\n1\n1\n1\n\nSample Input 3\n\n4\n1 3 3 3\n\nSample Output 3\n\n4\n1\n0\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2111, "memory_kb": 86180}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s127337270", "group_id": "codeNet:p02897", "input_text": "print+($_+1>>1)/$_ for<>", "language": "Perl", "metadata": {"date": 1570919493, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "low_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/Perl/s127337270.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s127337270", "user_id": "u832039789"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "print+($_+1>>1)/$_ for<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 24, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s209568450", "group_id": "codeNet:p02898", "input_text": "<>!~($/=$\");$\\+=$_>=$' for<>;print", "language": "Perl", "metadata": {"date": 1570583330, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02898.html", "problem_id": "p02898", "resource_group": "low_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/Perl/s209568450.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s209568450", "user_id": "u832039789"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>!~($/=$\");$\\+=$_>=$' for<>;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 34, "cpu_time_ms": 78, "memory_kb": 17664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s677683445", "group_id": "codeNet:p02899", "input_text": "chomp($n=<>);\nchomp($in=<>);\n@a=split/ /,$in;\n%hash=();\nfor($i=1;$i<=$n;$i++){\n\t$hash{$a[$i-1]} = $i;\n}\nfor (sort {$a <=> $b} keys %hash ) {\n push @ary ,$hash{$_};\n}\n\nprint join (' ', @ary);\n", "language": "Perl", "metadata": {"date": 1569720690, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02899.html", "problem_id": "p02899", "resource_group": "low_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/Perl/s677683445.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s677683445", "user_id": "u124498235"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "chomp($n=<>);\nchomp($in=<>);\n@a=split/ /,$in;\n%hash=();\nfor($i=1;$i<=$n;$i++){\n\t$hash{$a[$i-1]} = $i;\n}\nfor (sort {$a <=> $b} keys %hash ) {\n push @ary ,$hash{$_};\n}\n\nprint join (' ', @ary);\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 194, "cpu_time_ms": 188, "memory_kb": 38932}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s844144809", "group_id": "codeNet:p02900", "input_text": "use List::Util 'min';\n($x,$y)=split(/ /,<>);\nfor $i (1 .. min($x,$y)){\n push(@c,$i) if(($x % $i == 0) and ($y % $i ==0));\n}\n@r = ();\nfor (@c){\n if($_ == 1){\n push(@r,$_);\n next;\n }\n $f = 0;\n if($_ != 2){\n if ($_ % 2 == 0){\n $f = 1;\n }else{\n for ($i=3;$i<=$_/$i;$i+=2){\n if($_ % $i == 0){\n $f = 1;\n last;\n }\n }\n }\n }\n push(@r,$_) if($f == 0);\n}\n\nprint scalar(@r) . \"\\n\";\n", "language": "Perl", "metadata": {"date": 1569735758, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "low_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/Perl/s844144809.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s844144809", "user_id": "u609426052"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use List::Util 'min';\n($x,$y)=split(/ /,<>);\nfor $i (1 .. min($x,$y)){\n push(@c,$i) if(($x % $i == 0) and ($y % $i ==0));\n}\n@r = ();\nfor (@c){\n if($_ == 1){\n push(@r,$_);\n next;\n }\n $f = 0;\n if($_ != 2){\n if ($_ % 2 == 0){\n $f = 1;\n }else{\n for ($i=3;$i<=$_/$i;$i+=2){\n if($_ % $i == 0){\n $f = 1;\n last;\n }\n }\n }\n }\n push(@r,$_) if($f == 0);\n}\n\nprint scalar(@r) . \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2103, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s905823151", "group_id": "codeNet:p02900", "input_text": "#!/usr/bin/perl\nuse strict;\nuse warnings;\nuse feature qw(:5.10);\nuse utf8;\nuse Math::BigInt;\n\nsub prime {\n my $n = shift;\n my $limit = sqrt($n);\n for (my $i=2;$i<=$limit;$i++){\n return if ($n%$i == 0);\n }\n return 1;\n}\n\nmy @k;\n{\n my $line = ;\n chomp $line;\n my @line = split(/\\s+/, $line);\n @k = kouyaku($line[0], $line[1]);\n}\n\nmy $count = 0;\nfor (@k){\n $count++ if prime($_);\n}\nsay $count;\n\nsub kouyaku {\n my $n1 = shift;\n my $n2 = shift;\n my @kouyaku;\n my $gcd = Math::BigInt::bgcd($n1, $n2);\n for(1..$gcd){\n push(@kouyaku, $_) if $gcd%$_ == 0;\n }\n return @kouyaku;\n}\n", "language": "Perl", "metadata": {"date": 1569724129, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "low_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/Perl/s905823151.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s905823151", "user_id": "u264332171"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\nuse strict;\nuse warnings;\nuse feature qw(:5.10);\nuse utf8;\nuse Math::BigInt;\n\nsub prime {\n my $n = shift;\n my $limit = sqrt($n);\n for (my $i=2;$i<=$limit;$i++){\n return if ($n%$i == 0);\n }\n return 1;\n}\n\nmy @k;\n{\n my $line = ;\n chomp $line;\n my @line = split(/\\s+/, $line);\n @k = kouyaku($line[0], $line[1]);\n}\n\nmy $count = 0;\nfor (@k){\n $count++ if prime($_);\n}\nsay $count;\n\nsub kouyaku {\n my $n1 = shift;\n my $n2 = shift;\n my @kouyaku;\n my $gcd = Math::BigInt::bgcd($n1, $n2);\n for(1..$gcd){\n push(@kouyaku, $_) if $gcd%$_ == 0;\n }\n return @kouyaku;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 641, "cpu_time_ms": 2104, "memory_kb": 6656}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s084627466", "group_id": "codeNet:p02901", "input_text": "$T=2**<>-1;$%{0}=0;$C=map(1..1<<$_-1,glob<>),map+($%{$_|$C}//=9e9)-=$-=$%{$_|$C}-$A-$%{$_},keys%%while$A=<>;print$%{$T}//-1", "language": "Perl", "metadata": {"date": 1569728693, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02901.html", "problem_id": "p02901", "resource_group": "low_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/Perl/s084627466.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s084627466", "user_id": "u657913472"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "$T=2**<>-1;$%{0}=0;$C=map(1..1<<$_-1,glob<>),map+($%{$_|$C}//=9e9)-=$-=$%{$_|$C}-$A-$%{$_},keys%%while$A=<>;print$%{$T}//-1", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1643, "memory_kb": 1792}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s953982823", "group_id": "codeNet:p02909", "input_text": "$_=<>;chop;print+(Sunny,Rainy,Cloudy)[Rainy cmp$_]", "language": "Perl", "metadata": {"date": 1568745529, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "low_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/Perl/s953982823.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s953982823", "user_id": "u573154728"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "$_=<>;chop;print+(Sunny,Rainy,Cloudy)[Rainy cmp$_]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 50, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s877028481", "group_id": "codeNet:p02910", "input_text": "chomp($_ = <>);\ns/([RUD][LUD])*[RUD]?//;\n$_?print \"No\": print\"Yes\";\n", "language": "Perl", "metadata": {"date": 1588904668, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02910.html", "problem_id": "p02910", "resource_group": "low_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/Perl/s877028481.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s877028481", "user_id": "u020604402"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "chomp($_ = <>);\ns/([RUD][LUD])*[RUD]?//;\n$_?print \"No\": print\"Yes\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 68, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s320460492", "group_id": "codeNet:p02910", "input_text": "$_=<>^pn x$<;print/^pn x$<;print/=~/^(..)*L|^(..)*.R/?No:Yes", "language": "Perl", "metadata": {"date": 1568596072, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02910.html", "problem_id": "p02910", "resource_group": "low_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/Perl/s605533062.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s605533062", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print<>=~/^(..)*L|^(..)*.R/?No:Yes", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 34, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s837049891", "group_id": "codeNet:p02910", "input_text": "print grep(--$|?/L/:/R/,<>=~/./g)?No:Yes", "language": "Perl", "metadata": {"date": 1568595995, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02910.html", "problem_id": "p02910", "resource_group": "low_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/Perl/s837049891.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s837049891", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print grep(--$|?/L/:/R/,<>=~/./g)?No:Yes", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 40, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s531349149", "group_id": "codeNet:p02911", "input_text": "use strict;\nuse warnings;\n\nsub main {\n chomp(my $nkq = );\n my ($N,$K,$Q) = split(/ /,$nkq);\n my @A;\n while(){\n chomp;\n push(@A,$_)\n }\n print solver($N,$K,$Q,\\@A);\n}\nmain() unless caller;\n\nsub solver {\n my ($N,$K,$Q,$A) = @_;\n my @ans;\n my $n = $K - $Q;\n my %tmp;\n my %mem;\n if($n>0){\n @ans = map{$_='Yes'}(0..$N-1);\n return join(\"\\n\", @ans) . \"\\n\";\n } else {\n for my $i(@$A) {\n $i--;\n unless (defined $mem{$i}) {\n $tmp{$i} = $n;\n $mem{$i} = 1;\n }\n $tmp{$i}++;\n }\n }\n for my $j(0..$N-1) {\n if(defined $tmp{$j} && $tmp{$j} > 0){\n $ans[$j] = 'Yes';\n } else {\n $ans[$j] = 'No';\n }\n }\n return join(\"\\n\", @ans) . \"\\n\";\n}", "language": "Perl", "metadata": {"date": 1568598489, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02911.html", "problem_id": "p02911", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02911/input.txt", "sample_output_relpath": "derived/input_output/data/p02911/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02911/Perl/s531349149.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s531349149", "user_id": "u555298461"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nsub main {\n chomp(my $nkq = );\n my ($N,$K,$Q) = split(/ /,$nkq);\n my @A;\n while(){\n chomp;\n push(@A,$_)\n }\n print solver($N,$K,$Q,\\@A);\n}\nmain() unless caller;\n\nsub solver {\n my ($N,$K,$Q,$A) = @_;\n my @ans;\n my $n = $K - $Q;\n my %tmp;\n my %mem;\n if($n>0){\n @ans = map{$_='Yes'}(0..$N-1);\n return join(\"\\n\", @ans) . \"\\n\";\n } else {\n for my $i(@$A) {\n $i--;\n unless (defined $mem{$i}) {\n $tmp{$i} = $n;\n $mem{$i} = 1;\n }\n $tmp{$i}++;\n }\n }\n for my $j(0..$N-1) {\n if(defined $tmp{$j} && $tmp{$j} > 0){\n $ans[$j] = 'Yes';\n } else {\n $ans[$j] = 'No';\n }\n }\n return join(\"\\n\", @ans) . \"\\n\";\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "sample_input": "6 3 4\n3\n1\n3\n2\n"}, "reference_outputs": ["No\nNo\nYes\nNo\nNo\nNo\n"], "source_document_id": "p02911", "source_text": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 838, "cpu_time_ms": 190, "memory_kb": 33664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s981923092", "group_id": "codeNet:p02915", "input_text": "use strict;\nuse warnings;\n\nsub main {\n chomp(my $N = );\n print solver($N);\n}\nmain() unless caller;\n\nsub solver {\n my ($N) = @_;\n return $N**3;\n}", "language": "Perl", "metadata": {"date": 1567904639, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/Perl/s981923092.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s981923092", "user_id": "u555298461"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nsub main {\n chomp(my $N = );\n print solver($N);\n}\nmain() unless caller;\n\nsub solver {\n my ($N) = @_;\n return $N**3;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\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 number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\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 number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s307520468", "group_id": "codeNet:p02915", "input_text": "print<>**3;", "language": "Perl", "metadata": {"date": 1567904594, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/Perl/s307520468.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s307520468", "user_id": "u676837005"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "print<>**3;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\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 number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\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 number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 11, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s593101412", "group_id": "codeNet:p02917", "input_text": "use strict;\nuse warnings;\n\nsub main {\n chomp(my $N = );\n chomp(my $B = );\n my @B = split(/ /,$B);\n print solver($N,\\@B);\n}\nmain() unless caller;\n\nsub solver {\n my ($N,$B) = @_;\n my $ans = $B->[0] + $B->[-1];\n for my $i(0..$N-2){\n if($B->[$i] <= $B->[$i+1]){\n $ans += $B->[$i];\n }else{\n $ans += $B->[$i+1];\n }\n }\n return $ans;\n}", "language": "Perl", "metadata": {"date": 1567908145, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02917.html", "problem_id": "p02917", "resource_group": "low_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/Perl/s593101412.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s593101412", "user_id": "u555298461"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nsub main {\n chomp(my $N = );\n chomp(my $B = );\n my @B = split(/ /,$B);\n print solver($N,\\@B);\n}\nmain() unless caller;\n\nsub solver {\n my ($N,$B) = @_;\n my $ans = $B->[0] + $B->[-1];\n for my $i(0..$N-2){\n if($B->[$i] <= $B->[$i+1]){\n $ans += $B->[$i];\n }else{\n $ans += $B->[$i+1];\n }\n }\n return $ans;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 411, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s607132657", "group_id": "codeNet:p02918", "input_text": "print$`-<>=~$\"-($--=$'<<<>!~/(LR|RL)(??{++$-})/)", "language": "Perl", "metadata": {"date": 1567911666, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02918.html", "problem_id": "p02918", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02918/input.txt", "sample_output_relpath": "derived/input_output/data/p02918/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02918/Perl/s607132657.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s607132657", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "print$`-<>=~$\"-($--=$'<<<>!~/(LR|RL)(??{++$-})/)", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N people standing in a queue from west to east.\n\nGiven is a string S of length N representing the directions of the people.\nThe i-th person from the west is facing west if the i-th character of S is L, and east if that character of S is R.\n\nA person is happy if the person in front of him/her is facing the same direction.\nIf no person is standing in front of a person, however, he/she is not happy.\n\nYou can perform the following operation any number of times between 0 and K (inclusive):\n\nOperation: Choose integers l and r such that 1 \\leq l \\leq r \\leq N, and rotate by 180 degrees the part of the queue: the l-th, (l+1)-th, ..., r-th persons. That is, for each i = 0, 1, ..., r-l, the (l + i)-th person from the west will stand the (r - i)-th from the west after the operation, facing east if he/she is facing west now, and vice versa.\n\nWhat is the maximum possible number of happy people you can have?\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\n|S| = N\n\nEach character of S is L or R.\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 happy people after at most K operations.\n\nSample Input 1\n\n6 1\nLRLRRL\n\nSample Output 1\n\n3\n\nIf we choose (l, r) = (2, 5), we have LLLRLL, where the 2-nd, 3-rd, and 6-th persons from the west are happy.\n\nSample Input 2\n\n13 3\nLRRLRLRRLRLLR\n\nSample Output 2\n\n9\n\nSample Input 3\n\n10 1\nLLLLLRRRRR\n\nSample Output 3\n\n9\n\nSample Input 4\n\n9 2\nRRRLRLRLL\n\nSample Output 4\n\n7", "sample_input": "6 1\nLRLRRL\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02918", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N people standing in a queue from west to east.\n\nGiven is a string S of length N representing the directions of the people.\nThe i-th person from the west is facing west if the i-th character of S is L, and east if that character of S is R.\n\nA person is happy if the person in front of him/her is facing the same direction.\nIf no person is standing in front of a person, however, he/she is not happy.\n\nYou can perform the following operation any number of times between 0 and K (inclusive):\n\nOperation: Choose integers l and r such that 1 \\leq l \\leq r \\leq N, and rotate by 180 degrees the part of the queue: the l-th, (l+1)-th, ..., r-th persons. That is, for each i = 0, 1, ..., r-l, the (l + i)-th person from the west will stand the (r - i)-th from the west after the operation, facing east if he/she is facing west now, and vice versa.\n\nWhat is the maximum possible number of happy people you can have?\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\n|S| = N\n\nEach character of S is L or R.\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 happy people after at most K operations.\n\nSample Input 1\n\n6 1\nLRLRRL\n\nSample Output 1\n\n3\n\nIf we choose (l, r) = (2, 5), we have LLLRLL, where the 2-nd, 3-rd, and 6-th persons from the west are happy.\n\nSample Input 2\n\n13 3\nLRRLRLRRLRLLR\n\nSample Output 2\n\n9\n\nSample Input 3\n\n10 1\nLLLLLRRRRR\n\nSample Output 3\n\n9\n\nSample Input 4\n\n9 2\nRRRLRLRLL\n\nSample Output 4\n\n7", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 48, "cpu_time_ms": 283, "memory_kb": 11648}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s259302862", "group_id": "codeNet:p02919", "input_text": "@1=map$-=$_-2,@0=1..<>+2;--$0[-1];map$\\+=$'*($$_[$N=$$_[$`]]-($$_[$P=${1-$_}[$`]]=$N))*($`-$P),/\\t/,0for`tr ' ' '\n'|nl|sort -nk2`;print", "language": "Perl", "metadata": {"date": 1567896792, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02919.html", "problem_id": "p02919", "resource_group": "low_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/Perl/s259302862.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s259302862", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "@1=map$-=$_-2,@0=1..<>+2;--$0[-1];map$\\+=$'*($$_[$N=$$_[$`]]-($$_[$P=${1-$_}[$`]]=$N))*($`-$P),/\\t/,0for`tr ' ' '\n'|nl|sort -nk2`;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 600, "memory_kb": 42236}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s934614209", "group_id": "codeNet:p02919", "input_text": "@P=map$-=$_-2,@N=1..<>+2;--$N[-1];$\\+=$_*=(($N[$N[$i=$_[$_]]]-$N[$i])*($i-$P[$i])+($P[$i]-$P[$P[$i]])*(($N[$P[$N[$i]]=$P[$i]]=$N[$i])-$i))for map$_[$_]=++$i,glob<>;print", "language": "Perl", "metadata": {"date": 1567895142, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02919.html", "problem_id": "p02919", "resource_group": "low_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/Perl/s934614209.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s934614209", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "@P=map$-=$_-2,@N=1..<>+2;--$N[-1];$\\+=$_*=(($N[$N[$i=$_[$_]]]-$N[$i])*($i-$P[$i])+($P[$i]-$P[$P[$i]])*(($N[$P[$N[$i]]=$P[$i]]=$N[$i])-$i))for map$_[$_]=++$i,glob<>;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 462, "memory_kb": 43172}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s071131377", "group_id": "codeNet:p02921", "input_text": "while(<>){\n\tchomp;\n\t@s = split(//, $_) if($. == 1);\n\t@t = split(//, $_) if($. == 2);\n}\n\n$r = 0;\nfor $i (0 .. 2){\n\t$r++ if($s[$i] eq $t[$i]);\n}\n\nprint \"$r\\n\";\n", "language": "Perl", "metadata": {"date": 1567366076, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02921.html", "problem_id": "p02921", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02921/input.txt", "sample_output_relpath": "derived/input_output/data/p02921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02921/Perl/s071131377.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s071131377", "user_id": "u609426052"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "while(<>){\n\tchomp;\n\t@s = split(//, $_) if($. == 1);\n\t@t = split(//, $_) if($. == 2);\n}\n\n$r = 0;\nfor $i (0 .. 2){\n\t$r++ if($s[$i] eq $t[$i]);\n}\n\nprint \"$r\\n\";\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "sample_input": "CSS\nCSR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02921", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 158, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s906797013", "group_id": "codeNet:p02922", "input_text": "my ($tap, $mitap) = glob<>;\nmy $count = 0;\n\nfor(my $i =1; $i <= 20; $i++){\n\tif($mitap <= (($tap-1) * $i + 1)){\n \t$count = $i;\n \tlast;\n }\n}\nif($mitap == 1){\n\tprint 0;\n} else {\n\tprint $count;\n}", "language": "Perl", "metadata": {"date": 1567451351, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "low_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/Perl/s906797013.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s906797013", "user_id": "u124498235"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my ($tap, $mitap) = glob<>;\nmy $count = 0;\n\nfor(my $i =1; $i <= 20; $i++){\n\tif($mitap <= (($tap-1) * $i + 1)){\n \t$count = $i;\n \tlast;\n }\n}\nif($mitap == 1){\n\tprint 0;\n} else {\n\tprint $count;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s740490732", "group_id": "codeNet:p02922", "input_text": "#!/bin/perl\n\nuse strict;\n\nmy $st = ;\n\nchomp $st;\nmy ($a, $b) = split(/ /, $st);\n\nmy $ports = $a;\nfor ( my $tap=1; $tap<=$b; $tap++ ) {\n#\tprint \"$tap: $ports\\n\";\n\tif ( $b <= $ports ) {\n\t\tprint \"$tap\\n\";\n\t\tlast;\n\t}\n\t$ports = $ports - 1 + $a;\n}\n", "language": "Perl", "metadata": {"date": 1567367991, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "low_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/Perl/s740490732.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s740490732", "user_id": "u780788465"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/bin/perl\n\nuse strict;\n\nmy $st = ;\n\nchomp $st;\nmy ($a, $b) = split(/ /, $st);\n\nmy $ports = $a;\nfor ( my $tap=1; $tap<=$b; $tap++ ) {\n#\tprint \"$tap: $ports\\n\";\n\tif ( $b <= $ports ) {\n\t\tprint \"$tap\\n\";\n\t\tlast;\n\t}\n\t$ports = $ports - 1 + $a;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 249, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s255639637", "group_id": "codeNet:p02922", "input_text": "($t, $h) = split(/ /, <>);\n\n$cnt = 1;\nwhile(1){\n\t$r = ($cnt - 1) * ($t - 1) + $t;\n\tlast if($r >= $h);\n\t$cnt++;\n}\n\nprint \"$cnt\\n\";\n", "language": "Perl", "metadata": {"date": 1567367166, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "low_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/Perl/s255639637.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s255639637", "user_id": "u609426052"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "($t, $h) = split(/ /, <>);\n\n$cnt = 1;\nwhile(1){\n\t$r = ($cnt - 1) * ($t - 1) + $t;\n\tlast if($r >= $h);\n\t$cnt++;\n}\n\nprint \"$cnt\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 130, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s183187983", "group_id": "codeNet:p02923", "input_text": "<>;\\$_[-$p>-($p=$_)?$i=0:++$i]for glob<>;print$#_", "language": "Perl", "metadata": {"date": 1567374685, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "low_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/Perl/s183187983.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s183187983", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>;\\$_[-$p>-($p=$_)?$i=0:++$i]for glob<>;print$#_", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 49, "cpu_time_ms": 255, "memory_kb": 22400}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s971644879", "group_id": "codeNet:p02923", "input_text": "$i=$p=<>;\n$'>$_&&($\\+=$-=$p-$i-$\\-1,$p=$i),$i-=// for glob`rev`.0;\nprint", "language": "Perl", "metadata": {"date": 1567370165, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "low_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/Perl/s971644879.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s971644879", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$i=$p=<>;\n$'>$_&&($\\+=$-=$p-$i-$\\-1,$p=$i),$i-=// for glob`rev`.0;\nprint", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 352, "memory_kb": 22676}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s931953072", "group_id": "codeNet:p02923", "input_text": "while(<>){\n\tchomp;\n\t@h = split(/ /, $_) if($. == 2);\n}\n\n($cnt, $max, $pre) = (0, 0, 0);\nforeach $one (@h){\n\tif($pre >= $one){\n\t\t$cnt++;\n\t\t$max = $cnt if($max < $cnt);\n\t}else{\n\t\t$cnt = 0;\n\t}\n\t$pre = $one;\n}\n\nprint \"$max\\n\";\n", "language": "Perl", "metadata": {"date": 1567368134, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "low_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/Perl/s931953072.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s931953072", "user_id": "u609426052"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "while(<>){\n\tchomp;\n\t@h = split(/ /, $_) if($. == 2);\n}\n\n($cnt, $max, $pre) = (0, 0, 0);\nforeach $one (@h){\n\tif($pre >= $one){\n\t\t$cnt++;\n\t\t$max = $cnt if($max < $cnt);\n\t}else{\n\t\t$cnt = 0;\n\t}\n\t$pre = $one;\n}\n\nprint \"$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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 58, "memory_kb": 17228}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s348700972", "group_id": "codeNet:p02924", "input_text": "my $N = ;\n\n\nmy $count = 0;\nmy $sum = 0; \nfor(my $i=1;$i<$N;$i++){\n $sum = $sum + $i; \n}\n\n\n\nprint \"$sum\";\n", "language": "Perl", "metadata": {"date": 1567544033, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02924.html", "problem_id": "p02924", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02924/input.txt", "sample_output_relpath": "derived/input_output/data/p02924/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02924/Perl/s348700972.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s348700972", "user_id": "u464700044"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "my $N = ;\n\n\nmy $count = 0;\nmy $sum = 0; \nfor(my $i=1;$i<$N;$i++){\n $sum = $sum + $i; \n}\n\n\n\nprint \"$sum\";\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "sample_input": "2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02924", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 115, "cpu_time_ms": 2103, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s048235780", "group_id": "codeNet:p02927", "input_text": "#include \nusing ll = long long;\nusing namespace std;\n#define _overload3(_1, _2, _3, name, ...) name\n#define _rep(i, n) repi(i, 0, n)\n#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)\n#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)\nconst long long INFLL = 1LL << 60;\nconst int INFINT = 1 << 30;\nconst long long MOD = 1e9 + 7;\n\ntemplate void vecout(T V) {\n auto t = V.begin();\n while(t != V.end()) {\n cout << *t++;\n if(t != V.end()) cout << \" \";\n }\n cout << endl;\n};\n\nint main() {\n int M, D, t = 0;\n cin >> M >> D;\n rep(i, 1, M + 1)\n rep(j, 22, D + 1) if((j / 10) * (j % 10) == i && (j % 10) > 1) t++;\n cout << t << endl;\n}\n", "language": "Perl", "metadata": {"date": 1566852609, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02927.html", "problem_id": "p02927", "resource_group": "low_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/Perl/s048235780.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s048235780", "user_id": "u573154728"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "#include \nusing ll = long long;\nusing namespace std;\n#define _overload3(_1, _2, _3, name, ...) name\n#define _rep(i, n) repi(i, 0, n)\n#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)\n#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)\nconst long long INFLL = 1LL << 60;\nconst int INFINT = 1 << 30;\nconst long long MOD = 1e9 + 7;\n\ntemplate void vecout(T V) {\n auto t = V.begin();\n while(t != V.end()) {\n cout << *t++;\n if(t != V.end()) cout << \" \";\n }\n cout << endl;\n};\n\nint main() {\n int M, D, t = 0;\n cin >> M >> D;\n rep(i, 1, M + 1)\n rep(j, 22, D + 1) if((j / 10) * (j % 10) == i && (j % 10) > 1) t++;\n cout << t << endl;\n}\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 721, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s866073783", "group_id": "codeNet:p02928", "input_text": "<>=~$\";map{($\\+=($z=$_<=>$a)&&$'*($'+$z)/2)%=1e9+7}@@=(@@,$a=$_)for glob<>;print", "language": "Perl", "metadata": {"date": 1566801371, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02928.html", "problem_id": "p02928", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02928/input.txt", "sample_output_relpath": "derived/input_output/data/p02928/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02928/Perl/s866073783.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s866073783", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>=~$\";map{($\\+=($z=$_<=>$a)&&$'*($'+$z)/2)%=1e9+7}@@=(@@,$a=$_)for glob<>;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "sample_input": "2 2\n2 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02928", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2103, "memory_kb": 1536}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s076652122", "group_id": "codeNet:p02928", "input_text": "<>=~$\";($\\+=(grep($_>$a,@@=(@@,$a=$_))+~-$'/2*grep$_>$a,@_)*$')%=1e9+7for@_=glob<>;print", "language": "Perl", "metadata": {"date": 1566719768, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02928.html", "problem_id": "p02928", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02928/input.txt", "sample_output_relpath": "derived/input_output/data/p02928/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02928/Perl/s076652122.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s076652122", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>=~$\";($\\+=(grep($_>$a,@@=(@@,$a=$_))+~-$'/2*grep$_>$a,@_)*$')%=1e9+7for@_=glob<>;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "sample_input": "2 2\n2 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02928", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 88, "cpu_time_ms": 568, "memory_kb": 1664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s414733587", "group_id": "codeNet:p02929", "input_text": "$i=<>;($.*=$|---/B/?$i--+!++$%:$%--)%=1e9+7for`dd`=~/./g;print$.", "language": "Perl", "metadata": {"date": 1566799329, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02929.html", "problem_id": "p02929", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02929/input.txt", "sample_output_relpath": "derived/input_output/data/p02929/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02929/Perl/s414733587.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s414733587", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$i=<>;($.*=$|---/B/?$i--+!++$%:$%--)%=1e9+7for`dd`=~/./g;print$.", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are 2N squares arranged from left to right. You are given a string of length 2N representing the color of each of the squares.\n\nThe color of the i-th square from the left is black if the i-th character of S is B, and white if that character is W.\n\nYou will perform the following operation exactly N times: choose two distinct squares, then invert the colors of these squares and the squares between them. Here, to invert the color of a square is to make it white if it is black, and vice versa.\n\nThroughout this process, you cannot choose the same square twice or more. That is, each square has to be chosen exactly once.\n\nFind the number of ways to make all the squares white at the end of the process, modulo 10^9+7.\n\nTwo ways to make the squares white are considered different if and only if there exists i (1 \\leq i \\leq N) such that the pair of the squares chosen in the i-th operation is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = 2N\n\nEach character of S is B or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of ways to make all the squares white at the end of the process, modulo 10^9+7. If there are no such ways, print 0.\n\nSample Input 1\n\n2\nBWWB\n\nSample Output 1\n\n4\n\nThere are four ways to make all the squares white, as follows:\n\nChoose Squares 1, 3 in the first operation, and choose Squares 2, 4 in the second operation.\n\nChoose Squares 2, 4 in the first operation, and choose Squares 1, 3 in the second operation.\n\nChoose Squares 1, 4 in the first operation, and choose Squares 2, 3 in the second operation.\n\nChoose Squares 2, 3 in the first operation, and choose Squares 1, 4 in the second operation.\n\nSample Input 2\n\n4\nBWBBWWWB\n\nSample Output 2\n\n288\n\nSample Input 3\n\n5\nWWWWWWWWWW\n\nSample Output 3\n\n0", "sample_input": "2\nBWWB\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02929", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are 2N squares arranged from left to right. You are given a string of length 2N representing the color of each of the squares.\n\nThe color of the i-th square from the left is black if the i-th character of S is B, and white if that character is W.\n\nYou will perform the following operation exactly N times: choose two distinct squares, then invert the colors of these squares and the squares between them. Here, to invert the color of a square is to make it white if it is black, and vice versa.\n\nThroughout this process, you cannot choose the same square twice or more. That is, each square has to be chosen exactly once.\n\nFind the number of ways to make all the squares white at the end of the process, modulo 10^9+7.\n\nTwo ways to make the squares white are considered different if and only if there exists i (1 \\leq i \\leq N) such that the pair of the squares chosen in the i-th operation is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = 2N\n\nEach character of S is B or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of ways to make all the squares white at the end of the process, modulo 10^9+7. If there are no such ways, print 0.\n\nSample Input 1\n\n2\nBWWB\n\nSample Output 1\n\n4\n\nThere are four ways to make all the squares white, as follows:\n\nChoose Squares 1, 3 in the first operation, and choose Squares 2, 4 in the second operation.\n\nChoose Squares 2, 4 in the first operation, and choose Squares 1, 3 in the second operation.\n\nChoose Squares 1, 4 in the first operation, and choose Squares 2, 3 in the second operation.\n\nChoose Squares 2, 3 in the first operation, and choose Squares 1, 4 in the second operation.\n\nSample Input 2\n\n4\nBWBBWWWB\n\nSample Output 2\n\n288\n\nSample Input 3\n\n5\nWWWWWWWWWW\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 64, "cpu_time_ms": 200, "memory_kb": 18052}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s176281656", "group_id": "codeNet:p02930", "input_text": "put map {map {1+msb $_+^$^a},$_^..$/},1..($/=get)", "language": "Perl", "metadata": {"date": 1566709437, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02930.html", "problem_id": "p02930", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02930/input.txt", "sample_output_relpath": "derived/input_output/data/p02930/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02930/Perl/s176281656.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s176281656", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1 2\n1\n", "input_to_evaluate": "put map {map {1+msb $_+^$^a},$_^..$/},1..($/=get)", "problem_context": "Score: 600 points\n\nProblem Statement\n\nAtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms.\n\nFor security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and must satisfy the following condition:\n\nFor each room i\\ (1 \\leq i \\leq N), if we leave Room i, pass through some passages whose levels are all equal and get back to Room i, the number of times we pass through a passage is always even.\n\nYour task is to set levels to the passages so that the highest level of a passage is minimized.\n\nConstraints\n\nN is an integer between 2 and 500 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint one way to set levels to the passages so that the objective is achieved, as follows:\n\na_{1,2} a_{1,3} ... a_{1,N}\na_{2,3} ... a_{2,N}\n.\n.\n.\na_{N-1,N}\n\nHere a_{i,j} is the level of the passage connecting Room i and Room j.\n\nIf there are multiple solutions, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 2\n1\n\nThe following image describes this output:\n\nFor example, if we leave Room 2, traverse the path 2 \\to 3 \\to 2 \\to 3 \\to 2 \\to 1 \\to 2 while only passing passages of level 1 and get back to Room 2, we pass through a passage six times.", "sample_input": "3\n"}, "reference_outputs": ["1 2\n1\n"], "source_document_id": "p02930", "source_text": "Score: 600 points\n\nProblem Statement\n\nAtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms.\n\nFor security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and must satisfy the following condition:\n\nFor each room i\\ (1 \\leq i \\leq N), if we leave Room i, pass through some passages whose levels are all equal and get back to Room i, the number of times we pass through a passage is always even.\n\nYour task is to set levels to the passages so that the highest level of a passage is minimized.\n\nConstraints\n\nN is an integer between 2 and 500 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint one way to set levels to the passages so that the objective is achieved, as follows:\n\na_{1,2} a_{1,3} ... a_{1,N}\na_{2,3} ... a_{2,N}\n.\n.\n.\na_{N-1,N}\n\nHere a_{i,j} is the level of the passage connecting Room i and Room j.\n\nIf there are multiple solutions, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 2\n1\n\nThe following image describes this output:\n\nFor example, if we leave Room 2, traverse the path 2 \\to 3 \\to 2 \\to 3 \\to 2 \\to 1 \\to 2 while only passing passages of level 1 and get back to Room 2, we pass through a passage six times.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 49, "cpu_time_ms": 2109, "memory_kb": 78592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s683541704", "group_id": "codeNet:p02934", "input_text": "say ?get/[+] 1 X/words", "language": "Perl", "metadata": {"date": 1589428173, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p02934.html", "problem_id": "p02934", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02934/input.txt", "sample_output_relpath": "derived/input_output/data/p02934/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02934/Perl/s683541704.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s683541704", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7.5\n", "input_to_evaluate": "say ?get/[+] 1 X/words", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a sequence of N integers A_1, \\ldots, A_N.\n\nFind the (multiplicative) inverse of the sum of the inverses of these numbers, \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nConstraints\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 \\ldots A_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the value of \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\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\n10 30\n\nSample Output 1\n\n7.5\n\n\\frac{1}{\\frac{1}{10} + \\frac{1}{30}} = \\frac{1}{\\frac{4}{30}} = \\frac{30}{4} = 7.5.\n\nPrinting 7.50001, 7.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n200 200 200\n\nSample Output 2\n\n66.66666666666667\n\n\\frac{1}{\\frac{1}{200} + \\frac{1}{200} + \\frac{1}{200}} = \\frac{1}{\\frac{3}{200}} = \\frac{200}{3} = 66.6666....\n\nPrinting 6.66666e+1 and so on will also be accepted.\n\nSample Input 3\n\n1\n1000\n\nSample Output 3\n\n1000\n\n\\frac{1}{\\frac{1}{1000}} = 1000.\n\nPrinting +1000.0 and so on will also be accepted.", "sample_input": "2\n10 30\n"}, "reference_outputs": ["7.5\n"], "source_document_id": "p02934", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a sequence of N integers A_1, \\ldots, A_N.\n\nFind the (multiplicative) inverse of the sum of the inverses of these numbers, \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nConstraints\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 \\ldots A_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the value of \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\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\n10 30\n\nSample Output 1\n\n7.5\n\n\\frac{1}{\\frac{1}{10} + \\frac{1}{30}} = \\frac{1}{\\frac{4}{30}} = \\frac{30}{4} = 7.5.\n\nPrinting 7.50001, 7.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n200 200 200\n\nSample Output 2\n\n66.66666666666667\n\n\\frac{1}{\\frac{1}{200} + \\frac{1}{200} + \\frac{1}{200}} = \\frac{1}{\\frac{3}{200}} = \\frac{200}{3} = 66.6666....\n\nPrinting 6.66666e+1 and so on will also be accepted.\n\nSample Input 3\n\n1\n1000\n\nSample Output 3\n\n1000\n\n\\frac{1}{\\frac{1}{1000}} = 1000.\n\nPrinting +1000.0 and so on will also be accepted.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 22, "cpu_time_ms": 178, "memory_kb": 84420}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s720869871", "group_id": "codeNet:p02934", "input_text": "<>;map$x+=1/$_,glob<>;print 1/$x", "language": "Perl", "metadata": {"date": 1566176629, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02934.html", "problem_id": "p02934", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02934/input.txt", "sample_output_relpath": "derived/input_output/data/p02934/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02934/Perl/s720869871.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s720869871", "user_id": "u283869437"}, "prompt_components": {"gold_output": "7.5\n", "input_to_evaluate": "<>;map$x+=1/$_,glob<>;print 1/$x", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a sequence of N integers A_1, \\ldots, A_N.\n\nFind the (multiplicative) inverse of the sum of the inverses of these numbers, \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nConstraints\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 \\ldots A_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the value of \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\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\n10 30\n\nSample Output 1\n\n7.5\n\n\\frac{1}{\\frac{1}{10} + \\frac{1}{30}} = \\frac{1}{\\frac{4}{30}} = \\frac{30}{4} = 7.5.\n\nPrinting 7.50001, 7.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n200 200 200\n\nSample Output 2\n\n66.66666666666667\n\n\\frac{1}{\\frac{1}{200} + \\frac{1}{200} + \\frac{1}{200}} = \\frac{1}{\\frac{3}{200}} = \\frac{200}{3} = 66.6666....\n\nPrinting 6.66666e+1 and so on will also be accepted.\n\nSample Input 3\n\n1\n1000\n\nSample Output 3\n\n1000\n\n\\frac{1}{\\frac{1}{1000}} = 1000.\n\nPrinting +1000.0 and so on will also be accepted.", "sample_input": "2\n10 30\n"}, "reference_outputs": ["7.5\n"], "source_document_id": "p02934", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a sequence of N integers A_1, \\ldots, A_N.\n\nFind the (multiplicative) inverse of the sum of the inverses of these numbers, \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nConstraints\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 \\ldots A_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the value of \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\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\n10 30\n\nSample Output 1\n\n7.5\n\n\\frac{1}{\\frac{1}{10} + \\frac{1}{30}} = \\frac{1}{\\frac{4}{30}} = \\frac{30}{4} = 7.5.\n\nPrinting 7.50001, 7.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n200 200 200\n\nSample Output 2\n\n66.66666666666667\n\n\\frac{1}{\\frac{1}{200} + \\frac{1}{200} + \\frac{1}{200}} = \\frac{1}{\\frac{3}{200}} = \\frac{200}{3} = 66.6666....\n\nPrinting 6.66666e+1 and so on will also be accepted.\n\nSample Input 3\n\n1\n1000\n\nSample Output 3\n\n1000\n\n\\frac{1}{\\frac{1}{1000}} = 1000.\n\nPrinting +1000.0 and so on will also be accepted.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s454004780", "group_id": "codeNet:p02935", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nchomp (my @v = split / /, );\n@v = sort { $a <=> $b } @v;\nmy $ans = ($v[0] + $v[1]) / 2;\nfor my $i (2..$n-1) {\n $ans += $v[$i];\n $ans /= 2;\n}\nsay $ans;", "language": "Perl", "metadata": {"date": 1586546753, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "low_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/Perl/s454004780.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s454004780", "user_id": "u979552932"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nchomp (my @v = split / /, );\n@v = sort { $a <=> $b } @v;\nmy $ans = ($v[0] + $v[1]) / 2;\nfor my $i (2..$n-1) {\n $ans += $v[$i];\n $ans /= 2;\n}\nsay $ans;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s576422224", "group_id": "codeNet:p02935", "input_text": "<>;$l=<>;chomp$l;@a=split/ /,$l;\nwhile($#a>0){\n @a=sort{$a<=>$b}@a;\n $x=shift@a;\n $y=shift@a;\n $z=($x+$y)/2;\n unshift@a,$z;\n}\nprint $a[0];", "language": "Perl", "metadata": {"date": 1568870983, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "low_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/Perl/s576422224.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s576422224", "user_id": "u926866194"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "<>;$l=<>;chomp$l;@a=split/ /,$l;\nwhile($#a>0){\n @a=sort{$a<=>$b}@a;\n $x=shift@a;\n $y=shift@a;\n $z=($x+$y)/2;\n unshift@a,$z;\n}\nprint $a[0];", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 143, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s962988745", "group_id": "codeNet:p02935", "input_text": "$a = <>;\n@b = glob<>;\n@b = sort {$a <=> $b} @b;\n$kati = ($b[0] + $b[1])/2;\n\nfor(my $i = 2; $i < $a; $i++){\n\t$kati = ($kati + $b[$i])/2;\n}\nprint $kati;\n", "language": "Perl", "metadata": {"date": 1567557047, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "low_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/Perl/s962988745.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s962988745", "user_id": "u124498235"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "$a = <>;\n@b = glob<>;\n@b = sort {$a <=> $b} @b;\n$kati = ($b[0] + $b[1])/2;\n\nfor(my $i = 2; $i < $a; $i++){\n\t$kati = ($kati + $b[$i])/2;\n}\nprint $kati;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s136624489", "group_id": "codeNet:p02935", "input_text": "my $n=get;\nmy @v=get.words.sort;\nfor 1..$n - 1 {\n unshift @v, ((shift @v) + (shift @v))/2;\n @v.sort;\n}\nsay @v[0];\n", "language": "Perl", "metadata": {"date": 1567160257, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "low_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/Perl/s136624489.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s136624489", "user_id": "u760868074"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "my $n=get;\nmy @v=get.words.sort;\nfor 1..$n - 1 {\n unshift @v, ((shift @v) + (shift @v))/2;\n @v.sort;\n}\nsay @v[0];\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 120, "cpu_time_ms": 322, "memory_kb": 66692}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s055473814", "group_id": "codeNet:p02940", "input_text": "<>;map{($a,$b,$c)=sort{$a-$b}$R,$G,$B;$$_++;($.*=$$_>$c?++$i:$$_>$b?$c-$b:$b-$a)%=998244353}`dd`=~/./g;print$.", "language": "Perl", "metadata": {"date": 1566804160, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02940.html", "problem_id": "p02940", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02940/input.txt", "sample_output_relpath": "derived/input_output/data/p02940/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02940/Perl/s055473814.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s055473814", "user_id": "u657913472"}, "prompt_components": {"gold_output": "216\n", "input_to_evaluate": "<>;map{($a,$b,$c)=sort{$a-$b}$R,$G,$B;$$_++;($.*=$$_>$c?++$i:$$_>$b?$c-$b:$b-$a)%=998244353}`dd`=~/./g;print$.", "problem_context": "Score : 800 points\n\nProblem Statement\n\nWe have 3N colored balls with IDs from 1 to 3N.\nA string S of length 3N represents the colors of the balls. The color of Ball i is red if S_i is R, green if S_i is G, and blue if S_i is B. There are N red balls, N green balls, and N blue balls.\n\nTakahashi will distribute these 3N balls to N people so that each person gets one red ball, one blue ball, and one green ball.\nThe people want balls with IDs close to each other, so he will additionally satisfy the following condition:\n\nLet a_j < b_j < c_j be the IDs of the balls received by the j-th person in ascending order.\n\nThen, \\sum_j (c_j-a_j) should be as small as possible.\n\nFind the number of ways in which Takahashi can distribute the balls. Since the answer can be enormous, compute it modulo 998244353.\nWe consider two ways to distribute the balls different if and only if there is a person who receives different sets of balls.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S|=3N\n\nS consists of R, G, and B, and each of these characters occurs N times in S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of ways in which Takahashi can distribute the balls, modulo 998244353.\n\nSample Input 1\n\n3\nRRRGGGBBB\n\nSample Output 1\n\n216\n\nThe minimum value of \\sum_j (c_j-a_j) is 18 when the balls are, for example, distributed as follows:\n\nThe first person gets Ball 1, 5, and 9.\n\nThe second person gets Ball 2, 4, and 8.\n\nThe third person gets Ball 3, 6, and 7.\n\nSample Input 2\n\n5\nBBRGRRGRGGRBBGB\n\nSample Output 2\n\n960", "sample_input": "3\nRRRGGGBBB\n"}, "reference_outputs": ["216\n"], "source_document_id": "p02940", "source_text": "Score : 800 points\n\nProblem Statement\n\nWe have 3N colored balls with IDs from 1 to 3N.\nA string S of length 3N represents the colors of the balls. The color of Ball i is red if S_i is R, green if S_i is G, and blue if S_i is B. There are N red balls, N green balls, and N blue balls.\n\nTakahashi will distribute these 3N balls to N people so that each person gets one red ball, one blue ball, and one green ball.\nThe people want balls with IDs close to each other, so he will additionally satisfy the following condition:\n\nLet a_j < b_j < c_j be the IDs of the balls received by the j-th person in ascending order.\n\nThen, \\sum_j (c_j-a_j) should be as small as possible.\n\nFind the number of ways in which Takahashi can distribute the balls. Since the answer can be enormous, compute it modulo 998244353.\nWe consider two ways to distribute the balls different if and only if there is a person who receives different sets of balls.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S|=3N\n\nS consists of R, G, and B, and each of these characters occurs N times in S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of ways in which Takahashi can distribute the balls, modulo 998244353.\n\nSample Input 1\n\n3\nRRRGGGBBB\n\nSample Output 1\n\n216\n\nThe minimum value of \\sum_j (c_j-a_j) is 18 when the balls are, for example, distributed as follows:\n\nThe first person gets Ball 1, 5, and 9.\n\nThe second person gets Ball 2, 4, and 8.\n\nThe third person gets Ball 3, 6, and 7.\n\nSample Input 2\n\n5\nBBRGRRGRGGRBBGB\n\nSample Output 2\n\n960", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 515, "memory_kb": 29076}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s637630616", "group_id": "codeNet:p02946", "input_text": "#!/usr/bin/perl\nmy ($k,$x) = map { $_ - 0 } split(/\\s+/,);\n\nmy $sep = '';\nfor(my $i = $x + 1 - $k ; $i <= $x - 1 + $k ; $i ++){\n print \"$sep$i\";\n $sep = ' ';\n}\nprint \"\\n\";\n", "language": "Perl", "metadata": {"date": 1565485606, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02946.html", "problem_id": "p02946", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02946/input.txt", "sample_output_relpath": "derived/input_output/data/p02946/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02946/Perl/s637630616.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s637630616", "user_id": "u750383873"}, "prompt_components": {"gold_output": "5 6 7 8 9\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($k,$x) = map { $_ - 0 } split(/\\s+/,);\n\nmy $sep = '';\nfor(my $i = $x + 1 - $k ; $i <= $x - 1 + $k ; $i ++){\n print \"$sep$i\";\n $sep = ' ';\n}\nprint \"\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "sample_input": "3 7\n"}, "reference_outputs": ["5 6 7 8 9\n"], "source_document_id": "p02946", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s701030266", "group_id": "codeNet:p02947", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nmy @s;\nfor my $i (0..$n-1) {\n chomp (my $in = );\n my @b = split //, $in;\n @b = sort {$a cmp $b} @b;\n $s[$i] = join('', @b);\n}\nmy %h;\n$h{$_}++ for @s;\nmy $ans = 0;\nfor my $value (values %h) {\n next if $value == 1;\n $ans += reduce {$a + $b} (1..$value-1);\n}\nsay $ans;", "language": "Perl", "metadata": {"date": 1586832521, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "low_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/Perl/s701030266.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s701030266", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nmy @s;\nfor my $i (0..$n-1) {\n chomp (my $in = );\n my @b = split //, $in;\n @b = sort {$a cmp $b} @b;\n $s[$i] = join('', @b);\n}\nmy %h;\n$h{$_}++ for @s;\nmy $ans = 0;\nfor my $value (values %h) {\n next if $value == 1;\n $ans += reduce {$a + $b} (1..$value-1);\n}\nsay $ans;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 394, "cpu_time_ms": 408, "memory_kb": 22528}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s798105892", "group_id": "codeNet:p02947", "input_text": "$b{join\"\",sort split//,$_}++ for<>;\n$s+=$_*($_-1)/2 for values %b;\nprint$s", "language": "Perl", "metadata": {"date": 1568934526, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "low_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/Perl/s798105892.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s798105892", "user_id": "u926866194"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$b{join\"\",sort split//,$_}++ for<>;\n$s+=$_*($_-1)/2 for values %b;\nprint$s", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 292, "memory_kb": 22144}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s168325923", "group_id": "codeNet:p02947", "input_text": "use strict;\nuse warnings;\n \nmy $N=;\n\nmy @num = ('00'..'25');\nmy @alph = ('a'..'z');\nmy @res;\nmy @str_new;\n\nfor ( my $i = 0; $i < $N; $i ++ ) {\n\n my $str=;\n \n chomp ($str);\n\n for ( my $j = 0; $j < @num; $j ++ ) {\n\t\n\t$str =~ s/$alph[$j]/$num[$j]/g;\n\t\n }\n \n my @array;\n \n for ( my $j = 0; $j < length($str); $j=$j+2 ) {\n\t\n\tpush ( @array, substr ( $str, $j, 2 ) );\n\t\n }\n\n @array = sort {$a <=> $b} @array;\n\n $str_new [$i] = join ( '', @array );\n\n}\n\n@str_new = sort {$a <=> $b} @str_new;\n\nmy $sum = 0;\nmy %cnt;\nforeach my $key (@str_new){\n if ($cnt{$key}) {\n $cnt{$key}=$cnt{$key}+1;\n } else {\n $cnt{$key}=1;\n }\n}\n\nforeach my $key (sort(keys(%cnt))){\n $sum= $sum + $cnt{$key}*($cnt{$key}-1)/2;\n}\n\n\nprint $sum;\n", "language": "Perl", "metadata": {"date": 1565491004, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "low_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/Perl/s168325923.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s168325923", "user_id": "u485252122"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use strict;\nuse warnings;\n \nmy $N=;\n\nmy @num = ('00'..'25');\nmy @alph = ('a'..'z');\nmy @res;\nmy @str_new;\n\nfor ( my $i = 0; $i < $N; $i ++ ) {\n\n my $str=;\n \n chomp ($str);\n\n for ( my $j = 0; $j < @num; $j ++ ) {\n\t\n\t$str =~ s/$alph[$j]/$num[$j]/g;\n\t\n }\n \n my @array;\n \n for ( my $j = 0; $j < length($str); $j=$j+2 ) {\n\t\n\tpush ( @array, substr ( $str, $j, 2 ) );\n\t\n }\n\n @array = sort {$a <=> $b} @array;\n\n $str_new [$i] = join ( '', @array );\n\n}\n\n@str_new = sort {$a <=> $b} @str_new;\n\nmy $sum = 0;\nmy %cnt;\nforeach my $key (@str_new){\n if ($cnt{$key}) {\n $cnt{$key}=$cnt{$key}+1;\n } else {\n $cnt{$key}=1;\n }\n}\n\nforeach my $key (sort(keys(%cnt))){\n $sum= $sum + $cnt{$key}*($cnt{$key}-1)/2;\n}\n\n\nprint $sum;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2104, "memory_kb": 3584}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s096596550", "group_id": "codeNet:p02951", "input_text": "($A, $B, $C) = split(/\\s+/, <>);\n\n$remain = $C - ($A - $B);\nif ($remain >= 0) {\n print \"$remain\\n\";\n} else {\n print \"0\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1565013440, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "low_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/Perl/s096596550.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s096596550", "user_id": "u614409380"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "($A, $B, $C) = split(/\\s+/, <>);\n\n$remain = $C - ($A - $B);\nif ($remain >= 0) {\n print \"$remain\\n\";\n} else {\n print \"0\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 131, "cpu_time_ms": 9, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s478385485", "group_id": "codeNet:p02951", "input_text": "print<>!~/ (.+) /,$-=$'-($`-$1)", "language": "Perl", "metadata": {"date": 1564967776, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "low_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/Perl/s478385485.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s478385485", "user_id": "u573154728"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "print<>!~/ (.+) /,$-=$'-($`-$1)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 31, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s946139547", "group_id": "codeNet:p02952", "input_text": "($N) = split(/\\s+/, <>);\n\n$n = 0;\n\nif ($N < 10) {\n # 1..$N: $N\n $n = $N;\n} elsif ($N < 100) {\n # 1..9: 9\n # 10..99: 0\n $n = 9;\n} elsif ($N < 1000) {\n # 1..9: 9\n # 10..99: 0\n # 100..$N: $N + 1\n $n = 9 + ($N - 100 + 1);\n} elsif ($N < 10000) {\n # 1..9: 9\n # 10..99: 0\n # 100..999: 900\n # 1000..$N: 0\n $n = 9 + 900;\n} elsif ($N < 100000) {\n # 1..9: 9\n # 10..99: 0\n # 100..999: 900\n # 1000..9999: 0\n # 10000..$N: $N - 100000 + 1\n $n = 9 + 900 + ($N - 10000 + 1);\n} elsif ($N == 100000) {\n $n = 9 + 900 + 90000;\n}\n\nprint \"$n\\n\";\n", "language": "Perl", "metadata": {"date": 1565019011, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02952.html", "problem_id": "p02952", "resource_group": "low_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/Perl/s946139547.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s946139547", "user_id": "u614409380"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "($N) = split(/\\s+/, <>);\n\n$n = 0;\n\nif ($N < 10) {\n # 1..$N: $N\n $n = $N;\n} elsif ($N < 100) {\n # 1..9: 9\n # 10..99: 0\n $n = 9;\n} elsif ($N < 1000) {\n # 1..9: 9\n # 10..99: 0\n # 100..$N: $N + 1\n $n = 9 + ($N - 100 + 1);\n} elsif ($N < 10000) {\n # 1..9: 9\n # 10..99: 0\n # 100..999: 900\n # 1000..$N: 0\n $n = 9 + 900;\n} elsif ($N < 100000) {\n # 1..9: 9\n # 10..99: 0\n # 100..999: 900\n # 1000..9999: 0\n # 10000..$N: $N - 100000 + 1\n $n = 9 + 900 + ($N - 10000 + 1);\n} elsif ($N == 100000) {\n $n = 9 + 900 + 90000;\n}\n\nprint \"$n\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 586, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s645753086", "group_id": "codeNet:p02954", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $s = );\nmy ($f, $c) = (0, 0);\nmy @p;\nfor my $i (0..length($s)-1) {\n if (substr($s, $i, 1) eq 'R') {\n if ($f == 1) {\n push @p, $c;\n $f = 0;\n $c = 0;\n }\n $c++;\n } else {\n if ($f == 0) {\n push @p, $c;\n $f = 1;\n $c = 0;\n }\n $c++;\n push @p, $c if $i == length($s) - 1;\n }\n}\nsay @p;\nmy $ans;\nwhile (@p) {\n my $x = shift @p;\n my $y = shift @p;\n $ans .= \"0 \" x ($x - 1);\n if (($x + $y) % 2 == 0) {\n $ans .= ($x + $y) / 2;\n $ans .= ' ';\n $ans .= ($x + $y) / 2;\n $ans .= ' ';\n } else {\n $ans .= int(($x + $y) / 2) + 1;\n $ans .= ' ';\n $ans .= int(($x + $y) / 2);\n $ans .= ' ';\n }\n $ans .= \"0 \" x ($y - 1);\n}\nsay substr($ans, 0, length($ans) - 1);", "language": "Perl", "metadata": {"date": 1587141482, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02954.html", "problem_id": "p02954", "resource_group": "low_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/Perl/s645753086.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s645753086", "user_id": "u979552932"}, "prompt_components": {"gold_output": "0 1 2 1 1\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $s = );\nmy ($f, $c) = (0, 0);\nmy @p;\nfor my $i (0..length($s)-1) {\n if (substr($s, $i, 1) eq 'R') {\n if ($f == 1) {\n push @p, $c;\n $f = 0;\n $c = 0;\n }\n $c++;\n } else {\n if ($f == 0) {\n push @p, $c;\n $f = 1;\n $c = 0;\n }\n $c++;\n push @p, $c if $i == length($s) - 1;\n }\n}\nsay @p;\nmy $ans;\nwhile (@p) {\n my $x = shift @p;\n my $y = shift @p;\n $ans .= \"0 \" x ($x - 1);\n if (($x + $y) % 2 == 0) {\n $ans .= ($x + $y) / 2;\n $ans .= ' ';\n $ans .= ($x + $y) / 2;\n $ans .= ' ';\n } else {\n $ans .= int(($x + $y) / 2) + 1;\n $ans .= ' ';\n $ans .= int(($x + $y) / 2);\n $ans .= ' ';\n }\n $ans .= \"0 \" x ($y - 1);\n}\nsay substr($ans, 0, length($ans) - 1);", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 828, "cpu_time_ms": 156, "memory_kb": 5708}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s575686815", "group_id": "codeNet:p02954", "input_text": "\nmy $s = ;\nmy @s = split(//,$s);\nmy @R;\nmy @L;\nmy @ans;\n\nmy $R_count = 0;\nmy $L_count = 0;\nmy $sakai = 0;\n\nfor( $i = 0; $i<=$#s; $i++){\n $R[$i] = 0;\n $L[$i] = 0;\n $ans[$i] = 0;\n}\n\nfor( $i = 0; $i<=$#s; $i++){\n\n if( $s[$i] eq \"R\"){\n if( $L_count > 0 ){\n $L[$sakai] = $L_count;\n } \n $R_count = $R_count + 1;\n $L_count = 0;\n }else{\n if( $R_count > 0 ){\n $sakai = $i;\n $R[$i] = $R_count;\n }\n $L_count = $L_count + 1;\n $R_count = 0;\n }\n}\n\nif( $L_count > 0 ){\n $L[$sakai] = $L_count;\n} \nfor( $i = 1; $i<=$#s; $i++){\n if($R[$i] >0){\n $ans[$i-1] = int($R[$i]/2);\n $ans[$i] = int($R[$i]/2+0.5);\n }\n #print \"$R[$i] \";\n}\n\nfor( $i = 1; $i<=$#s; $i++){\n if($L[$i] >0){\n $ans[$i-1] = $ans[$i-1] + int($L[$i]/2+0.5);\n $ans[$i] = $ans[$i] + int(($L[$i]/2)); \n }\n #print \"$L[$i] \";\n}\nfor( $i = 0; $i<=$#s; $i++){\n print \"$ans[$i] \";\n}\nprint \"\\n\";", "language": "Perl", "metadata": {"date": 1564972655, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02954.html", "problem_id": "p02954", "resource_group": "low_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/Perl/s575686815.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s575686815", "user_id": "u464700044"}, "prompt_components": {"gold_output": "0 1 2 1 1\n", "input_to_evaluate": "\nmy $s = ;\nmy @s = split(//,$s);\nmy @R;\nmy @L;\nmy @ans;\n\nmy $R_count = 0;\nmy $L_count = 0;\nmy $sakai = 0;\n\nfor( $i = 0; $i<=$#s; $i++){\n $R[$i] = 0;\n $L[$i] = 0;\n $ans[$i] = 0;\n}\n\nfor( $i = 0; $i<=$#s; $i++){\n\n if( $s[$i] eq \"R\"){\n if( $L_count > 0 ){\n $L[$sakai] = $L_count;\n } \n $R_count = $R_count + 1;\n $L_count = 0;\n }else{\n if( $R_count > 0 ){\n $sakai = $i;\n $R[$i] = $R_count;\n }\n $L_count = $L_count + 1;\n $R_count = 0;\n }\n}\n\nif( $L_count > 0 ){\n $L[$sakai] = $L_count;\n} \nfor( $i = 1; $i<=$#s; $i++){\n if($R[$i] >0){\n $ans[$i-1] = int($R[$i]/2);\n $ans[$i] = int($R[$i]/2+0.5);\n }\n #print \"$R[$i] \";\n}\n\nfor( $i = 1; $i<=$#s; $i++){\n if($L[$i] >0){\n $ans[$i-1] = $ans[$i-1] + int($L[$i]/2+0.5);\n $ans[$i] = $ans[$i] + int(($L[$i]/2)); \n }\n #print \"$L[$i] \";\n}\nfor( $i = 0; $i<=$#s; $i++){\n print \"$ans[$i] \";\n}\nprint \"\\n\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 237, "memory_kb": 30028}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s016391139", "group_id": "codeNet:p02954", "input_text": "\nmy $s = ;\nmy @s = split(//,$s);\nmy @R;\nmy @L;\nmy @ans;\n\nmy $R_count = 0;\nmy $L_count = 0;\nmy $sakai = 0;\n\nfor( $i = 0; $i<=$#s; $i++){\n $R[$i] = 0;\n $L[$i] = 0;\n $ans[$i] = 0;\n}\n\nfor( $i = 0; $i<=$#s; $i++){\n\n if( $s[$i] eq \"R\"){\n if( $L_count > 0 ){\n $L[$sakai] = $L_count;\n } \n $R_count = $R_count + 1;\n $L_count = 0;\n }else{\n if( $R_count > 0 ){\n $sakai = $i;\n $R[$i] = $R_count;\n }\n $L_count = $L_count + 1;\n $R_count = 0;\n }\n}\n\nif( $L_count > 0 ){\n $L[$sakai] = $L_count;\n} \nfor( $i = 1; $i<=$#s; $i++){\n if($R[$i] >0){\n $ans[$i-1] = int($R[$i]/2+0.5);\n $ans[$i] = int($R[$i]/2);\n }\n #print \"$R[$i] \";\n}\n\nfor( $i = 1; $i<=$#s; $i++){\n if($L[$i] >0){\n $ans[$i-1] = $ans[$i-1] + int($L[$i]/2);\n $ans[$i] = $ans[$i] + int(($L[$i]/2) + 0.5); \n }\n #print \"$L[$i] \";\n}\nfor( $i = 0; $i<=$#s; $i++){\n print \"$ans[$i] \";\n}\nprint \"\\n\";", "language": "Perl", "metadata": {"date": 1564972554, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02954.html", "problem_id": "p02954", "resource_group": "low_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/Perl/s016391139.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s016391139", "user_id": "u464700044"}, "prompt_components": {"gold_output": "0 1 2 1 1\n", "input_to_evaluate": "\nmy $s = ;\nmy @s = split(//,$s);\nmy @R;\nmy @L;\nmy @ans;\n\nmy $R_count = 0;\nmy $L_count = 0;\nmy $sakai = 0;\n\nfor( $i = 0; $i<=$#s; $i++){\n $R[$i] = 0;\n $L[$i] = 0;\n $ans[$i] = 0;\n}\n\nfor( $i = 0; $i<=$#s; $i++){\n\n if( $s[$i] eq \"R\"){\n if( $L_count > 0 ){\n $L[$sakai] = $L_count;\n } \n $R_count = $R_count + 1;\n $L_count = 0;\n }else{\n if( $R_count > 0 ){\n $sakai = $i;\n $R[$i] = $R_count;\n }\n $L_count = $L_count + 1;\n $R_count = 0;\n }\n}\n\nif( $L_count > 0 ){\n $L[$sakai] = $L_count;\n} \nfor( $i = 1; $i<=$#s; $i++){\n if($R[$i] >0){\n $ans[$i-1] = int($R[$i]/2+0.5);\n $ans[$i] = int($R[$i]/2);\n }\n #print \"$R[$i] \";\n}\n\nfor( $i = 1; $i<=$#s; $i++){\n if($L[$i] >0){\n $ans[$i-1] = $ans[$i-1] + int($L[$i]/2);\n $ans[$i] = $ans[$i] + int(($L[$i]/2) + 0.5); \n }\n #print \"$L[$i] \";\n}\nfor( $i = 0; $i<=$#s; $i++){\n print \"$ans[$i] \";\n}\nprint \"\\n\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 915, "cpu_time_ms": 236, "memory_kb": 30028}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s533885926", "group_id": "codeNet:p02955", "input_text": "<>=~$\";$s+=$_ for@_=glob<>;printf sort{$b-$a}grep{$d=$_;$t=0;$t+=$_ for@A=sort{$b-$a}map$_%$d,@_;$t-=$_ for@A[0..--$t/$d];$t<$'}map$s%$_?():($_,$s/$_),1..3e4", "language": "Perl", "metadata": {"date": 1564989563, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02955.html", "problem_id": "p02955", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02955/input.txt", "sample_output_relpath": "derived/input_output/data/p02955/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02955/Perl/s533885926.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s533885926", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "<>=~$\";$s+=$_ for@_=glob<>;printf sort{$b-$a}grep{$d=$_;$t=0;$t+=$_ for@A=sort{$b-$a}map$_%$d,@_;$t-=$_ for@A[0..--$t/$d];$t<$'}map$s%$_?():($_,$s/$_),1..3e4", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a sequence of N integers: A_1, A_2, \\cdots, A_N.\n\nYou can perform the following operation between 0 and K times (inclusive):\n\nChoose two integers i and j such that i \\neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.\n\nCompute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz.\n\nConstraints\n\n2 \\leq N \\leq 500\n\n1 \\leq A_i \\leq 10^6\n\n0 \\leq K \\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\nA_1 A_2 \\cdots A_{N-1} A_{N}\n\nOutput\n\nPrint the maximum possible positive integer that divides every element of A after the operations.\n\nSample Input 1\n\n2 3\n8 20\n\nSample Output 1\n\n7\n\n7 will divide every element of A if, for example, we perform the following operation:\n\nChoose i = 2, j = 1. A becomes (7, 21).\n\nWe cannot reach the situation where 8 or greater integer divides every element of A.\n\nSample Input 2\n\n2 10\n3 5\n\nSample Output 2\n\n8\n\nConsider performing the following five operations:\n\nChoose i = 2, j = 1. A becomes (2, 6).\n\nChoose i = 2, j = 1. A becomes (1, 7).\n\nChoose i = 2, j = 1. A becomes (0, 8).\n\nChoose i = 2, j = 1. A becomes (-1, 9).\n\nChoose i = 1, j = 2. A becomes (0, 8).\n\nThen, 0 = 8 \\times 0 and 8 = 8 \\times 1, so 8 divides every element of A. We cannot reach the situation where 9 or greater integer divides every element of A.\n\nSample Input 3\n\n4 5\n10 1 2 22\n\nSample Output 3\n\n7\n\nSample Input 4\n\n8 7\n1 7 5 6 8 2 6 5\n\nSample Output 4\n\n5", "sample_input": "2 3\n8 20\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02955", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a sequence of N integers: A_1, A_2, \\cdots, A_N.\n\nYou can perform the following operation between 0 and K times (inclusive):\n\nChoose two integers i and j such that i \\neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.\n\nCompute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz.\n\nConstraints\n\n2 \\leq N \\leq 500\n\n1 \\leq A_i \\leq 10^6\n\n0 \\leq K \\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\nA_1 A_2 \\cdots A_{N-1} A_{N}\n\nOutput\n\nPrint the maximum possible positive integer that divides every element of A after the operations.\n\nSample Input 1\n\n2 3\n8 20\n\nSample Output 1\n\n7\n\n7 will divide every element of A if, for example, we perform the following operation:\n\nChoose i = 2, j = 1. A becomes (7, 21).\n\nWe cannot reach the situation where 8 or greater integer divides every element of A.\n\nSample Input 2\n\n2 10\n3 5\n\nSample Output 2\n\n8\n\nConsider performing the following five operations:\n\nChoose i = 2, j = 1. A becomes (2, 6).\n\nChoose i = 2, j = 1. A becomes (1, 7).\n\nChoose i = 2, j = 1. A becomes (0, 8).\n\nChoose i = 2, j = 1. A becomes (-1, 9).\n\nChoose i = 1, j = 2. A becomes (0, 8).\n\nThen, 0 = 8 \\times 0 and 8 = 8 \\times 1, so 8 divides every element of A. We cannot reach the situation where 9 or greater integer divides every element of A.\n\nSample Input 3\n\n4 5\n10 1 2 22\n\nSample Output 3\n\n7\n\nSample Input 4\n\n8 7\n1 7 5 6 8 2 6 5\n\nSample Output 4\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 372, "memory_kb": 3328}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s240576825", "group_id": "codeNet:p02957", "input_text": "use strict;\nuse warnings;\n\nmy $i = <>;\nmy ($a, $b) = split(/\\s/, $i);\n\nif ($a != $b) {\n my $result = ($a + $b) / 2;\n if ($result =~ /^[0-9]+$/) {\n print $result;\n } else {\n print \"IMPOSSIBLE\";\n }\n} else {\n print \"IMPOSSIBLE\";\n}", "language": "Perl", "metadata": {"date": 1564277818, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02957.html", "problem_id": "p02957", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02957/input.txt", "sample_output_relpath": "derived/input_output/data/p02957/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02957/Perl/s240576825.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s240576825", "user_id": "u318027064"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $i = <>;\nmy ($a, $b) = split(/\\s/, $i);\n\nif ($a != $b) {\n my $result = ($a + $b) / 2;\n if ($result =~ /^[0-9]+$/) {\n print $result;\n } else {\n print \"IMPOSSIBLE\";\n }\n} else {\n print \"IMPOSSIBLE\";\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "sample_input": "2 16\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02957", "source_text": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s631564817", "group_id": "codeNet:p02957", "input_text": "my $s = ;\n@s = split(/ /,$s);\nmy $sum = $s[0] + $s[1];\nmy $m = $sum % 2;\nmy $ans;\nif($m == 0){\n $ans = $sum /2;\n print \"$ans\\n\";\n}else{\n print \"IMPOSSIBLE\";\n}", "language": "Perl", "metadata": {"date": 1564276263, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02957.html", "problem_id": "p02957", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02957/input.txt", "sample_output_relpath": "derived/input_output/data/p02957/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02957/Perl/s631564817.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s631564817", "user_id": "u464700044"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "my $s = ;\n@s = split(/ /,$s);\nmy $sum = $s[0] + $s[1];\nmy $m = $sum % 2;\nmy $ans;\nif($m == 0){\n $ans = $sum /2;\n print \"$ans\\n\";\n}else{\n print \"IMPOSSIBLE\";\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "sample_input": "2 16\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02957", "source_text": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s529205969", "group_id": "codeNet:p02957", "input_text": "my ($a, $b) = +<[2>sum ^get+1 Z[2>sum ^get+1 Z=~/./g){\n\t@e=0;\n\tfor$k(/\\?/?0..9:$_){\n\t\t$e[($_*10+$k)%13]+=$d[$_]for 0..12\n\t}\n\t@d=map$_%=1e9+7,@e\n}\nprint$d[5]\n", "language": "Perl", "metadata": {"date": 1564287412, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "low_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/Perl/s271721372.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s271721372", "user_id": "u283869437"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "@d=1;\nfor(<>=~/./g){\n\t@e=0;\n\tfor$k(/\\?/?0..9:$_){\n\t\t$e[($_*10+$k)%13]+=$d[$_]for 0..12\n\t}\n\t@d=map$_%=1e9+7,@e\n}\nprint$d[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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2104, "memory_kb": 12544}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s103023025", "group_id": "codeNet:p02960", "input_text": "@d=1;\nfor(<>=~/./g){\n\t@e=0;\n\tfor$j(0..12){\n\t\t($e[($j*10+$_)%13]+=$d[$j])%=1e9+7for/\\?/?0..9:$_\n\t}\n\t@d=@e\n}\nprint$d[5]+0\n", "language": "Perl", "metadata": {"date": 1564287197, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "low_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/Perl/s103023025.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s103023025", "user_id": "u283869437"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "@d=1;\nfor(<>=~/./g){\n\t@e=0;\n\tfor$j(0..12){\n\t\t($e[($j*10+$_)%13]+=$d[$j])%=1e9+7for/\\?/?0..9:$_\n\t}\n\t@d=@e\n}\nprint$d[5]+0\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 120, "cpu_time_ms": 2104, "memory_kb": 11520}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s755183271", "group_id": "codeNet:p02962", "input_text": "use strict;\nuse warnings;\npackage ZAlgorithm;\nsub z_algorithm(@){\n\tmy$n=@_;\n\tmy@z=($n);\n\tmy$i=1;\n\tmy$j=0;\n\twhile($i<$n){\n\t\t$j++while$i+$j<$n&&$_[$j]eq$_[$i+$j];\n\t\t$z[$i]=$j;\n\t\tif($j==0){\n\t\t\t$i++;\n\t\t\tnext;\n\t\t}\n\t\tmy$k=1;\n\t\twhile($i+$k<$n&&$k+$z[$k]<$j){\n\t\t\t$z[$i+$k]=$z[$k];\n\t\t\t$k++;\n\t\t}\n\t\t$i+=$k;\n\t\t$j-=$k;\n\t}\n\treturn@z;\n}\npackage main;\nmy($s,$t)=map{chomp;$_}<>;\nmy@s=split\"\",$s;\nmy@t=split\"\",$t;\nmy@ss;\npush@ss,@s while@ss<@t;\nmy@z=ZAlgorithm::z_algorithm(@t,@ss,@ss);\nlocal@main::memo=(-1)x@s;\nsub dfs{\n\tmy$u=shift;\n\tif($main::memo[$u]>=0){\n\t\treturn$main::memo[$u];\n\t}\n\telsif($main::memo[$u]==-2){\n\t\treturn$main::memo[$u]=1e9;\n\t}\n\tif($z[$u+@t]>=@t){\n\t\t$main::memo[$u]=-1;\n\t\treturn$main::memo[$u]=dfs(($u+@t)%@s)+1;\n\t}\n\telse{\n\t\treturn$main::memo[$u]=0;\n\t}\n}\nmy$ans=0;\nfor(0..$#s){\n\tmy$now=dfs($_);\n\t$ans=$now if$ans<$now;\n}\nprint$ans<1e9?$ans:-1,$/;\n", "language": "Perl", "metadata": {"date": 1599783694, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p02962.html", "problem_id": "p02962", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02962/input.txt", "sample_output_relpath": "derived/input_output/data/p02962/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02962/Perl/s755183271.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s755183271", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use strict;\nuse warnings;\npackage ZAlgorithm;\nsub z_algorithm(@){\n\tmy$n=@_;\n\tmy@z=($n);\n\tmy$i=1;\n\tmy$j=0;\n\twhile($i<$n){\n\t\t$j++while$i+$j<$n&&$_[$j]eq$_[$i+$j];\n\t\t$z[$i]=$j;\n\t\tif($j==0){\n\t\t\t$i++;\n\t\t\tnext;\n\t\t}\n\t\tmy$k=1;\n\t\twhile($i+$k<$n&&$k+$z[$k]<$j){\n\t\t\t$z[$i+$k]=$z[$k];\n\t\t\t$k++;\n\t\t}\n\t\t$i+=$k;\n\t\t$j-=$k;\n\t}\n\treturn@z;\n}\npackage main;\nmy($s,$t)=map{chomp;$_}<>;\nmy@s=split\"\",$s;\nmy@t=split\"\",$t;\nmy@ss;\npush@ss,@s while@ss<@t;\nmy@z=ZAlgorithm::z_algorithm(@t,@ss,@ss);\nlocal@main::memo=(-1)x@s;\nsub dfs{\n\tmy$u=shift;\n\tif($main::memo[$u]>=0){\n\t\treturn$main::memo[$u];\n\t}\n\telsif($main::memo[$u]==-2){\n\t\treturn$main::memo[$u]=1e9;\n\t}\n\tif($z[$u+@t]>=@t){\n\t\t$main::memo[$u]=-1;\n\t\treturn$main::memo[$u]=dfs(($u+@t)%@s)+1;\n\t}\n\telse{\n\t\treturn$main::memo[$u]=0;\n\t}\n}\nmy$ans=0;\nfor(0..$#s){\n\tmy$now=dfs($_);\n\t$ans=$now if$ans<$now;\n}\nprint$ans<1e9?$ans:-1,$/;\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if the number of non-negative integers i satisfying the following condition is finite, and find the maximum value of such i if the number is finite.\n\nThere exists a non-negative integer j such that the concatenation of i copies of t is a substring of the concatenation of j copies of s.\n\nNotes\n\nA string a is a substring of another string b if and only if there exists an integer x (0 \\leq x \\leq |b| - |a|) such that, for any y (1 \\leq y \\leq |a|), a_y = b_{x+y} holds.\n\nWe assume that the concatenation of zero copies of any string is the empty string. From the definition above, the empty string is a substring of any string. Thus, for any two strings s and t, i = 0 satisfies the condition in the problem statement.\n\nConstraints\n\n1 \\leq |s| \\leq 5 \\times 10^5\n\n1 \\leq |t| \\leq 5 \\times 10^5\n\ns and t consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf the number of non-negative integers i satisfying the following condition is finite, print the maximum value of such i; if the number is infinite, print -1.\n\nSample Input 1\n\nabcabab\nab\n\nSample Output 1\n\n3\n\nThe concatenation of three copies of t, ababab, is a substring of the concatenation of two copies of s, abcabababcabab, so i = 3 satisfies the condition.\n\nOn the other hand, the concatenation of four copies of t, abababab, is not a substring of the concatenation of any number of copies of s, so i = 4 does not satisfy the condition.\n\nSimilarly, any integer greater than 4 does not satisfy the condition, either. Thus, the number of non-negative integers i satisfying the condition is finite, and the maximum value of such i is 3.\n\nSample Input 2\n\naa\naaaaaaa\n\nSample Output 2\n\n-1\n\nFor any non-negative integer i, the concatenation of i copies of t is a substring of the concatenation of 4i copies of s. Thus, there are infinitely many non-negative integers i that satisfy the condition.\n\nSample Input 3\n\naba\nbaaab\n\nSample Output 3\n\n0\n\nAs stated in Notes, i = 0 always satisfies the condition.", "sample_input": "abcabab\nab\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02962", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if the number of non-negative integers i satisfying the following condition is finite, and find the maximum value of such i if the number is finite.\n\nThere exists a non-negative integer j such that the concatenation of i copies of t is a substring of the concatenation of j copies of s.\n\nNotes\n\nA string a is a substring of another string b if and only if there exists an integer x (0 \\leq x \\leq |b| - |a|) such that, for any y (1 \\leq y \\leq |a|), a_y = b_{x+y} holds.\n\nWe assume that the concatenation of zero copies of any string is the empty string. From the definition above, the empty string is a substring of any string. Thus, for any two strings s and t, i = 0 satisfies the condition in the problem statement.\n\nConstraints\n\n1 \\leq |s| \\leq 5 \\times 10^5\n\n1 \\leq |t| \\leq 5 \\times 10^5\n\ns and t consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf the number of non-negative integers i satisfying the following condition is finite, print the maximum value of such i; if the number is infinite, print -1.\n\nSample Input 1\n\nabcabab\nab\n\nSample Output 1\n\n3\n\nThe concatenation of three copies of t, ababab, is a substring of the concatenation of two copies of s, abcabababcabab, so i = 3 satisfies the condition.\n\nOn the other hand, the concatenation of four copies of t, abababab, is not a substring of the concatenation of any number of copies of s, so i = 4 does not satisfy the condition.\n\nSimilarly, any integer greater than 4 does not satisfy the condition, either. Thus, the number of non-negative integers i satisfying the condition is finite, and the maximum value of such i is 3.\n\nSample Input 2\n\naa\naaaaaaa\n\nSample Output 2\n\n-1\n\nFor any non-negative integer i, the concatenation of i copies of t is a substring of the concatenation of 4i copies of s. Thus, there are infinitely many non-negative integers i that satisfy the condition.\n\nSample Input 3\n\naba\nbaaab\n\nSample Output 3\n\n0\n\nAs stated in Notes, i = 0 always satisfies the condition.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 851, "cpu_time_ms": 2271, "memory_kb": 1830880}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s457972100", "group_id": "codeNet:p02963", "input_text": "(0,0,1,$!=10**9,($/=-get)/-$!+.9+|0,$/%$!).put", "language": "Perl", "metadata": {"date": 1563770033, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02963.html", "problem_id": "p02963", "resource_group": "low_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/Perl/s457972100.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s457972100", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1 0 2 2 0 1\n", "input_to_evaluate": "(0,0,1,$!=10**9,($/=-get)/-$!+.9+|0,$/%$!).put", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 296, "memory_kb": 62708}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s960944601", "group_id": "codeNet:p02969", "input_text": "my $r = ;\nchomp($r);\n\nmy $result = 3 * $r ** 2;\n\nprint $result;", "language": "Perl", "metadata": {"date": 1563670962, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "low_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/Perl/s960944601.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s960944601", "user_id": "u318027064"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "my $r = ;\nchomp($r);\n\nmy $result = 3 * $r ** 2;\n\nprint $result;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s123575306", "group_id": "codeNet:p02970", "input_text": "($n, $d) = split(/ /, <>);\n\n$s = $d + 1;\n$e = $s + $d;\n$last = $n - $d;\n\n$cnt = 1;\nwhile($s < $last){\n\t$s = $e + $d + 1;\n\t$e = $s + $d;\n\t$cnt++;\n}\n\nprint \"$cnt\\n\";\n", "language": "Perl", "metadata": {"date": 1570907798, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02970.html", "problem_id": "p02970", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02970/input.txt", "sample_output_relpath": "derived/input_output/data/p02970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02970/Perl/s123575306.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s123575306", "user_id": "u609426052"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "($n, $d) = split(/ /, <>);\n\n$s = $d + 1;\n$e = $s + $d;\n$last = $n - $d;\n\n$cnt = 1;\nwhile($s < $last){\n\t$s = $e + $d + 1;\n\t$e = $s + $d;\n\t$cnt++;\n}\n\nprint \"$cnt\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "sample_input": "6 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02970", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s555165082", "group_id": "codeNet:p02971", "input_text": "my $max = 0;\nmy $count = 0;\nmy $n = 0;\nmy @A_n = ();\n\nwhile () {\n if ($count == 0){ \n $n = $_;\n $count++;\n next; \n }\n\n push(@A_n, $_);\n}\n\n\nfor ($i=0; $i<$n; $i++) {\n my $max = 0;\n my $a_i = @A_n[$i];\n\n for ($j=0; $j<$n; $j++) {\n if ($i == $j) {\n next;\n }\n\n my $a_j = @A_n[$j];\n\n if ($a_j > $max) {\n $max = $a_j;\n }\n }\n\n print \"$max\";\n\n if ($i != $n -1 ){\n print \"\\n\";\n }\n}", "language": "Perl", "metadata": {"date": 1563673114, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "low_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/Perl/s555165082.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s555165082", "user_id": "u318027064"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "my $max = 0;\nmy $count = 0;\nmy $n = 0;\nmy @A_n = ();\n\nwhile () {\n if ($count == 0){ \n $n = $_;\n $count++;\n next; \n }\n\n push(@A_n, $_);\n}\n\n\nfor ($i=0; $i<$n; $i++) {\n my $max = 0;\n my $a_i = @A_n[$i];\n\n for ($j=0; $j<$n; $j++) {\n if ($i == $j) {\n next;\n }\n\n my $a_j = @A_n[$j];\n\n if ($a_j > $max) {\n $max = $a_j;\n }\n }\n\n print \"$max\";\n\n if ($i != $n -1 ){\n print \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2104, "memory_kb": 18304}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s173494295", "group_id": "codeNet:p02972", "input_text": "use List::Util qw(max min sum);\n\nmy ($n) = split(/\\s+/, <>);\nmy (@a) = (0, split(/\\s+/, <>));\nmy @b = ();\npush @b, 0 for (0..$n);\n\nfor (my $i=$n; $i>0; $i--) {\n my $sum=$a[$i];\n for (my $j=$i*2; $j<=$n; $j+=$i) {\n\t$sum += $b[$j];\n }\n $b[$i] = $sum % 2;\n}\nprint sum(@b), \"\\n\";\nfor (1..$n) {\n print \"$_ \" if $b[$_];\n}\nprint \"\\n\";\n", "language": "Perl", "metadata": {"date": 1563674243, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "low_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/Perl/s173494295.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s173494295", "user_id": "u996239623"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "use List::Util qw(max min sum);\n\nmy ($n) = split(/\\s+/, <>);\nmy (@a) = (0, split(/\\s+/, <>));\nmy @b = ();\npush @b, 0 for (0..$n);\n\nfor (my $i=$n; $i>0; $i--) {\n my $sum=$a[$i];\n for (my $j=$i*2; $j<=$n; $j+=$i) {\n\t$sum += $b[$j];\n }\n $b[$i] = $sum % 2;\n}\nprint sum(@b), \"\\n\";\nfor (1..$n) {\n print \"$_ \" if $b[$_];\n}\nprint \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 343, "cpu_time_ms": 501, "memory_kb": 30176}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s103569053", "group_id": "codeNet:p02975", "input_text": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @aa = map { $_ - 0 } split(/\\s+/,);\n\nmy %t = ();\n\nfor(my $i=0;$i<=$#aa;$i++){\n $t{$aa[$i]} ++;\n}\nmy @k_t = keys %t;\nmy $n_k = 1 + $#k_t;\n\n\nmy $res = 'No';\nif( $n % 3 == 0 ){\n if( $n_k == 3 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[1] - 0 ) ) == ( $k_t[2] - 0 );\n } elsif( $n_k == 2 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) == 0 or ( $k_t[1] - 0 ) == 0 );\n } elsif( $n_k == 1 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[0] - 0 ) == ( $k_t[0] - 0 ) );\n }\n} else {\n if( $n_k == 1 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[0] - 0 ) == ( $k_t[0] - 0 ) );\n }\n}\n\nprint \"$res\\n\";\n\nexit(0);\n\n", "language": "Perl", "metadata": {"date": 1563155249, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02975.html", "problem_id": "p02975", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02975/input.txt", "sample_output_relpath": "derived/input_output/data/p02975/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02975/Perl/s103569053.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s103569053", "user_id": "u750383873"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @aa = map { $_ - 0 } split(/\\s+/,);\n\nmy %t = ();\n\nfor(my $i=0;$i<=$#aa;$i++){\n $t{$aa[$i]} ++;\n}\nmy @k_t = keys %t;\nmy $n_k = 1 + $#k_t;\n\n\nmy $res = 'No';\nif( $n % 3 == 0 ){\n if( $n_k == 3 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[1] - 0 ) ) == ( $k_t[2] - 0 );\n } elsif( $n_k == 2 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) == 0 or ( $k_t[1] - 0 ) == 0 );\n } elsif( $n_k == 1 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[0] - 0 ) == ( $k_t[0] - 0 ) );\n }\n} else {\n if( $n_k == 1 ){\n $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[0] - 0 ) == ( $k_t[0] - 0 ) );\n }\n}\n\nprint \"$res\\n\";\n\nexit(0);\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\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 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02975", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\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 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 685, "cpu_time_ms": 103, "memory_kb": 26924}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s415625290", "group_id": "codeNet:p02981", "input_text": "<>=~/ (.+) /;print$`*$1<$'?$`*$1:$'", "language": "Perl", "metadata": {"date": 1562548464, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02981.html", "problem_id": "p02981", "resource_group": "low_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/Perl/s415625290.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s415625290", "user_id": "u573154728"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "<>=~/ (.+) /;print$`*$1<$'?$`*$1:$'", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 35, "cpu_time_ms": 8, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s295507477", "group_id": "codeNet:p02982", "input_text": "get;say +grep {[+]([Z-]($_)>>²)**½%%1},(+<>.words).combinations 2", "language": "Perl", "metadata": {"date": 1562581296, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02982.html", "problem_id": "p02982", "resource_group": "low_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/Perl/s295507477.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s295507477", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "get;say +grep {[+]([Z-]($_)>>²)**½%%1},(+<>.words).combinations 2", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 130, "memory_kb": 49436}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s102855197", "group_id": "codeNet:p02982", "input_text": "get;say +grep {[+]([Z-]($_)>>²)**½%%1},(+<>.words).combinations: 2", "language": "Perl", "metadata": {"date": 1562580367, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p02982.html", "problem_id": "p02982", "resource_group": "low_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/Perl/s102855197.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s102855197", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "get;say +grep {[+]([Z-]($_)>>²)**½%%1},(+<>.words).combinations: 2", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 75, "cpu_time_ms": 301, "memory_kb": 67752}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s217216417", "group_id": "codeNet:p02987", "input_text": "$s=<>;\n@ary=split//,$s;\n@ary = sort {$a cmp $b} @ary;\nif($ary[0] eq $ary[1] && $ary[2] eq $ary[3]){\n\tif($ary[0] ne $ary[2] && $ary[1] ne $ary[3] ){\n \tprint \"Yes\";\n } else {\n \tprint \"No\";\n }\n}else{\n\tprint\"No\";\n}", "language": "Perl", "metadata": {"date": 1568943108, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "low_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/Perl/s217216417.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s217216417", "user_id": "u124498235"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$s=<>;\n@ary=split//,$s;\n@ary = sort {$a cmp $b} @ary;\nif($ary[0] eq $ary[1] && $ary[2] eq $ary[3]){\n\tif($ary[0] ne $ary[2] && $ary[1] ne $ary[3] ){\n \tprint \"Yes\";\n } else {\n \tprint \"No\";\n }\n}else{\n\tprint\"No\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s082167435", "group_id": "codeNet:p02988", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = int();\nmy @p = split(/\\s+/, );\nfor (my $i = 0; $i < @p; $i++) {\n\t$p[$i] = int($p[$i]);\n}\n\nmy $count = 0;\n\nfor (my $i = 1; $i < $n - 1; $i++) {\n\tmy @d = ($p[$i-1], $p[$i], $p[$i+1]);\n\tmy @dd = sort { $a <=> $b } @d;\n\tif ($dd[1] == $p[$i]) { $count++; }\n}\n\nprint \"$count\\n\";\n", "language": "Perl", "metadata": {"date": 1561856888, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02988.html", "problem_id": "p02988", "resource_group": "low_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/Perl/s082167435.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s082167435", "user_id": "u646118499"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy $n = int();\nmy @p = split(/\\s+/, );\nfor (my $i = 0; $i < @p; $i++) {\n\t$p[$i] = int($p[$i]);\n}\n\nmy $count = 0;\n\nfor (my $i = 1; $i < $n - 1; $i++) {\n\tmy @d = ($p[$i-1], $p[$i], $p[$i+1]);\n\tmy @dd = sort { $a <=> $b } @d;\n\tif ($dd[1] == $p[$i]) { $count++; }\n}\n\nprint \"$count\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s784576227", "group_id": "codeNet:p02989", "input_text": "<>;@_=sort{$a-$b}glob<>;print$_[@_/2]-$_[$#_/2]", "language": "Perl", "metadata": {"date": 1561857304, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02989.html", "problem_id": "p02989", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02989/input.txt", "sample_output_relpath": "derived/input_output/data/p02989/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02989/Perl/s784576227.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s784576227", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>;@_=sort{$a-$b}glob<>;print$_[@_/2]-$_[$#_/2]", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi made N problems for competitive programming.\nThe problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).\n\nHe is dividing the problems into two categories by choosing an integer K, as follows:\n\nA problem with difficulty K or higher will be for ARCs.\n\nA problem with difficulty lower than K will be for ABCs.\n\nHow many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?\n\nProblem Statement\n\n2 \\leq N \\leq 10^5\n\nN is an even number.\n\n1 \\leq d_i \\leq 10^5\n\nAll values in input are integers.\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 number of choices of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 1\n\n6\n9 1 4 4 6 7\n\nSample Output 1\n\n2\n\nIf we choose K=5 or 6, Problem 1, 5, and 6 will be for ARCs, Problem 2, 3, and 4 will be for ABCs, and the objective is achieved.\nThus, the answer is 2.\n\nSample Input 2\n\n8\n9 1 14 5 5 4 4 14\n\nSample Output 2\n\n0\n\nThere may be no choice of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 3\n\n14\n99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1\n\nSample Output 3\n\n42685", "sample_input": "6\n9 1 4 4 6 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02989", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi made N problems for competitive programming.\nThe problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).\n\nHe is dividing the problems into two categories by choosing an integer K, as follows:\n\nA problem with difficulty K or higher will be for ARCs.\n\nA problem with difficulty lower than K will be for ABCs.\n\nHow many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?\n\nProblem Statement\n\n2 \\leq N \\leq 10^5\n\nN is an even number.\n\n1 \\leq d_i \\leq 10^5\n\nAll values in input are integers.\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 number of choices of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 1\n\n6\n9 1 4 4 6 7\n\nSample Output 1\n\n2\n\nIf we choose K=5 or 6, Problem 1, 5, and 6 will be for ARCs, Problem 2, 3, and 4 will be for ABCs, and the objective is achieved.\nThus, the answer is 2.\n\nSample Input 2\n\n8\n9 1 14 5 5 4 4 14\n\nSample Output 2\n\n0\n\nThere may be no choice of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 3\n\n14\n99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1\n\nSample Output 3\n\n42685", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 311, "memory_kb": 29680}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s621424261", "group_id": "codeNet:p02993", "input_text": "#!/usr/bin/perl\nuse strict;\nuse warnings FATAL => 'all';\n\nmy $input = ;\n\nprint($input =~ /(.)\\1/ ? 'Bad' : 'Good');\n", "language": "Perl", "metadata": {"date": 1561338998, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "low_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/Perl/s621424261.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s621424261", "user_id": "u992445197"}, "prompt_components": {"gold_output": "Bad\n", "input_to_evaluate": "#!/usr/bin/perl\nuse strict;\nuse warnings FATAL => 'all';\n\nmy $input = ;\n\nprint($input =~ /(.)\\1/ ? 'Bad' : 'Good');\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s636509863", "group_id": "codeNet:p02995", "input_text": "use Math::BigInt;\nuse bigint;\n\n($a, $b, $c, $d) = split(/ /, <>);\n\n$a--;\n$lcm = Math::BigInt::blcm($c, $d);\n\n$ok =\n\t (int($b / $c) - int($a / $c))\n\t+ (int($b / $d) - int($a / $d))\n\t- (int($b / $lcm) - int($a / $lcm));\n\n$ans = $b - $a - $ok;\n\nprint \"$ans\\n\";\n", "language": "Perl", "metadata": {"date": 1570900438, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "low_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/Perl/s636509863.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s636509863", "user_id": "u609426052"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use Math::BigInt;\nuse bigint;\n\n($a, $b, $c, $d) = split(/ /, <>);\n\n$a--;\n$lcm = Math::BigInt::blcm($c, $d);\n\n$ok =\n\t (int($b / $c) - int($a / $c))\n\t+ (int($b / $d) - int($a / $d))\n\t- (int($b / $lcm) - int($a / $lcm));\n\n$ans = $b - $a - $ok;\n\nprint \"$ans\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 32, "memory_kb": 4864}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s117454887", "group_id": "codeNet:p02995", "input_text": "use Math::BigInt;\n\n@s = split(/ /, <>);\n\n$lcm = Math::BigInt::blcm($s[2], $s[3]);\n\n$ok = (int($s[1] / $s[2]) - int(($s[0] - 1) / $s[2])) + (int($s[1] / $s[3]) - int(($s[0] - 1) / $s[3])) - (int($s[1] / $lcm) - int(($s[0] - 1) / $lcm));\n\n$ans = $s[1] - ($s[0] - 1) - $ok;\n\nprint \"$ans\\n\";\n", "language": "Perl", "metadata": {"date": 1570890799, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "low_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/Perl/s117454887.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s117454887", "user_id": "u609426052"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use Math::BigInt;\n\n@s = split(/ /, <>);\n\n$lcm = Math::BigInt::blcm($s[2], $s[3]);\n\n$ok = (int($s[1] / $s[2]) - int(($s[0] - 1) / $s[2])) + (int($s[1] / $s[3]) - int(($s[0] - 1) / $s[3])) - (int($s[1] / $lcm) - int(($s[0] - 1) / $lcm));\n\n$ans = $s[1] - ($s[0] - 1) - $ok;\n\nprint \"$ans\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 288, "cpu_time_ms": 35, "memory_kb": 4736}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s290845292", "group_id": "codeNet:p02998", "input_text": "@S=map$|++,@p=@i=0..10**5;$\\-=<>;sub f{my$U=pop;$p[$U]=$U-$p[$U]?f($p[$U]):$U}/ />${*a=-$'}||($v=f$`)-(f$a)&&($S[$p[$v]=f$a]+=$S[$v]),$a=$`for<>;$\\+=$S[f${-$_}]for@i;print", "language": "Perl", "metadata": {"date": 1561240174, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02998.html", "problem_id": "p02998", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02998/input.txt", "sample_output_relpath": "derived/input_output/data/p02998/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02998/Perl/s290845292.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s290845292", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "@S=map$|++,@p=@i=0..10**5;$\\-=<>;sub f{my$U=pop;$p[$U]=$U-$p[$U]?f($p[$U]):$U}/ />${*a=-$'}||($v=f$`)-(f$a)&&($S[$p[$v]=f$a]+=$S[$v]),$a=$`for<>;$\\+=$S[f${-$_}]for@i;print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).\n\nWe will repeat the following operation as long as possible:\n\nChoose four integers a, b, c, d (a \\neq c, b \\neq d) such that there are dots at exactly three of the positions (a, b), (a, d), (c, b) and (c, d), and add a dot at the remaining position.\n\nWe can prove that we can only do this operation a finite number of times. Find the maximum number of times we can do the operation.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq 10^5\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 maximum number of times we can do the operation.\n\nSample Input 1\n\n3\n1 1\n5 1\n5 5\n\nSample Output 1\n\n1\n\nBy choosing a = 1, b = 1, c = 5, d = 5, we can add a dot at (1, 5). We cannot do the operation any more, so the maximum number of operations is 1.\n\nSample Input 2\n\n2\n10 10\n20 20\n\nSample Output 2\n\n0\n\nThere are only two dots, so we cannot do the operation at all.\n\nSample Input 3\n\n9\n1 1\n2 1\n3 1\n4 1\n5 1\n1 2\n1 3\n1 4\n1 5\n\nSample Output 3\n\n16\n\nWe can do the operation for all choices of the form a = 1, b = 1, c = i, d = j (2 \\leq i,j \\leq 5), and no more. Thus, the maximum number of operations is 16.", "sample_input": "3\n1 1\n5 1\n5 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02998", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).\n\nWe will repeat the following operation as long as possible:\n\nChoose four integers a, b, c, d (a \\neq c, b \\neq d) such that there are dots at exactly three of the positions (a, b), (a, d), (c, b) and (c, d), and add a dot at the remaining position.\n\nWe can prove that we can only do this operation a finite number of times. Find the maximum number of times we can do the operation.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq 10^5\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 maximum number of times we can do the operation.\n\nSample Input 1\n\n3\n1 1\n5 1\n5 5\n\nSample Output 1\n\n1\n\nBy choosing a = 1, b = 1, c = 5, d = 5, we can add a dot at (1, 5). We cannot do the operation any more, so the maximum number of operations is 1.\n\nSample Input 2\n\n2\n10 10\n20 20\n\nSample Output 2\n\n0\n\nThere are only two dots, so we cannot do the operation at all.\n\nSample Input 3\n\n9\n1 1\n2 1\n3 1\n4 1\n5 1\n1 2\n1 3\n1 4\n1 5\n\nSample Output 3\n\n16\n\nWe can do the operation for all choices of the form a = 1, b = 1, c = i, d = j (2 \\leq i,j \\leq 5), and no more. Thus, the maximum number of operations is 16.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 171, "cpu_time_ms": 769, "memory_kb": 61184}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s853854733", "group_id": "codeNet:p02998", "input_text": "@S=(1)x(@p=@i=0..10**5);\n$%-=<>;\nsub f{my$U=pop;$p[$U]=$U-$p[$U]?f($p[$U]):$U}\n/ />${*a=-$'}||((f$a)-(f$`)and$S[f$`]+=$S[f$a],$p[f$a]=f$`),$a=$`for<>;\n$%+=($u=${-$_})>0&&$S[f$u]for@i;\nprint$%", "language": "Perl", "metadata": {"date": 1561239120, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02998.html", "problem_id": "p02998", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p02998/input.txt", "sample_output_relpath": "derived/input_output/data/p02998/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02998/Perl/s853854733.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s853854733", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "@S=(1)x(@p=@i=0..10**5);\n$%-=<>;\nsub f{my$U=pop;$p[$U]=$U-$p[$U]?f($p[$U]):$U}\n/ />${*a=-$'}||((f$a)-(f$`)and$S[f$`]+=$S[f$a],$p[f$a]=f$`),$a=$`for<>;\n$%+=($u=${-$_})>0&&$S[f$u]for@i;\nprint$%", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).\n\nWe will repeat the following operation as long as possible:\n\nChoose four integers a, b, c, d (a \\neq c, b \\neq d) such that there are dots at exactly three of the positions (a, b), (a, d), (c, b) and (c, d), and add a dot at the remaining position.\n\nWe can prove that we can only do this operation a finite number of times. Find the maximum number of times we can do the operation.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq 10^5\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 maximum number of times we can do the operation.\n\nSample Input 1\n\n3\n1 1\n5 1\n5 5\n\nSample Output 1\n\n1\n\nBy choosing a = 1, b = 1, c = 5, d = 5, we can add a dot at (1, 5). We cannot do the operation any more, so the maximum number of operations is 1.\n\nSample Input 2\n\n2\n10 10\n20 20\n\nSample Output 2\n\n0\n\nThere are only two dots, so we cannot do the operation at all.\n\nSample Input 3\n\n9\n1 1\n2 1\n3 1\n4 1\n5 1\n1 2\n1 3\n1 4\n1 5\n\nSample Output 3\n\n16\n\nWe can do the operation for all choices of the form a = 1, b = 1, c = i, d = j (2 \\leq i,j \\leq 5), and no more. Thus, the maximum number of operations is 16.", "sample_input": "3\n1 1\n5 1\n5 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02998", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).\n\nWe will repeat the following operation as long as possible:\n\nChoose four integers a, b, c, d (a \\neq c, b \\neq d) such that there are dots at exactly three of the positions (a, b), (a, d), (c, b) and (c, d), and add a dot at the remaining position.\n\nWe can prove that we can only do this operation a finite number of times. Find the maximum number of times we can do the operation.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq 10^5\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 maximum number of times we can do the operation.\n\nSample Input 1\n\n3\n1 1\n5 1\n5 5\n\nSample Output 1\n\n1\n\nBy choosing a = 1, b = 1, c = 5, d = 5, we can add a dot at (1, 5). We cannot do the operation any more, so the maximum number of operations is 1.\n\nSample Input 2\n\n2\n10 10\n20 20\n\nSample Output 2\n\n0\n\nThere are only two dots, so we cannot do the operation at all.\n\nSample Input 3\n\n9\n1 1\n2 1\n3 1\n4 1\n5 1\n1 2\n1 3\n1 4\n1 5\n\nSample Output 3\n\n16\n\nWe can do the operation for all choices of the form a = 1, b = 1, c = i, d = j (2 \\leq i,j \\leq 5), and no more. Thus, the maximum number of operations is 16.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 781, "memory_kb": 56576}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s003503445", "group_id": "codeNet:p02999", "input_text": "print<>!~$\",$`>=$',0", "language": "Perl", "metadata": {"date": 1571314539, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p02999.html", "problem_id": "p02999", "resource_group": "low_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/Perl/s003503445.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003503445", "user_id": "u832039789"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "print<>!~$\",$`>=$',0", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s706031530", "group_id": "codeNet:p03000", "input_text": "get~~/\\s.*/;say sum $/X>=[\\+] 0,|get.words", "language": "Perl", "metadata": {"date": 1571959981, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03000.html", "problem_id": "p03000", "resource_group": "low_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/Perl/s706031530.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s706031530", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get~~/\\s.*/;say sum $/X>=[\\+] 0,|get.words", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 411, "memory_kb": 73712}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s122581198", "group_id": "codeNet:p03001", "input_text": "($a,$b,$c,$d)=glob<>;\nprint$a*$b/2,$\",$a==$c*2&&$b==$d*2?1:0", "language": "Perl", "metadata": {"date": 1584089823, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03001.html", "problem_id": "p03001", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03001/input.txt", "sample_output_relpath": "derived/input_output/data/p03001/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03001/Perl/s122581198.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s122581198", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3.000000 0\n", "input_to_evaluate": "($a,$b,$c,$d)=glob<>;\nprint$a*$b/2,$\",$a==$c*2&&$b==$d*2?1:0", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).\nYou are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.\n\nConstraints\n\n1 \\leq W,H \\leq 10^9\n\n0\\leq x\\leq W\n\n0\\leq y\\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nW H x y\n\nOutput\n\nPrint the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.\n\nThe area printed will be judged correct when its absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n2 3 1 2\n\nSample Output 1\n\n3.000000 0\n\nThe line x=1 gives the optimal cut, and no other line does.\n\nSample Input 2\n\n2 2 1 1\n\nSample Output 2\n\n2.000000 1", "sample_input": "2 3 1 2\n"}, "reference_outputs": ["3.000000 0\n"], "source_document_id": "p03001", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).\nYou are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.\n\nConstraints\n\n1 \\leq W,H \\leq 10^9\n\n0\\leq x\\leq W\n\n0\\leq y\\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nW H x y\n\nOutput\n\nPrint the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.\n\nThe area printed will be judged correct when its absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n2 3 1 2\n\nSample Output 1\n\n3.000000 0\n\nThe line x=1 gives the optimal cut, and no other line does.\n\nSample Input 2\n\n2 2 1 1\n\nSample Output 2\n\n2.000000 1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 60, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s153326191", "group_id": "codeNet:p03011", "input_text": "my ($p, $q, $r) = split(/ /, <>);\nmy $a = $p + $q;\nmy $b = $q + $r;\nmy $c = $r + $p;\nmy $min = $a;\nif ($b < $min){\n $min = $b;\n}\nif ($c < $min){\n $min = $c;\n}\nprint $min;", "language": "Perl", "metadata": {"date": 1562902681, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03011.html", "problem_id": "p03011", "resource_group": "low_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/Perl/s153326191.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s153326191", "user_id": "u496744988"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "my ($p, $q, $r) = split(/ /, <>);\nmy $a = $p + $q;\nmy $b = $q + $r;\nmy $c = $r + $p;\nmy $min = $a;\nif ($b < $min){\n $min = $b;\n}\nif ($c < $min){\n $min = $c;\n}\nprint $min;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s206724874", "group_id": "codeNet:p03011", "input_text": "while(<>) {\n\tchomp;\n\tmy ($i, $j, $k) = split(/ /);\n\tmy @x = ($i+$j, $j+$k, $i+$k);\n\t@x = sort {$a <=> $b} @x;\n\tprint @x[0], \"\\n\";\n}", "language": "Perl", "metadata": {"date": 1560129192, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03011.html", "problem_id": "p03011", "resource_group": "low_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/Perl/s206724874.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s206724874", "user_id": "u020892708"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "while(<>) {\n\tchomp;\n\tmy ($i, $j, $k) = split(/ /);\n\tmy @x = ($i+$j, $j+$k, $i+$k);\n\t@x = sort {$a <=> $b} @x;\n\tprint @x[0], \"\\n\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 131, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s288333642", "group_id": "codeNet:p03013", "input_text": "($n,$m)=split/ /,<>;\n@a=<>;\n@a=(-1,@a,$n+1);\n@f=(1,1);\n$ans=1;\n$fl=2;\nfor($i=1;$i<=$m+1;$i++){\n $l=0;\n if($a[$i]==$a[$i-1]+1){\n $ans=0;\n last;\n }else{\n $l=$a[$i]-$a[$i-1]-1;\n }\n for($i=$fl;$i<$l+1;$i++){\n push@f,$f[$i-2]+$f[$i-1];\n $fl++;\n }\n $ans*=$f[$l-1];\n $ans%=1000000007\n}\nprint$ans;\n", "language": "Perl", "metadata": {"date": 1560137952, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03013.html", "problem_id": "p03013", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03013/input.txt", "sample_output_relpath": "derived/input_output/data/p03013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03013/Perl/s288333642.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s288333642", "user_id": "u676837005"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "($n,$m)=split/ /,<>;\n@a=<>;\n@a=(-1,@a,$n+1);\n@f=(1,1);\n$ans=1;\n$fl=2;\nfor($i=1;$i<=$m+1;$i++){\n $l=0;\n if($a[$i]==$a[$i-1]+1){\n $ans=0;\n last;\n }else{\n $l=$a[$i]-$a[$i-1]-1;\n }\n for($i=$fl;$i<$l+1;$i++){\n push@f,$f[$i-2]+$f[$i-1];\n $fl++;\n }\n $ans*=$f[$l-1];\n $ans%=1000000007\n}\nprint$ans;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "sample_input": "6 1\n3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03013", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 295, "cpu_time_ms": 2104, "memory_kb": 20096}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s069868377", "group_id": "codeNet:p03017", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($n, $a, $b, $c, $d) = split / /, );\nchomp (my $s = );\nif (index(substr($s, 0, max($c, $d)), '##', min($a, $b)) != -1) {\n say \"No\";\n exit;\n}\nif ($c < $d) {\n say \"Yes\";\n} elsif (index(substr($s, 0, min($c, $d)), '...', max($a, $b)) != -1) {\n say \"Yes\";\n} else {\n say \"No\";\n}", "language": "Perl", "metadata": {"date": 1586600243, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "low_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/Perl/s069868377.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s069868377", "user_id": "u979552932"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($n, $a, $b, $c, $d) = split / /, );\nchomp (my $s = );\nif (index(substr($s, 0, max($c, $d)), '##', min($a, $b)) != -1) {\n say \"No\";\n exit;\n}\nif ($c < $d) {\n say \"Yes\";\n} elsif (index(substr($s, 0, min($c, $d)), '...', max($a, $b)) != -1) {\n say \"Yes\";\n} else {\n say \"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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1280}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s449842865", "group_id": "codeNet:p03017", "input_text": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\nmy $s1 = $s;\n\nmy $ans = \"Yes\";\n$s1 = substr($s, $a - 1, $c - $a);\n\nif ($c < $d) {\n\tmy $cpath = substr($s, $a - 1, $c - $a + 1);\n\tmy $dpath = substr($s, $b - 1, $d - $b + 1);\n\tif ($cpath =~ m/##/ or $dpath =~ m/##/) {\n\t\t$ans = \"No\";\n\t}\n} elsif ($s1 =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\t# $c > $d\n\tmy $t = substr($s, $b -2, $d - $b + 2);\n\tif ($t !~ m/\\.{3}/) {\n\t\t$ans = 'No';\n\t}\n}\n\nprint $ans, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1559527637, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "low_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/Perl/s449842865.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s449842865", "user_id": "u250545805"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\nmy $s1 = $s;\n\nmy $ans = \"Yes\";\n$s1 = substr($s, $a - 1, $c - $a);\n\nif ($c < $d) {\n\tmy $cpath = substr($s, $a - 1, $c - $a + 1);\n\tmy $dpath = substr($s, $b - 1, $d - $b + 1);\n\tif ($cpath =~ m/##/ or $dpath =~ m/##/) {\n\t\t$ans = \"No\";\n\t}\n} elsif ($s1 =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\t# $c > $d\n\tmy $t = substr($s, $b -2, $d - $b + 2);\n\tif ($t !~ m/\\.{3}/) {\n\t\t$ans = 'No';\n\t}\n}\n\nprint $ans, \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 521, "cpu_time_ms": 5, "memory_kb": 1792}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s252196852", "group_id": "codeNet:p03017", "input_text": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\nmy $s1 = $s;\n\nmy $ans = \"Yes\";\n$s1 = substr($s, $a - 1, $c - $a);\n\nif ($c < $d) {\n\tmy $cpath = substr($s, $a - 1, $c - $a);\n\tmy $dpath = substr($s, $b - 1, $d - $b);\n\tif ($cpath =~ m/##/ or $dpath =~ m/##/) {\n\t\t$ans = \"No\";\n\t}\n} elsif ($s1 =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\t# $c > $d\n\tmy $t = substr($s, $b -2, $d - $b + 2);\n\tif ($t !~ m/\\.{3}/) {\n\t\t$ans = 'No';\n\t}\n}\n\nprint $ans, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1559527433, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "low_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/Perl/s252196852.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s252196852", "user_id": "u250545805"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\nmy $s1 = $s;\n\nmy $ans = \"Yes\";\n$s1 = substr($s, $a - 1, $c - $a);\n\nif ($c < $d) {\n\tmy $cpath = substr($s, $a - 1, $c - $a);\n\tmy $dpath = substr($s, $b - 1, $d - $b);\n\tif ($cpath =~ m/##/ or $dpath =~ m/##/) {\n\t\t$ans = \"No\";\n\t}\n} elsif ($s1 =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\t# $c > $d\n\tmy $t = substr($s, $b -2, $d - $b + 2);\n\tif ($t !~ m/\\.{3}/) {\n\t\t$ans = 'No';\n\t}\n}\n\nprint $ans, \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s779093618", "group_id": "codeNet:p03017", "input_text": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\n\nmy $ans = \"Yes\";\nmy $r = $c;\nif ($c < $d) {\n\t$r = $d;\n}\n$s = substr($s, 0, $r);\n$s = substr($s, $a - 1);\n\nif ($s =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\tif ($c > $d) {\n\t\tmy $left = substr($s, $b - 2, 1);\n\t\tmy $right = substr($s, $b, 1);\n\t\tunless ($left eq '.' and $right eq '.') {\n\t\t\tmy $t = substr($s, $b - 1);\n\t\t\tif ($t !~ m/\\.{3}/) {\n\t\t\t\t$ans = 'No';\n\t\t\t}\n\t\t}\n\t}\n}\n\nprint $ans, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1559525609, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "low_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/Perl/s779093618.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s779093618", "user_id": "u250545805"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\n\nmy $ans = \"Yes\";\nmy $r = $c;\nif ($c < $d) {\n\t$r = $d;\n}\n$s = substr($s, 0, $r);\n$s = substr($s, $a - 1);\n\nif ($s =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\tif ($c > $d) {\n\t\tmy $left = substr($s, $b - 2, 1);\n\t\tmy $right = substr($s, $b, 1);\n\t\tunless ($left eq '.' and $right eq '.') {\n\t\t\tmy $t = substr($s, $b - 1);\n\t\t\tif ($t !~ m/\\.{3}/) {\n\t\t\t\t$ans = 'No';\n\t\t\t}\n\t\t}\n\t}\n}\n\nprint $ans, \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1536}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s209980354", "group_id": "codeNet:p03017", "input_text": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\n\nmy $ans = \"Yes\";\n$s = substr($s, $a - 1);\n\nif ($s =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\tif ($c > $d) {\n\t\tmy $left = substr($s, $b - 2, 1);\n\t\tmy $right = substr($s, $b, 1);\n\t\tunless ($left eq '.' and $right eq '.') {\n\t\t\tmy $t = substr($s, $b);\n\t\t\tif ($t !~ m/\\.{3}/) {\n\t\t\t\t$ans = 'No';\n\t\t\t}\n\t\t}\n\t}\n}\n\nprint $ans, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1559524833, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "low_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/Perl/s209980354.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s209980354", "user_id": "u250545805"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $n;\nmy $a;\nmy $b;\nmy $c;\nmy $d;\nmy $s;\n($n, $a, $b, $c, $d) = split /\\s/, <>;\nchomp($s = <>);\n\nmy $ans = \"Yes\";\n$s = substr($s, $a - 1);\n\nif ($s =~ m/##/) {\n\t$ans = \"No\";\n} else {\n\tif ($c > $d) {\n\t\tmy $left = substr($s, $b - 2, 1);\n\t\tmy $right = substr($s, $b, 1);\n\t\tunless ($left eq '.' and $right eq '.') {\n\t\t\tmy $t = substr($s, $b);\n\t\t\tif ($t !~ m/\\.{3}/) {\n\t\t\t\t$ans = 'No';\n\t\t\t}\n\t\t}\n\t}\n}\n\nprint $ans, \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 441, "cpu_time_ms": 5, "memory_kb": 1280}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s639806298", "group_id": "codeNet:p03026", "input_text": "sub f{map{@c<3&&push@$_,$c[--$|]for@c=sort{$a-$b}glob}<>;$z[$_]or$x+=!??*($z[$_]=pop@c),map&f,@$_}f$_+=<>;print\"$x@z\"", "language": "Perl", "metadata": {"date": 1559450306, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03026.html", "problem_id": "p03026", "resource_group": "low_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/Perl/s639806298.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s639806298", "user_id": "u283869437"}, "prompt_components": {"gold_output": "10\n1 2 3 4 5\n", "input_to_evaluate": "sub f{map{@c<3&&push@$_,$c[--$|]for@c=sort{$a-$b}glob}<>;$z[$_]or$x+=!??*($z[$_]=pop@c),map&f,@$_}f$_+=<>;print\"$x@z\"", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 117, "cpu_time_ms": 830, "memory_kb": 17536}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s752419656", "group_id": "codeNet:p03031", "input_text": "@$_=@p=glob$\u0006.<>for<>!~$\"..$';print~~grep{/^/>grep{1&$_-grep$'>>$_-1&1,@{$%++%@p}}@p}1..2**$`", "language": "Perl", "metadata": {"date": 1559980288, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03031.html", "problem_id": "p03031", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03031/input.txt", "sample_output_relpath": "derived/input_output/data/p03031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03031/Perl/s752419656.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s752419656", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "@$_=@p=glob$\u0006.<>for<>!~$\"..$';print~~grep{/^/>grep{1&$_-grep$'>>$_-1&1,@{$%++%@p}}@p}1..2**$`", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "sample_input": "2 2\n2 1 2\n1 2\n0 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03031", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 32, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s736384258", "group_id": "codeNet:p03031", "input_text": "@s=map[glob'-'.<>],<>=~$\"..$';@p=glob<>;print~~grep{/^/;!grep{1&$p[$%++%@p]-grep$'>>$_-1&1,@$_}@s}1..2**$`", "language": "Perl", "metadata": {"date": 1559907816, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03031.html", "problem_id": "p03031", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03031/input.txt", "sample_output_relpath": "derived/input_output/data/p03031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03031/Perl/s736384258.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s736384258", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "@s=map[glob'-'.<>],<>=~$\"..$';@p=glob<>;print~~grep{/^/;!grep{1&$p[$%++%@p]-grep$'>>$_-1&1,@$_}@s}1..2**$`", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "sample_input": "2 2\n2 1 2\n1 2\n0 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03031", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 32, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s287012379", "group_id": "codeNet:p03032", "input_text": "<>=~$\";@V=glob<>;for$i(-1..$#V){$-=$'-(@_=sort{$a-$b}@V[0..$i,$_..$#V])+1and$\\+=$-=${$x=0;$x+=/-/&&--$-?0:$_ for@_;x}-$\\for$i+1..@V}print", "language": "Perl", "metadata": {"date": 1558945098, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03032.html", "problem_id": "p03032", "resource_group": "low_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/Perl/s287012379.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287012379", "user_id": "u283869437"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "<>=~$\";@V=glob<>;for$i(-1..$#V){$-=$'-(@_=sort{$a-$b}@V[0..$i,$_..$#V])+1and$\\+=$-=${$x=0;$x+=/-/&&--$-?0:$_ for@_;x}-$\\for$i+1..@V}print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 40, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s438486156", "group_id": "codeNet:p03033", "input_text": "use List::Util qw/min/;\n($n,$q)=glob<>;\n@E=();@Q;\nfor(1..$n){\n my($s,$t,$x)=glob<>;\n push(@E,[$s-$x,1,$x],[$t-$x,0,$x]);\n}\npush(@Q,glob<>) for(1..$q);\n@E = sort {@$a[0] <=> @$b[0]}@E;\n$next=shift(@Q);\nfor $e(@E){\n if($next<@$e[0]){\n $o=($#X<0)?-1:min(@X);\n print $o.\"\\n\";\n $next=shift(@Q);\n }\n if(@$e[1]){\n push(@X,@$e[2]);\n }else{\n @X= grep $_ != @$e[2],@X;\n }\n}\nprint \"-1\\n\" if($next!=undef);\nfor(@Q){\n print \"-1\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1558973697, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03033.html", "problem_id": "p03033", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03033/input.txt", "sample_output_relpath": "derived/input_output/data/p03033/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03033/Perl/s438486156.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s438486156", "user_id": "u573154728"}, "prompt_components": {"gold_output": "2\n2\n10\n-1\n13\n-1\n", "input_to_evaluate": "use List::Util qw/min/;\n($n,$q)=glob<>;\n@E=();@Q;\nfor(1..$n){\n my($s,$t,$x)=glob<>;\n push(@E,[$s-$x,1,$x],[$t-$x,0,$x]);\n}\npush(@Q,glob<>) for(1..$q);\n@E = sort {@$a[0] <=> @$b[0]}@E;\n$next=shift(@Q);\nfor $e(@E){\n if($next<@$e[0]){\n $o=($#X<0)?-1:min(@X);\n print $o.\"\\n\";\n $next=shift(@Q);\n }\n if(@$e[1]){\n push(@X,@$e[2]);\n }else{\n @X= grep $_ != @$e[2],@X;\n }\n}\nprint \"-1\\n\" if($next!=undef);\nfor(@Q){\n print \"-1\\n\";\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is an infinitely long street that runs west to east, which we consider as a number line.\n\nThere are N roadworks scheduled on this street.\nThe i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5.\n\nQ people are standing at coordinate 0. The i-th person will start the coordinate 0 at time D_i, continue to walk with speed 1 in the positive direction and stop walking when reaching a blocked point.\n\nFind the distance each of the Q people will walk.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q \\leq 2 \\times 10^5\n\n0 \\leq S_i < T_i \\leq 10^9\n\n1 \\leq X_i \\leq 10^9\n\n0 \\leq D_1 < D_2 < ... < D_Q \\leq 10^9\n\nIf i \\neq j and X_i = X_j, the intervals [S_i, T_i) and [S_j, T_j) do not overlap.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS_1 T_1 X_1\n:\nS_N T_N X_N\nD_1\n:\nD_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the distance the i-th person will walk or -1 if that person walks forever.\n\nSample Input 1\n\n4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n\nSample Output 1\n\n2\n2\n10\n-1\n13\n-1\n\nThe first person starts coordinate 0 at time 0 and stops walking at coordinate 2 when reaching a point blocked by the first roadwork at time 2.\n\nThe second person starts coordinate 0 at time 1 and reaches coordinate 2 at time 3. The first roadwork has ended, but the fourth roadwork has begun, so this person also stops walking at coordinate 2.\n\nThe fourth and sixth persons encounter no roadworks while walking, so they walk forever. The output for these cases is -1.", "sample_input": "4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n"}, "reference_outputs": ["2\n2\n10\n-1\n13\n-1\n"], "source_document_id": "p03033", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is an infinitely long street that runs west to east, which we consider as a number line.\n\nThere are N roadworks scheduled on this street.\nThe i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5.\n\nQ people are standing at coordinate 0. The i-th person will start the coordinate 0 at time D_i, continue to walk with speed 1 in the positive direction and stop walking when reaching a blocked point.\n\nFind the distance each of the Q people will walk.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q \\leq 2 \\times 10^5\n\n0 \\leq S_i < T_i \\leq 10^9\n\n1 \\leq X_i \\leq 10^9\n\n0 \\leq D_1 < D_2 < ... < D_Q \\leq 10^9\n\nIf i \\neq j and X_i = X_j, the intervals [S_i, T_i) and [S_j, T_j) do not overlap.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS_1 T_1 X_1\n:\nS_N T_N X_N\nD_1\n:\nD_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the distance the i-th person will walk or -1 if that person walks forever.\n\nSample Input 1\n\n4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n\nSample Output 1\n\n2\n2\n10\n-1\n13\n-1\n\nThe first person starts coordinate 0 at time 0 and stops walking at coordinate 2 when reaching a point blocked by the first roadwork at time 2.\n\nThe second person starts coordinate 0 at time 1 and reaches coordinate 2 at time 3. The first roadwork has ended, but the fourth roadwork has begun, so this person also stops walking at coordinate 2.\n\nThe fourth and sixth persons encounter no roadworks while walking, so they walk forever. The output for these cases is -1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 480, "cpu_time_ms": 2110, "memory_kb": 104704}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s383343608", "group_id": "codeNet:p03034", "input_text": "1/(<>-4)", "language": "Perl", "metadata": {"date": 1559027669, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03034.html", "problem_id": "p03034", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03034/input.txt", "sample_output_relpath": "derived/input_output/data/p03034/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03034/Perl/s383343608.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s383343608", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "1/(<>-4)", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is an infinitely large pond, which we consider as a number line.\nIn this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1.\nOn the lotus at coordinate i, an integer s_i is written.\n\nYou are standing on the lotus at coordinate 0. You will play a game that proceeds as follows:\n\n1. Choose positive integers A and B. Your score is initially 0.\n\n2. Let x be your current coordinate, and y = x+A. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n3. Let x be your current coordinate, and y = x-B. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n4. Go back to step 2.\n\nYou want to end the game with as high a score as possible.\nWhat is the score obtained by the optimal choice of A and B?\n\nConstraints\n\n3 \\leq N \\leq 10^5\n\n-10^9 \\leq s_i \\leq 10^9\n\ns_0=s_{N-1}=0\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_0 s_1 ...... s_{N-1}\n\nOutput\n\nPrint the score obtained by the optimal choice of A and B.\n\nSample Input 1\n\n5\n0 2 5 1 0\n\nSample Output 1\n\n3\n\nIf you choose A = 3 and B = 2, the game proceeds as follows:\n\nMove to coordinate 0 + 3 = 3. Your score increases by s_3 = 1.\n\nMove to coordinate 3 - 2 = 1. Your score increases by s_1 = 2.\n\nMove to coordinate 1 + 3 = 4. The game ends with a score of 3.\n\nThere is no way to end the game with a score of 4 or higher, so the answer is 3. Note that you cannot land the lotus at coordinate 2 without drowning later.\n\nSample Input 2\n\n6\n0 10 -7 -4 -13 0\n\nSample Output 2\n\n0\n\nThe optimal strategy here is to land the final lotus immediately by choosing A = 5 (the value of B does not matter).\n\nSample Input 3\n\n11\n0 -4 0 -99 31 14 -15 -39 43 18 0\n\nSample Output 3\n\n59", "sample_input": "5\n0 2 5 1 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03034", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is an infinitely large pond, which we consider as a number line.\nIn this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1.\nOn the lotus at coordinate i, an integer s_i is written.\n\nYou are standing on the lotus at coordinate 0. You will play a game that proceeds as follows:\n\n1. Choose positive integers A and B. Your score is initially 0.\n\n2. Let x be your current coordinate, and y = x+A. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n3. Let x be your current coordinate, and y = x-B. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n4. Go back to step 2.\n\nYou want to end the game with as high a score as possible.\nWhat is the score obtained by the optimal choice of A and B?\n\nConstraints\n\n3 \\leq N \\leq 10^5\n\n-10^9 \\leq s_i \\leq 10^9\n\ns_0=s_{N-1}=0\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_0 s_1 ...... s_{N-1}\n\nOutput\n\nPrint the score obtained by the optimal choice of A and B.\n\nSample Input 1\n\n5\n0 2 5 1 0\n\nSample Output 1\n\n3\n\nIf you choose A = 3 and B = 2, the game proceeds as follows:\n\nMove to coordinate 0 + 3 = 3. Your score increases by s_3 = 1.\n\nMove to coordinate 3 - 2 = 1. Your score increases by s_1 = 2.\n\nMove to coordinate 1 + 3 = 4. The game ends with a score of 3.\n\nThere is no way to end the game with a score of 4 or higher, so the answer is 3. Note that you cannot land the lotus at coordinate 2 without drowning later.\n\nSample Input 2\n\n6\n0 10 -7 -4 -13 0\n\nSample Output 2\n\n0\n\nThe optimal strategy here is to land the final lotus immediately by choosing A = 5 (the value of B does not matter).\n\nSample Input 3\n\n11\n0 -4 0 -99 31 14 -15 -39 43 18 0\n\nSample Output 3\n\n59", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s186969624", "group_id": "codeNet:p03034", "input_text": "$\\*=<>;map{$n=$L=0,$R=$#S;$\\+=$-=($n+=$S[$L]+$S[$R])-$\\while($L+=$_)<($R-=$_)|$R%$_&&$R>$_}1..(@S=glob<>);print", "language": "Perl", "metadata": {"date": 1558929633, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03034.html", "problem_id": "p03034", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03034/input.txt", "sample_output_relpath": "derived/input_output/data/p03034/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03034/Perl/s186969624.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s186969624", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$\\*=<>;map{$n=$L=0,$R=$#S;$\\+=$-=($n+=$S[$L]+$S[$R])-$\\while($L+=$_)<($R-=$_)|$R%$_&&$R>$_}1..(@S=glob<>);print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is an infinitely large pond, which we consider as a number line.\nIn this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1.\nOn the lotus at coordinate i, an integer s_i is written.\n\nYou are standing on the lotus at coordinate 0. You will play a game that proceeds as follows:\n\n1. Choose positive integers A and B. Your score is initially 0.\n\n2. Let x be your current coordinate, and y = x+A. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n3. Let x be your current coordinate, and y = x-B. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n4. Go back to step 2.\n\nYou want to end the game with as high a score as possible.\nWhat is the score obtained by the optimal choice of A and B?\n\nConstraints\n\n3 \\leq N \\leq 10^5\n\n-10^9 \\leq s_i \\leq 10^9\n\ns_0=s_{N-1}=0\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_0 s_1 ...... s_{N-1}\n\nOutput\n\nPrint the score obtained by the optimal choice of A and B.\n\nSample Input 1\n\n5\n0 2 5 1 0\n\nSample Output 1\n\n3\n\nIf you choose A = 3 and B = 2, the game proceeds as follows:\n\nMove to coordinate 0 + 3 = 3. Your score increases by s_3 = 1.\n\nMove to coordinate 3 - 2 = 1. Your score increases by s_1 = 2.\n\nMove to coordinate 1 + 3 = 4. The game ends with a score of 3.\n\nThere is no way to end the game with a score of 4 or higher, so the answer is 3. Note that you cannot land the lotus at coordinate 2 without drowning later.\n\nSample Input 2\n\n6\n0 10 -7 -4 -13 0\n\nSample Output 2\n\n0\n\nThe optimal strategy here is to land the final lotus immediately by choosing A = 5 (the value of B does not matter).\n\nSample Input 3\n\n11\n0 -4 0 -99 31 14 -15 -39 43 18 0\n\nSample Output 3\n\n59", "sample_input": "5\n0 2 5 1 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03034", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is an infinitely large pond, which we consider as a number line.\nIn this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1.\nOn the lotus at coordinate i, an integer s_i is written.\n\nYou are standing on the lotus at coordinate 0. You will play a game that proceeds as follows:\n\n1. Choose positive integers A and B. Your score is initially 0.\n\n2. Let x be your current coordinate, and y = x+A. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n3. Let x be your current coordinate, and y = x-B. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n4. Go back to step 2.\n\nYou want to end the game with as high a score as possible.\nWhat is the score obtained by the optimal choice of A and B?\n\nConstraints\n\n3 \\leq N \\leq 10^5\n\n-10^9 \\leq s_i \\leq 10^9\n\ns_0=s_{N-1}=0\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_0 s_1 ...... s_{N-1}\n\nOutput\n\nPrint the score obtained by the optimal choice of A and B.\n\nSample Input 1\n\n5\n0 2 5 1 0\n\nSample Output 1\n\n3\n\nIf you choose A = 3 and B = 2, the game proceeds as follows:\n\nMove to coordinate 0 + 3 = 3. Your score increases by s_3 = 1.\n\nMove to coordinate 3 - 2 = 1. Your score increases by s_1 = 2.\n\nMove to coordinate 1 + 3 = 4. The game ends with a score of 3.\n\nThere is no way to end the game with a score of 4 or higher, so the answer is 3. Note that you cannot land the lotus at coordinate 2 without drowning later.\n\nSample Input 2\n\n6\n0 10 -7 -4 -13 0\n\nSample Output 2\n\n0\n\nThe optimal strategy here is to land the final lotus immediately by choosing A = 5 (the value of B does not matter).\n\nSample Input 3\n\n11\n0 -4 0 -99 31 14 -15 -39 43 18 0\n\nSample Output 3\n\n59", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1287, "memory_kb": 35328}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s675597733", "group_id": "codeNet:p03034", "input_text": "$\\*=<>;@S=glob<>;map{$n=$L=0,$R=$#S;$\\+=$-=($n+=$S[$L]+$S[$R])-$\\while(($L+=$_)<($R-=$_)|$R%$_)&$R>$_}1..$#S;print", "language": "Perl", "metadata": {"date": 1558929413, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03034.html", "problem_id": "p03034", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03034/input.txt", "sample_output_relpath": "derived/input_output/data/p03034/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03034/Perl/s675597733.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s675597733", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$\\*=<>;@S=glob<>;map{$n=$L=0,$R=$#S;$\\+=$-=($n+=$S[$L]+$S[$R])-$\\while(($L+=$_)<($R-=$_)|$R%$_)&$R>$_}1..$#S;print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is an infinitely large pond, which we consider as a number line.\nIn this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1.\nOn the lotus at coordinate i, an integer s_i is written.\n\nYou are standing on the lotus at coordinate 0. You will play a game that proceeds as follows:\n\n1. Choose positive integers A and B. Your score is initially 0.\n\n2. Let x be your current coordinate, and y = x+A. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n3. Let x be your current coordinate, and y = x-B. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n4. Go back to step 2.\n\nYou want to end the game with as high a score as possible.\nWhat is the score obtained by the optimal choice of A and B?\n\nConstraints\n\n3 \\leq N \\leq 10^5\n\n-10^9 \\leq s_i \\leq 10^9\n\ns_0=s_{N-1}=0\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_0 s_1 ...... s_{N-1}\n\nOutput\n\nPrint the score obtained by the optimal choice of A and B.\n\nSample Input 1\n\n5\n0 2 5 1 0\n\nSample Output 1\n\n3\n\nIf you choose A = 3 and B = 2, the game proceeds as follows:\n\nMove to coordinate 0 + 3 = 3. Your score increases by s_3 = 1.\n\nMove to coordinate 3 - 2 = 1. Your score increases by s_1 = 2.\n\nMove to coordinate 1 + 3 = 4. The game ends with a score of 3.\n\nThere is no way to end the game with a score of 4 or higher, so the answer is 3. Note that you cannot land the lotus at coordinate 2 without drowning later.\n\nSample Input 2\n\n6\n0 10 -7 -4 -13 0\n\nSample Output 2\n\n0\n\nThe optimal strategy here is to land the final lotus immediately by choosing A = 5 (the value of B does not matter).\n\nSample Input 3\n\n11\n0 -4 0 -99 31 14 -15 -39 43 18 0\n\nSample Output 3\n\n59", "sample_input": "5\n0 2 5 1 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03034", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is an infinitely large pond, which we consider as a number line.\nIn this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1.\nOn the lotus at coordinate i, an integer s_i is written.\n\nYou are standing on the lotus at coordinate 0. You will play a game that proceeds as follows:\n\n1. Choose positive integers A and B. Your score is initially 0.\n\n2. Let x be your current coordinate, and y = x+A. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n3. Let x be your current coordinate, and y = x-B. The lotus at coordinate x disappears, and you move to coordinate y.\n\nIf y = N-1, the game ends.\n\nIf y \\neq N-1 and there is a lotus floating at coordinate y, your score increases by s_y.\n\nIf y \\neq N-1 and there is no lotus floating at coordinate y, you drown. Your score decreases by 10^{100} points, and the game ends.\n\n4. Go back to step 2.\n\nYou want to end the game with as high a score as possible.\nWhat is the score obtained by the optimal choice of A and B?\n\nConstraints\n\n3 \\leq N \\leq 10^5\n\n-10^9 \\leq s_i \\leq 10^9\n\ns_0=s_{N-1}=0\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_0 s_1 ...... s_{N-1}\n\nOutput\n\nPrint the score obtained by the optimal choice of A and B.\n\nSample Input 1\n\n5\n0 2 5 1 0\n\nSample Output 1\n\n3\n\nIf you choose A = 3 and B = 2, the game proceeds as follows:\n\nMove to coordinate 0 + 3 = 3. Your score increases by s_3 = 1.\n\nMove to coordinate 3 - 2 = 1. Your score increases by s_1 = 2.\n\nMove to coordinate 1 + 3 = 4. The game ends with a score of 3.\n\nThere is no way to end the game with a score of 4 or higher, so the answer is 3. Note that you cannot land the lotus at coordinate 2 without drowning later.\n\nSample Input 2\n\n6\n0 10 -7 -4 -13 0\n\nSample Output 2\n\n0\n\nThe optimal strategy here is to land the final lotus immediately by choosing A = 5 (the value of B does not matter).\n\nSample Input 3\n\n11\n0 -4 0 -99 31 14 -15 -39 43 18 0\n\nSample Output 3\n\n59", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1230, "memory_kb": 27400}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s840655230", "group_id": "codeNet:p03036", "input_text": "package MyApp;\nuse utf8;\nuse 5.016;\n\nprint func(map { chomp; $_ } <>);\n\nsub func {\n my @result;\n my ($n1, $n2, $n3) = split / /, shift;\n my $last = $n3;\n for my $i (1 .. 10) {\n $last = $n1 * $last - $n2;\n push @result, $last;\n }\n\n return join(\"\\n\", @result, '');\n}\n\nsub func2 {\n my ($n1, $n2) = @_;\n return $n2 if $n1 >= 13;\n return $n2 / 2 if $n1 >= 6;\n return 0;\n}\n\n1;\n__END__\n", "language": "Perl", "metadata": {"date": 1558832959, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03036.html", "problem_id": "p03036", "resource_group": "low_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/Perl/s840655230.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s840655230", "user_id": "u383396250"}, "prompt_components": {"gold_output": "30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n", "input_to_evaluate": "package MyApp;\nuse utf8;\nuse 5.016;\n\nprint func(map { chomp; $_ } <>);\n\nsub func {\n my @result;\n my ($n1, $n2, $n3) = split / /, shift;\n my $last = $n3;\n for my $i (1 .. 10) {\n $last = $n1 * $last - $n2;\n push @result, $last;\n }\n\n return join(\"\\n\", @result, '');\n}\n\nsub func2 {\n my ($n1, $n2) = @_;\n return $n2 if $n1 >= 13;\n return $n2 / 2 if $n1 >= 6;\n return 0;\n}\n\n1;\n__END__\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 423, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s021747975", "group_id": "codeNet:p03037", "input_text": "$r=<>;/ /,$l[$`]=$r-=$-=$r-$' for<>;print$-=$r-@l+2", "language": "Perl", "metadata": {"date": 1558846051, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "low_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/Perl/s021747975.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s021747975", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$r=<>;/ /,$l[$`]=$r-=$-=$r-$' for<>;print$-=$r-@l+2", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 118, "memory_kb": 21632}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s781388866", "group_id": "codeNet:p03037", "input_text": "use strict;\nuse warnings;\nuse utf8;\n\nmy ($N, $M) = split /\\s/, ;\nmy @L;\nmy @R;\nmy $min_r = 10 ** 5;\nmy $max_l = -1;\nfor (1 .. $M) {\n my ($l, $r) = split /\\s/, ;\n if ($r < $min_r) {\n $min_r = $r;\n }\n\n if ($max_l < $l) {\n $max_l = $l;\n }\n push @L, $l;\n push @R, $r;\n}\n\n\n#printf \"%s %s\\n\", $max_l, $min_r;\nprintf \"%s\\n\", $min_r - $max_l + 1;\n\n\n#my $cnt = 0;\n#for my $i (1 .. $N) {\n# my $ok = 1;\n# for (my $j = 0; $j < @L; $j++) {\n# my $l = $L[$j];\n# my $r = $R[$j];\n# if ($l <= $i and $i <= $r) {\n# # ok\n# } else {\n# $ok = 0;\n# }\n# }\n# if ($ok) {\n# $cnt++;\n# }\n#}\n#printf \"%s\\n\", $cnt;\n#\n#\n", "language": "Perl", "metadata": {"date": 1558833501, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "low_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/Perl/s781388866.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s781388866", "user_id": "u720452274"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\n\nmy ($N, $M) = split /\\s/, ;\nmy @L;\nmy @R;\nmy $min_r = 10 ** 5;\nmy $max_l = -1;\nfor (1 .. $M) {\n my ($l, $r) = split /\\s/, ;\n if ($r < $min_r) {\n $min_r = $r;\n }\n\n if ($max_l < $l) {\n $max_l = $l;\n }\n push @L, $l;\n push @R, $r;\n}\n\n\n#printf \"%s %s\\n\", $max_l, $min_r;\nprintf \"%s\\n\", $min_r - $max_l + 1;\n\n\n#my $cnt = 0;\n#for my $i (1 .. $N) {\n# my $ok = 1;\n# for (my $j = 0; $j < @L; $j++) {\n# my $l = $L[$j];\n# my $r = $R[$j];\n# if ($l <= $i and $i <= $r) {\n# # ok\n# } else {\n# $ok = 0;\n# }\n# }\n# if ($ok) {\n# $cnt++;\n# }\n#}\n#printf \"%s\\n\", $cnt;\n#\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 156, "memory_kb": 18048}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s534823841", "group_id": "codeNet:p03038", "input_text": "package MyApp;\nuse utf8;\nuse 5.016;\nuse bigint;\nuse List::Util qw(min sum);\n\nprint func(map { chomp; $_ } <>);\n\nsub func {\n my ($n, $m) = split / /, shift;\n my (@na) = split / /, shift;\n my $min_na = min @na;\n while (my $line = shift) {\n my ($nb, $nc) = split / /, $line;\n next if $nc < $min_na;\n my $change = 0;\n my @new_na;\n for my $na (sort { $a <=> $b } @na) {\n if ($na < $nc and $change++ < $nb) {\n push @new_na, $nc;\n }\n else {\n push @new_na, $na;\n }\n }\n @na = @new_na;\n $min_na = min @na;\n }\n my $result = sum @na;\n return join(\"\\n\", $result, '');\n}\n\n1;\n__END__\n", "language": "Perl", "metadata": {"date": 1558837531, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03038.html", "problem_id": "p03038", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03038/input.txt", "sample_output_relpath": "derived/input_output/data/p03038/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03038/Perl/s534823841.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s534823841", "user_id": "u383396250"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package MyApp;\nuse utf8;\nuse 5.016;\nuse bigint;\nuse List::Util qw(min sum);\n\nprint func(map { chomp; $_ } <>);\n\nsub func {\n my ($n, $m) = split / /, shift;\n my (@na) = split / /, shift;\n my $min_na = min @na;\n while (my $line = shift) {\n my ($nb, $nc) = split / /, $line;\n next if $nc < $min_na;\n my $change = 0;\n my @new_na;\n for my $na (sort { $a <=> $b } @na) {\n if ($na < $nc and $change++ < $nb) {\n push @new_na, $nc;\n }\n else {\n push @new_na, $na;\n }\n }\n @na = @new_na;\n $min_na = min @na;\n }\n my $result = sum @na;\n return join(\"\\n\", $result, '');\n}\n\n1;\n__END__\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\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, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "3 2\n5 1 4\n2 3\n1 5\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03038", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\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, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 724, "cpu_time_ms": 2110, "memory_kb": 49988}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s909018642", "group_id": "codeNet:p03038", "input_text": "use bigint;\n($n,$m)=glob<>;\n@A=glob<>;\n@A=sort{$b<=>$a}@A;\nfor(1..$m){\n ($b,$c)=glob<>;\n $L{$c}+=$b;\n}\n@l=sort {$b<=>$a}keys %L;\n$ans=0;\nfor(my$i=0;$i<$n;$i++){\n if($A[0]>=$l[0]){\n $ans+=shift(@A);\n }else{\n $res=($L{$l[0]}<$n-$i)?$L{$l[0]}:$n-$i;\n $ans+=$l[0]*$res;\n $i+=$res-1;\n delete $L{$l[0]};\n shift(@l);\n }\n}\nprint$ans", "language": "Perl", "metadata": {"date": 1558835230, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03038.html", "problem_id": "p03038", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03038/input.txt", "sample_output_relpath": "derived/input_output/data/p03038/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03038/Perl/s909018642.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s909018642", "user_id": "u573154728"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "use bigint;\n($n,$m)=glob<>;\n@A=glob<>;\n@A=sort{$b<=>$a}@A;\nfor(1..$m){\n ($b,$c)=glob<>;\n $L{$c}+=$b;\n}\n@l=sort {$b<=>$a}keys %L;\n$ans=0;\nfor(my$i=0;$i<$n;$i++){\n if($A[0]>=$l[0]){\n $ans+=shift(@A);\n }else{\n $res=($L{$l[0]}<$n-$i)?$L{$l[0]}:$n-$i;\n $ans+=$l[0]*$res;\n $i+=$res-1;\n delete $L{$l[0]};\n shift(@l);\n }\n}\nprint$ans", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\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, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "3 2\n5 1 4\n2 3\n1 5\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03038", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\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, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 381, "cpu_time_ms": 2106, "memory_kb": 46708}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s975549237", "group_id": "codeNet:p03040", "input_text": "#!/usr/bin/perl\nuse Data::Dumper;\nmy ($q_n) = map { $_ - 0 } split(/\\s+/,);\nmy @a = ();\nmy @s_a = ();\nmy $sum_b = 0;\nfor(my $i=0;$i<$q_n;$i++){\n my @q = map { $_ - 0 } split(/\\s+/,);\n if( $q[0] == 1 ){\n $sum_b += $q[2];\n my $pos = &ins_pos($q[1]);\n $#a ++;\n $#s_a ++;\n for(my $i=$#a;$i>=$pos+1;$i--){\n $a[$i] = $a[$i-1];\n $s_a[$i] = $s_a[$i-1] + $q[1];\n }\n $a[$pos] = $q[1];\n $s_a[$pos] = ($pos == 0 ? 0 : $s_a[$pos-1]) + $q[1];\n #print &Dumper(\\@a,\\@s_a);\n }\n if( $q[0] == 2 ){\n if( $#a < 0 ){\n print \"0 0\\n\";\n } elsif( $#a == 0 ){\n print \"$a[0] $sum_b\\n\";\n } elsif( $#a == 1 ){\n my $v = $sum_b + abs($a[0] - $a[1]);\n print \"$a[0] $v\\n\";\n } else {\n my $m_i = int($#a / 2);\n my $aa = $a[$m_i];\n my $v = ( $m_i * $a[$m_i] - $s_a[$m_i - 1] ) + ( $s_a[$#s_a] - $s_a[$m_i] - ($#a - $m_i)*$a[$m_i] ) + $sum_b;\n print \"$a[$m_i] $v\\n\";\n }\n }\n}\n\nexit(0);\n\nsub ins_pos {\n my $v = shift;\n if( $#a<0 ){\n return 0;\n }\n if( $#a == 0 ){\n return ( ( $a[0] > $v ) ? 0 : 1 );\n }\n if( $a[$#a] < $v ){\n return 1+$#a;\n }\n my $lb = 0;\n my $rb = $#a;\n my $p = -1;\n while($lb<$rb-1){\n my $mb = int(($lb + $rb)/2);\n if( $a->[$mb] == $v ){\n $p = $mb;\n last;\n }\n if( $a->[$mb] > $v ){\n $rb = $mb;\n } else {\n $lb = $mb;\n }\n }\n $p = $rb if $p<0;\n return $p;\n}\n\n\n", "language": "Perl", "metadata": {"date": 1558839288, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03040.html", "problem_id": "p03040", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03040/input.txt", "sample_output_relpath": "derived/input_output/data/p03040/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03040/Perl/s975549237.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s975549237", "user_id": "u750383873"}, "prompt_components": {"gold_output": "4 2\n1 -3\n", "input_to_evaluate": "#!/usr/bin/perl\nuse Data::Dumper;\nmy ($q_n) = map { $_ - 0 } split(/\\s+/,);\nmy @a = ();\nmy @s_a = ();\nmy $sum_b = 0;\nfor(my $i=0;$i<$q_n;$i++){\n my @q = map { $_ - 0 } split(/\\s+/,);\n if( $q[0] == 1 ){\n $sum_b += $q[2];\n my $pos = &ins_pos($q[1]);\n $#a ++;\n $#s_a ++;\n for(my $i=$#a;$i>=$pos+1;$i--){\n $a[$i] = $a[$i-1];\n $s_a[$i] = $s_a[$i-1] + $q[1];\n }\n $a[$pos] = $q[1];\n $s_a[$pos] = ($pos == 0 ? 0 : $s_a[$pos-1]) + $q[1];\n #print &Dumper(\\@a,\\@s_a);\n }\n if( $q[0] == 2 ){\n if( $#a < 0 ){\n print \"0 0\\n\";\n } elsif( $#a == 0 ){\n print \"$a[0] $sum_b\\n\";\n } elsif( $#a == 1 ){\n my $v = $sum_b + abs($a[0] - $a[1]);\n print \"$a[0] $v\\n\";\n } else {\n my $m_i = int($#a / 2);\n my $aa = $a[$m_i];\n my $v = ( $m_i * $a[$m_i] - $s_a[$m_i - 1] ) + ( $s_a[$#s_a] - $s_a[$m_i] - ($#a - $m_i)*$a[$m_i] ) + $sum_b;\n print \"$a[$m_i] $v\\n\";\n }\n }\n}\n\nexit(0);\n\nsub ins_pos {\n my $v = shift;\n if( $#a<0 ){\n return 0;\n }\n if( $#a == 0 ){\n return ( ( $a[0] > $v ) ? 0 : 1 );\n }\n if( $a[$#a] < $v ){\n return 1+$#a;\n }\n my $lb = 0;\n my $rb = $#a;\n my $p = -1;\n while($lb<$rb-1){\n my $mb = int(($lb + $rb)/2);\n if( $a->[$mb] == $v ){\n $p = $mb;\n last;\n }\n if( $a->[$mb] > $v ){\n $rb = $mb;\n } else {\n $lb = $mb;\n }\n }\n $p = $rb if $p<0;\n return $p;\n}\n\n\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a function f(x), which is initially a constant function f(x) = 0.\n\nWe will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:\n\nAn update query 1 a b: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).\n\nAn evaluation query 2: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.\n\nWe can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n-10^9 \\leq a, b \\leq 10^9\n\nThe first query is an update query.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nQuery_1\n:\nQuery_Q\n\nSee Sample Input 1 for an example.\n\nOutput\n\nFor each evaluation query, print a line containing the response, in the order in which the queries are given.\n\nThe response to each evaluation query should be the minimum value of x that minimizes f(x), and the minimum value of f(x), in this order, with space in between.\n\nSample Input 1\n\n4\n1 4 2\n2\n1 1 -8\n2\n\nSample Output 1\n\n4 2\n1 -3\n\nIn the first evaluation query, f(x) = |x - 4| + 2, which attains the minimum value of 2 at x = 4.\n\nIn the second evaluation query, f(x) = |x - 1| + |x - 4| - 6, which attains the minimum value of -3 when 1 \\leq x \\leq 4. Among the multiple values of x that minimize f(x), we ask you to print the minimum, that is, 1.\n\nSample Input 2\n\n4\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n2\n\nSample Output 2\n\n-1000000000 3000000000", "sample_input": "4\n1 4 2\n2\n1 1 -8\n2\n"}, "reference_outputs": ["4 2\n1 -3\n"], "source_document_id": "p03040", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a function f(x), which is initially a constant function f(x) = 0.\n\nWe will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:\n\nAn update query 1 a b: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).\n\nAn evaluation query 2: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.\n\nWe can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n-10^9 \\leq a, b \\leq 10^9\n\nThe first query is an update query.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nQuery_1\n:\nQuery_Q\n\nSee Sample Input 1 for an example.\n\nOutput\n\nFor each evaluation query, print a line containing the response, in the order in which the queries are given.\n\nThe response to each evaluation query should be the minimum value of x that minimizes f(x), and the minimum value of f(x), in this order, with space in between.\n\nSample Input 1\n\n4\n1 4 2\n2\n1 1 -8\n2\n\nSample Output 1\n\n4 2\n1 -3\n\nIn the first evaluation query, f(x) = |x - 4| + 2, which attains the minimum value of 2 at x = 4.\n\nIn the second evaluation query, f(x) = |x - 1| + |x - 4| - 6, which attains the minimum value of -3 when 1 \\leq x \\leq 4. Among the multiple values of x that minimize f(x), we ask you to print the minimum, that is, 1.\n\nSample Input 2\n\n4\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n2\n\nSample Output 2\n\n-1000000000 3000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1406, "cpu_time_ms": 2104, "memory_kb": 12544}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s176844209", "group_id": "codeNet:p03041", "input_text": "my ($n, $k) = split(/\\s+/, <>);\nmy ($s) = split(/\\s+/, <>);\n\nfor my $i (0..($n-1)) {\n my $c = substr($s, $i, 1);\n if ($i+1 == $k) {\n\t$c =~ tr/A-Z/a-z/;\n }\n print $c;\n}\nprint \"\\n\";\n", "language": "Perl", "metadata": {"date": 1558327239, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03041.html", "problem_id": "p03041", "resource_group": "low_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/Perl/s176844209.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s176844209", "user_id": "u996239623"}, "prompt_components": {"gold_output": "aBC\n", "input_to_evaluate": "my ($n, $k) = split(/\\s+/, <>);\nmy ($s) = split(/\\s+/, <>);\n\nfor my $i (0..($n-1)) {\n my $c = substr($s, $i, 1);\n if ($i+1 == $k) {\n\t$c =~ tr/A-Z/a-z/;\n }\n print $c;\n}\nprint \"\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s719450558", "group_id": "codeNet:p03041", "input_text": "<>=~$\";print<>|\"\\0\"x($'-1).$\"", "language": "Perl", "metadata": {"date": 1558320116, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03041.html", "problem_id": "p03041", "resource_group": "low_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/Perl/s719450558.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s719450558", "user_id": "u019489252"}, "prompt_components": {"gold_output": "aBC\n", "input_to_evaluate": "<>=~$\";print<>|\"\\0\"x($'-1).$\"", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 29, "cpu_time_ms": 8, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s875488284", "group_id": "codeNet:p03041", "input_text": "my $tmp = ;\nmy $s = ;\n\nchomp($tmp);\n\nmy ($n, $k) = split / /, $tmp;\n\nmy $a = lc substr($s, $k-1,1);\nsubstr($s, $k-1,1,$a);\n\n\nprint \"$s\\n\";\n\n", "language": "Perl", "metadata": {"date": 1558316363, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03041.html", "problem_id": "p03041", "resource_group": "low_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/Perl/s875488284.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s875488284", "user_id": "u199518197"}, "prompt_components": {"gold_output": "aBC\n", "input_to_evaluate": "my $tmp = ;\nmy $s = ;\n\nchomp($tmp);\n\nmy ($n, $k) = split / /, $tmp;\n\nmy $a = lc substr($s, $k-1,1);\nsubstr($s, $k-1,1,$a);\n\n\nprint \"$s\\n\";\n\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s640249366", "group_id": "codeNet:p03042", "input_text": "<>=~/../;print+(NA,YYMM,MMYY,AMBIGUOUS)[2*($&>0&&$&<13)+($'>0&&$'<13)]", "language": "Perl", "metadata": {"date": 1564680236, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "low_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/Perl/s640249366.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s640249366", "user_id": "u573154728"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "<>=~/../;print+(NA,YYMM,MMYY,AMBIGUOUS)[2*($&>0&&$&<13)+($'>0&&$'<13)]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s108863334", "group_id": "codeNet:p03042", "input_text": "$/=\\2;print+(NA,MMYY,YYMM,AMBIGUOUS)[~-<><9|(~-<><12)*2]", "language": "Perl", "metadata": {"date": 1558379116, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "low_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/Perl/s108863334.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s108863334", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "$/=\\2;print+(NA,MMYY,YYMM,AMBIGUOUS)[~-<><9|(~-<><12)*2]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 56, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s287211010", "group_id": "codeNet:p03043", "input_text": "$\\+=1/$`/2**grep$=/=2,1..($==2*~-$'/$_)for<>=~$\"..$`;print", "language": "Perl", "metadata": {"date": 1558335969, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "low_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/Perl/s287211010.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287211010", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": "$\\+=1/$`/2**grep$=/=2,1..($==2*~-$'/$_)for<>=~$\"..$`;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 415, "memory_kb": 8320}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s331300723", "group_id": "codeNet:p03043", "input_text": "$\\+=1/$`/2**grep$=/=2,$==2*~-$'/$_,0..9for<>=~$\"..$`;print", "language": "Perl", "metadata": {"date": 1558335884, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "low_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/Perl/s331300723.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s331300723", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": "$\\+=1/$`/2**grep$=/=2,$==2*~-$'/$_,0..9for<>=~$\"..$`;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 400, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s573193530", "group_id": "codeNet:p03043", "input_text": "#!/usr/bin/perl\n\nmy ($n,$k) = map {$_ - 0} split(/\\s+/o,);\n\nmy $res = 0;\nmy $rat = 1;\n\n# 最初は何もしなくても勝ち\n\nif( $k==1 ){\n print \"1\\n\";\n exit(0);\n}\n\nmy $a = $n;\n\nwhile(1){\n if( $k <= $a ){\n $res += ( $a - $k + 1 ) * $rat;\n $a = $k - 1;\n }\n $rat /= 2;\n last if $k == 1;\n $k = int(( $k + 1 ) / 2);\n}\n$res /= $n;\nprint \"$res\\n\";\n\nexit(0);\n\n", "language": "Perl", "metadata": {"date": 1558315477, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "low_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/Perl/s573193530.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s573193530", "user_id": "u750383873"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n,$k) = map {$_ - 0} split(/\\s+/o,);\n\nmy $res = 0;\nmy $rat = 1;\n\n# 最初は何もしなくても勝ち\n\nif( $k==1 ){\n print \"1\\n\";\n exit(0);\n}\n\nmy $a = $n;\n\nwhile(1){\n if( $k <= $a ){\n $res += ( $a - $k + 1 ) * $rat;\n $a = $k - 1;\n }\n $rat /= 2;\n last if $k == 1;\n $k = int(( $k + 1 ) / 2);\n}\n$res /= $n;\nprint \"$res\\n\";\n\nexit(0);\n\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s294845414", "group_id": "codeNet:p03045", "input_text": "sub f{$$_++||f()for@$_}print~~grep{map{push@{-$_},-$a[--$|]for@a=/\\d* /g}<>;!$$_+f}-<>..0", "language": "Perl", "metadata": {"date": 1558421376, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03045.html", "problem_id": "p03045", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03045/input.txt", "sample_output_relpath": "derived/input_output/data/p03045/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03045/Perl/s294845414.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s294845414", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "sub f{$$_++||f()for@$_}print~~grep{map{push@{-$_},-$a[--$|]for@a=/\\d* /g}<>;!$$_+f}-<>..0", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N cards placed face down in a row. On each card, an integer 1 or 2 is written.\n\nLet A_i be the integer written on the i-th card.\n\nYour objective is to guess A_1, A_2, ..., A_N correctly.\n\nYou know the following facts:\n\nFor each i = 1, 2, ..., M, the value A_{X_i} + A_{Y_i} + Z_i is an even number.\n\nYou are a magician and can use the following magic any number of times:\n\nMagic: Choose one card and know the integer A_i written on it. The cost of using this magic is 1.\n\nWhat is the minimum cost required to determine all of A_1, A_2, ..., A_N?\n\nIt is guaranteed that there is no contradiction in given input.\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 X_i < Y_i \\leq N\n\n1 \\leq Z_i \\leq 100\n\nThe pairs (X_i, Y_i) are distinct.\n\nThere is no contradiction in input. (That is, there exist integers A_1, A_2, ..., A_N that satisfy the conditions.)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 Y_1 Z_1\nX_2 Y_2 Z_2\n\\vdots\nX_M Y_M Z_M\n\nOutput\n\nPrint the minimum total cost required to determine all of A_1, A_2, ..., A_N.\n\nSample Input 1\n\n3 1\n1 2 1\n\nSample Output 1\n\n2\n\nYou can determine all of A_1, A_2, A_3 by using the magic for the first and third cards.\n\nSample Input 2\n\n6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n5 6 5\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1\n1 100000 100\n\nSample Output 3\n\n99999", "sample_input": "3 1\n1 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03045", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N cards placed face down in a row. On each card, an integer 1 or 2 is written.\n\nLet A_i be the integer written on the i-th card.\n\nYour objective is to guess A_1, A_2, ..., A_N correctly.\n\nYou know the following facts:\n\nFor each i = 1, 2, ..., M, the value A_{X_i} + A_{Y_i} + Z_i is an even number.\n\nYou are a magician and can use the following magic any number of times:\n\nMagic: Choose one card and know the integer A_i written on it. The cost of using this magic is 1.\n\nWhat is the minimum cost required to determine all of A_1, A_2, ..., A_N?\n\nIt is guaranteed that there is no contradiction in given input.\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 X_i < Y_i \\leq N\n\n1 \\leq Z_i \\leq 100\n\nThe pairs (X_i, Y_i) are distinct.\n\nThere is no contradiction in input. (That is, there exist integers A_1, A_2, ..., A_N that satisfy the conditions.)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 Y_1 Z_1\nX_2 Y_2 Z_2\n\\vdots\nX_M Y_M Z_M\n\nOutput\n\nPrint the minimum total cost required to determine all of A_1, A_2, ..., A_N.\n\nSample Input 1\n\n3 1\n1 2 1\n\nSample Output 1\n\n2\n\nYou can determine all of A_1, A_2, A_3 by using the magic for the first and third cards.\n\nSample Input 2\n\n6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n5 6 5\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1\n1 100000 100\n\nSample Output 3\n\n99999", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1149, "memory_kb": 124672}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s773581952", "group_id": "codeNet:p03048", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(max min sum);\n\nchomp (my ($r1, $g1, $b1, $n) = split / /, );\nmy $ans = 0;\nmy $r = max($r1, $g1, $b1);\nmy $b = min($r1, $g1, $b1);\nmy $g = sum($r1, $g1, $b1) - $r - $b;\nfor my $i (0..$n) {\n last if $r * $i > $n;\n for my $j (0..$n) {\n last if $r * $i + $g * $j > $n;\n my $c = $n - $r * $i - $g * $j;\n $ans++ if $c % $b == 0 && $c / $b <= $n;\n }\n}\nsay $ans;", "language": "Perl", "metadata": {"date": 1587060488, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03048.html", "problem_id": "p03048", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03048/input.txt", "sample_output_relpath": "derived/input_output/data/p03048/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03048/Perl/s773581952.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s773581952", "user_id": "u979552932"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(max min sum);\n\nchomp (my ($r1, $g1, $b1, $n) = split / /, );\nmy $ans = 0;\nmy $r = max($r1, $g1, $b1);\nmy $b = min($r1, $g1, $b1);\nmy $g = sum($r1, $g1, $b1) - $r - $b;\nfor my $i (0..$n) {\n last if $r * $i > $n;\n for my $j (0..$n) {\n last if $r * $i + $g * $j > $n;\n my $c = $n - $r * $i - $g * $j;\n $ans++ if $c % $b == 0 && $c / $b <= $n;\n }\n}\nsay $ans;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "sample_input": "1 2 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03048", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 435, "cpu_time_ms": 2103, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s829226913", "group_id": "codeNet:p03049", "input_text": "$_=`dd`;print@{(@A=/A\n/g)<(@B=/\nB/g)?A:B}+s/AB//g-((s/^B.*A$//mg||-1)*2==@A+@B)", "language": "Perl", "metadata": {"date": 1557644085, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/Perl/s829226913.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s829226913", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$_=`dd`;print@{(@A=/A\n/g)<(@B=/\nB/g)?A:B}+s/AB//g-((s/^B.*A$//mg||-1)*2==@A+@B)", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 79, "cpu_time_ms": 11, "memory_kb": 3264}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s496798423", "group_id": "codeNet:p03049", "input_text": "<>;\n/^B.*A$/?++$B_A:/^B/?++$B:/A$/?++$A:0,$AB+=s/AB//g for<>;\nprint$AB+$B_A+($A<$B?$A:$B),$/\n", "language": "Perl", "metadata": {"date": 1557624462, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/Perl/s496798423.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s496798423", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>;\n/^B.*A$/?++$B_A:/^B/?++$B:/A$/?++$A:0,$AB+=s/AB//g for<>;\nprint$AB+$B_A+($A<$B?$A:$B),$/\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2176}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s860201151", "group_id": "codeNet:p03050", "input_text": "$N%$_ or$%+=$N/$_-1for 1..($N=<>)**.5;print$%", "language": "Perl", "metadata": {"date": 1557635016, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03050.html", "problem_id": "p03050", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03050/input.txt", "sample_output_relpath": "derived/input_output/data/p03050/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03050/Perl/s860201151.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s860201151", "user_id": "u657913472"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$N%$_ or$%+=$N/$_-1for 1..($N=<>)**.5;print$%", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSnuke received a positive integer N from Takahashi.\nA positive integer m is called a favorite number when the following condition is satisfied:\n\nThe quotient and remainder of N divided by m are equal, that is, \\lfloor \\frac{N}{m} \\rfloor = N \\bmod m holds.\n\nFind all favorite numbers and print the sum of those.\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 answer.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n10\n\nThere are two favorite numbers: 3 and 7. Print the sum of these, 10.\n\nSample Input 2\n\n1000000000000\n\nSample Output 2\n\n2499686339916\n\nWatch out for overflow.", "sample_input": "8\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03050", "source_text": "Score : 500 points\n\nProblem Statement\n\nSnuke received a positive integer N from Takahashi.\nA positive integer m is called a favorite number when the following condition is satisfied:\n\nThe quotient and remainder of N divided by m are equal, that is, \\lfloor \\frac{N}{m} \\rfloor = N \\bmod m holds.\n\nFind all favorite numbers and print the sum of those.\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 answer.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n10\n\nThere are two favorite numbers: 3 and 7. Print the sum of these, 10.\n\nSample Input 2\n\n1000000000000\n\nSample Output 2\n\n2499686339916\n\nWatch out for overflow.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 56, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s472055029", "group_id": "codeNet:p03059", "input_text": "my $input = ;\nchomp $input;\nmy ($a, $b, $t) = split / /, $input;\n$ans = int($t / $a) * $b;\nprint \"$ans\";\n", "language": "Perl", "metadata": {"date": 1557385216, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "low_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/Perl/s472055029.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s472055029", "user_id": "u056486147"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "my $input = ;\nchomp $input;\nmy ($a, $b, $t) = split / /, $input;\n$ans = int($t / $a) * $b;\nprint \"$ans\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 112, "cpu_time_ms": 5, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s196454570", "group_id": "codeNet:p03060", "input_text": "my $n = ;\n@V = split / /,;\n@C = split / /,;\n\nfor ($i = 0;$i < $n;$i++){\n $sum+=$V[$i]-$C[$i] if($V[$i]>$C[$i]);\n}\nprint (\"$sum\");", "language": "Perl", "metadata": {"date": 1557518553, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03060.html", "problem_id": "p03060", "resource_group": "low_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/Perl/s196454570.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s196454570", "user_id": "u573154728"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "my $n = ;\n@V = split / /,;\n@C = split / /,;\n\nfor ($i = 0;$i < $n;$i++){\n $sum+=$V[$i]-$C[$i] if($V[$i]>$C[$i]);\n}\nprint (\"$sum\");", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s686667063", "group_id": "codeNet:p03060", "input_text": "say sum (!get)Xmax[Z-] lines>>.words", "language": "Perl", "metadata": {"date": 1556413764, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03060.html", "problem_id": "p03060", "resource_group": "low_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/Perl/s686667063.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s686667063", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "say sum (!get)Xmax[Z-] lines>>.words", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 302, "memory_kb": 64624}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s590967553", "group_id": "codeNet:p03063", "input_text": "<>;@@=map/#/,@_=<>=~/./g;printf sort{$a-$b}map+($S+=/\\./)+($T+=pop@@),0,@_", "language": "Perl", "metadata": {"date": 1555818176, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03063.html", "problem_id": "p03063", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03063/input.txt", "sample_output_relpath": "derived/input_output/data/p03063/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03063/Perl/s590967553.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s590967553", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>;@@=map/#/,@_=<>=~/./g;printf sort{$a-$b}map+($S+=/\\./)+($T+=pop@@),0,@_", "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": "p03063", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 201, "memory_kb": 58828}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s767118664", "group_id": "codeNet:p03068", "input_text": "<>;($_,pos)=<>;/.\\G/;s/[^$&\n]/*/g;print", "language": "Perl", "metadata": {"date": 1556066763, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03068.html", "problem_id": "p03068", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03068/input.txt", "sample_output_relpath": "derived/input_output/data/p03068/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03068/Perl/s767118664.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s767118664", "user_id": "u700849772"}, "prompt_components": {"gold_output": "*rr*r\n", "input_to_evaluate": "<>;($_,pos)=<>;/.\\G/;s/[^$&\n]/*/g;print", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "sample_input": "5\nerror\n2\n"}, "reference_outputs": ["*rr*r\n"], "source_document_id": "p03068", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s719412190", "group_id": "codeNet:p03071", "input_text": "say [+] (get.words X-0,1).sort[2,3]", "language": "Perl", "metadata": {"date": 1555184823, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "low_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/Perl/s719412190.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s719412190", "user_id": "u283869437"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "say [+] (get.words X-0,1).sort[2,3]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 35, "cpu_time_ms": 287, "memory_kb": 64496}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s393896961", "group_id": "codeNet:p03072", "input_text": "$n = <>;\n@H = split / /,<>;\nchomp @H;\n$min=-1;\n$c=0;\nfor(my $i=0;$i<$n;$i++){\n if($H[$i]>$min){\n $c++;\n $min=$H[$i];\n }\n}\nprint \"$c\";", "language": "Perl", "metadata": {"date": 1557838215, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03072.html", "problem_id": "p03072", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03072/input.txt", "sample_output_relpath": "derived/input_output/data/p03072/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03072/Perl/s393896961.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s393896961", "user_id": "u573154728"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$n = <>;\n@H = split / /,<>;\nchomp @H;\n$min=-1;\n$c=0;\nfor(my $i=0;$i<$n;$i++){\n if($H[$i]>$min){\n $c++;\n $min=$H[$i];\n }\n}\nprint \"$c\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\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 number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "sample_input": "4\n6 5 6 8\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03072", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\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 number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s164593438", "group_id": "codeNet:p03072", "input_text": "my ($n) = split(/\\s+/, );\nmy (@h) = split(/\\s+/, );\n\nmy $val = 0;\nmy $max = 0;\nfor my $i (@h) {\n if ($max <= $i) {\n\t$max = $i;\n\t$val++;\n }\n}\nprint $val, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1555182818, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03072.html", "problem_id": "p03072", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03072/input.txt", "sample_output_relpath": "derived/input_output/data/p03072/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03072/Perl/s164593438.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s164593438", "user_id": "u996239623"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my ($n) = split(/\\s+/, );\nmy (@h) = split(/\\s+/, );\n\nmy $val = 0;\nmy $max = 0;\nfor my $i (@h) {\n if ($max <= $i) {\n\t$max = $i;\n\t$val++;\n }\n}\nprint $val, \"\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\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 number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "sample_input": "4\n6 5 6 8\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03072", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\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 number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s072333023", "group_id": "codeNet:p03072", "input_text": "my $n = ;\nmy @heights = split / /, ;\nmy $base_height = $heights[0] + 0;\nmy $count = 0;\nfor my $h (@heights) {\n\tif ($base_height <= $h) {\n \t$count++;\n }\n}\nprint $count, \"\\n\";", "language": "Perl", "metadata": {"date": 1555182731, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03072.html", "problem_id": "p03072", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03072/input.txt", "sample_output_relpath": "derived/input_output/data/p03072/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03072/Perl/s072333023.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s072333023", "user_id": "u706084687"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my $n = ;\nmy @heights = split / /, ;\nmy $base_height = $heights[0] + 0;\nmy $count = 0;\nfor my $h (@heights) {\n\tif ($base_height <= $h) {\n \t$count++;\n }\n}\nprint $count, \"\\n\";", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\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 number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "sample_input": "4\n6 5 6 8\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03072", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\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 number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s201118685", "group_id": "codeNet:p03073", "input_text": "chomp($s = <>);\n\n$ans1 = 0;\n$ans2 = 0;\n\n$len = length($s);\n\nfor($i = 0; $i < $len; $i++){\n # $s1 = substr($s, $i, 1);\n print\"$s1\\n\";\n if($s1 eq \"0\" and $i % 2 == 0 or\n $s1 eq \"1\" and $i % 2 == 1){\n $ans1++;\n }else{\n $ans2++;\n }\n}\n\n# print \"$ans1 $ans2\\n\";\n\n$ans = min($ans1, $ans2);\n\nprint \"$ans\\n\";\n\nsub max(){\n my($a) = $_[0];\n my($b) = $_[1];\n if($a > $b){\n $a;\n }else{\n $b;\n }\n}\n\nsub min(){\n my($a) = $_[0];\n my($b) = $_[1];\n if($a > $b){\n $b;\n }else{\n $a;\n }\n}\n", "language": "Perl", "metadata": {"date": 1556391494, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03073.html", "problem_id": "p03073", "resource_group": "low_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/Perl/s201118685.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s201118685", "user_id": "u793807135"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "chomp($s = <>);\n\n$ans1 = 0;\n$ans2 = 0;\n\n$len = length($s);\n\nfor($i = 0; $i < $len; $i++){\n # $s1 = substr($s, $i, 1);\n print\"$s1\\n\";\n if($s1 eq \"0\" and $i % 2 == 0 or\n $s1 eq \"1\" and $i % 2 == 1){\n $ans1++;\n }else{\n $ans2++;\n }\n}\n\n# print \"$ans1 $ans2\\n\";\n\n$ans = min($ans1, $ans2);\n\nprint \"$ans\\n\";\n\nsub max(){\n my($a) = $_[0];\n my($b) = $_[1];\n if($a > $b){\n $a;\n }else{\n $b;\n }\n}\n\nsub min(){\n my($a) = $_[0];\n my($b) = $_[1];\n if($a > $b){\n $b;\n }else{\n $a;\n }\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 47, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s528073578", "group_id": "codeNet:p03073", "input_text": "$#{$_^--$|}++for<>=~/./g;print~~@{0|@1<@0}", "language": "Perl", "metadata": {"date": 1555189190, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03073.html", "problem_id": "p03073", "resource_group": "low_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/Perl/s528073578.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s528073578", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$#{$_^--$|}++for<>=~/./g;print~~@{0|@1<@0}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 95, "memory_kb": 12544}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s838643824", "group_id": "codeNet:p03074", "input_text": "use List::Util qw(max sum);\nmy ($n, $k) = split(/\\s+/, <>);\nmy ($s) = split(/\\s+/, <>);\n\nmy (@counts) = ();\n\nmy $len = length($s);\nmy $bit = 1;\nmy $c = 0;\nfor (my $i=0; $i<$len; $i++) {\n #print substr($s, $i, 1), \"\\n\";\n if (substr($s, $i, 1) == $bit) {\n\t$c++;\n } else {\n\tpush @counts, $c;\n\t$bit = 1-$bit;\n\t$c = 1;\n }\n}\npush @counts, $c;\n$len = @counts;\npush @counts, 0 for (0..$k*2+1);\nprint \"$len, \", join(\" \", @counts), \"\\n\";\n\nmy $sum = sum(@counts[0..$k*2]);\nmy $max = $sum;\nfor (my $out=0,$in=$k*2+1; $out<$len; $in+=2,$out+=2) {\n $sum += $counts[$in]+$counts[$in+1] - $counts[$out]-$counts[$out+1];\n $max = max($max, $sum);\n}\nprint \"$max\\n\";\n", "language": "Perl", "metadata": {"date": 1555282633, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "low_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/Perl/s838643824.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s838643824", "user_id": "u996239623"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use List::Util qw(max sum);\nmy ($n, $k) = split(/\\s+/, <>);\nmy ($s) = split(/\\s+/, <>);\n\nmy (@counts) = ();\n\nmy $len = length($s);\nmy $bit = 1;\nmy $c = 0;\nfor (my $i=0; $i<$len; $i++) {\n #print substr($s, $i, 1), \"\\n\";\n if (substr($s, $i, 1) == $bit) {\n\t$c++;\n } else {\n\tpush @counts, $c;\n\t$bit = 1-$bit;\n\t$c = 1;\n }\n}\npush @counts, $c;\n$len = @counts;\npush @counts, 0 for (0..$k*2+1);\nprint \"$len, \", join(\" \", @counts), \"\\n\";\n\nmy $sum = sum(@counts[0..$k*2]);\nmy $max = $sum;\nfor (my $out=0,$in=$k*2+1; $out<$len; $in+=2,$out+=2) {\n $sum += $counts[$in]+$counts[$in+1] - $counts[$out]-$counts[$out+1];\n $max = max($max, $sum);\n}\nprint \"$max\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 667, "cpu_time_ms": 101, "memory_kb": 27008}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s172341984", "group_id": "codeNet:p03074", "input_text": "$a[($S[@S]=$S+=y///c)-$S[$-=-$k---/1/]]=0for$k=$'<<<>=~$\",<>=~/1+|0+/g;print$#a", "language": "Perl", "metadata": {"date": 1555196367, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "low_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/Perl/s172341984.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s172341984", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$a[($S[@S]=$S+=y///c)-$S[$-=-$k---/1/]]=0for$k=$'<<<>=~$\",<>=~/1+|0+/g;print$#a", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 79, "cpu_time_ms": 110, "memory_kb": 14052}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s713155216", "group_id": "codeNet:p03074", "input_text": "$a[($S[$i]=$S+=y///c)-$S[$-=$i++-$k-/1/]]=0for$k=$'<<<>=~$\",<>=~/1+|0+/g;print$#a", "language": "Perl", "metadata": {"date": 1555195043, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "low_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/Perl/s713155216.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s713155216", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$a[($S[$i]=$S+=y///c)-$S[$-=$i++-$k-/1/]]=0for$k=$'<<<>=~$\",<>=~/1+|0+/g;print$#a", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 109, "memory_kb": 14080}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s450807888", "group_id": "codeNet:p03074", "input_text": "$a[($S[$i]=$S+=y///c)-$S[$-=$i++-$k-/^1/]]=0for$k=$'<<<>=~$\",<>=~/1+|0+/g;print$#a", "language": "Perl", "metadata": {"date": 1555194583, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "low_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/Perl/s450807888.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s450807888", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$a[($S[$i]=$S+=y///c)-$S[$-=$i++-$k-/^1/]]=0for$k=$'<<<>=~$\",<>=~/1+|0+/g;print$#a", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 105, "memory_kb": 14080}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s487172824", "group_id": "codeNet:p03074", "input_text": "use strict;\nuse warnings;\nuse utf8;\n\nmy ($N, $K) = split /\\s/, ;\nmy ($S) = split /\\s/, ;\nmy (@S) = split //, $S;\nuse Data::Dumper;\n#print Dumper \\@S;\n\n# 0 が始まる位置を index として、何個連なるかを要素で持つ\nmy @array;\n\nmy $current = $S[0];\nmy $mode = $current eq 1 ? 1 : 0;\n\nmy @ans;\nmy $cnt = 0;\n\nfor (my $i = 0; $i < @S; $i++) {\n if ($S[$i] eq $current) {\n $cnt++;\n } else {\n if ($S[$i] eq 0) {\n push @array, $cnt;\n } else {\n push @array, -$cnt;\n }\n $current = $S[$i];\n $cnt = 1;\n }\n}\nif ($cnt > 0) {\n if ($current eq 0) {\n push @array, -$cnt;\n } else {\n push @array, $cnt;\n }\n}\n\n\nmy $kk = $K * 2 + ($current eq 1 ? 1 : 0);\nmy $kkk = $kk;\nmy $ans = 0;\nmy $max = 0;\nmy $cur = 0;\n\nmy $dust = $current eq 1 ? $array[0] - $array[1] : -$array[0];\nfor (my $i = 0; $i < $kk; $i++) {\n if ($i < @array) {\n $cur += 0 < $array[$i] ? $array[$i] : -$array[$i];\n }\n}\n\n#print Dumper \\@array;\n#printf \"%s\\n\", $cur;\n$max = $cur;\n\nfor (my $i = $kk; $i < @array; $i += 2) {\n $cur -= $array[$i];\n if ($i + 1 < @array) {\n $cur += $array[$i+1];\n }\n $cur -= $dust;\n #printf \"%s\\n\", $cur;\n if ($max < $cur) {\n $max = $cur;\n }\n\n #printf \"@ %s\\n\", join \" \", $i, $i - $kk + 2, $kk, scalar(@array);\n $dust = $array[$i - $kk + 2];\n $dust -= defined $array[$i - $kk + 1 + 2] ? $array[$i - $kk + 1 + 2] : 0;\n}\n\nprintf \"%s\\n\", $max;\n", "language": "Perl", "metadata": {"date": 1555187747, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "low_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/Perl/s487172824.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s487172824", "user_id": "u720452274"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\n\nmy ($N, $K) = split /\\s/, ;\nmy ($S) = split /\\s/, ;\nmy (@S) = split //, $S;\nuse Data::Dumper;\n#print Dumper \\@S;\n\n# 0 が始まる位置を index として、何個連なるかを要素で持つ\nmy @array;\n\nmy $current = $S[0];\nmy $mode = $current eq 1 ? 1 : 0;\n\nmy @ans;\nmy $cnt = 0;\n\nfor (my $i = 0; $i < @S; $i++) {\n if ($S[$i] eq $current) {\n $cnt++;\n } else {\n if ($S[$i] eq 0) {\n push @array, $cnt;\n } else {\n push @array, -$cnt;\n }\n $current = $S[$i];\n $cnt = 1;\n }\n}\nif ($cnt > 0) {\n if ($current eq 0) {\n push @array, -$cnt;\n } else {\n push @array, $cnt;\n }\n}\n\n\nmy $kk = $K * 2 + ($current eq 1 ? 1 : 0);\nmy $kkk = $kk;\nmy $ans = 0;\nmy $max = 0;\nmy $cur = 0;\n\nmy $dust = $current eq 1 ? $array[0] - $array[1] : -$array[0];\nfor (my $i = 0; $i < $kk; $i++) {\n if ($i < @array) {\n $cur += 0 < $array[$i] ? $array[$i] : -$array[$i];\n }\n}\n\n#print Dumper \\@array;\n#printf \"%s\\n\", $cur;\n$max = $cur;\n\nfor (my $i = $kk; $i < @array; $i += 2) {\n $cur -= $array[$i];\n if ($i + 1 < @array) {\n $cur += $array[$i+1];\n }\n $cur -= $dust;\n #printf \"%s\\n\", $cur;\n if ($max < $cur) {\n $max = $cur;\n }\n\n #printf \"@ %s\\n\", join \" \", $i, $i - $kk + 2, $kk, scalar(@array);\n $dust = $array[$i - $kk + 2];\n $dust -= defined $array[$i - $kk + 1 + 2] ? $array[$i - $kk + 1 + 2] : 0;\n}\n\nprintf \"%s\\n\", $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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 134, "memory_kb": 16384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s136140005", "group_id": "codeNet:p03074", "input_text": "my ($n, $k) = split / /, <>;\nmy $s = <>;\nchomp $s;\n\nmy(@l);\n\nmy $c = 0;\nmy $now = 1;\n\nfor(my $i = 0; $i < length $s; $i++){\n if(substr($s, $i, 1) == $now){\n $c++;\n } else {\n push @l, $c;\n $now = 1 - $now;\n $c = 1;\n }\n}\n\npush @l, $c;\n\nmy $max = 0;\n\nfor(my $i = 0; $i < $k * 2 + 1; $i++){\n $max += $l[$i];\n}\n\nmy $nowx = $max;\n\nfor(my $ex = 0, $in = $k * 2 + 1; $in <= $#l; $ex+=2, $in+=2){\n my $newnow = $nowx - $l[$ex] - $l[$ex+1] + $l[$in] + $l[$in+1];\n if($newnow > $max){$max = $newnow;}\n $nowx = $newnow;\n}\n\nprint $max;\n", "language": "Perl", "metadata": {"date": 1555186434, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "low_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/Perl/s136140005.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s136140005", "user_id": "u596759703"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "my ($n, $k) = split / /, <>;\nmy $s = <>;\nchomp $s;\n\nmy(@l);\n\nmy $c = 0;\nmy $now = 1;\n\nfor(my $i = 0; $i < length $s; $i++){\n if(substr($s, $i, 1) == $now){\n $c++;\n } else {\n push @l, $c;\n $now = 1 - $now;\n $c = 1;\n }\n}\n\npush @l, $c;\n\nmy $max = 0;\n\nfor(my $i = 0; $i < $k * 2 + 1; $i++){\n $max += $l[$i];\n}\n\nmy $nowx = $max;\n\nfor(my $ex = 0, $in = $k * 2 + 1; $in <= $#l; $ex+=2, $in+=2){\n my $newnow = $nowx - $l[$ex] - $l[$ex+1] + $l[$in] + $l[$in+1];\n if($newnow > $max){$max = $newnow;}\n $nowx = $newnow;\n}\n\nprint $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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 73, "memory_kb": 3712}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s542646390", "group_id": "codeNet:p03076", "input_text": "$/=$_=+<,[@_=<>=~/./sg]){map$x+=/$_[$x] L/-/$_[$x-1] R/,`tac`}print$R-$L", "language": "Perl", "metadata": {"date": 1554129021, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03081.html", "problem_id": "p03081", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03081/input.txt", "sample_output_relpath": "derived/input_output/data/p03081/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03081/Perl/s981438309.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s981438309", "user_id": "u700849772"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "for$x($L,$R=<>,[@_=<>=~/./sg]){map$x+=/$_[$x] L/-/$_[$x-1] R/,`tac`}print$R-$L", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N squares numbered 1 to N from left to right.\nEach square has a character written on it, and Square i has a letter s_i. Besides, there is initially one golem on each square.\n\nSnuke cast Q spells to move the golems.\n\nThe i-th spell consisted of two characters t_i and d_i, where d_i is L or R.\nWhen Snuke cast this spell, for each square with the character t_i, all golems on that square moved to the square adjacent to the left if d_i is L, and moved to the square adjacent to the right if d_i is R.\n\nHowever, when a golem tried to move left from Square 1 or move right from Square N, it disappeared.\n\nFind the number of golems remaining after Snuke cast the Q spells.\n\nConstraints\n\n1 \\leq N,Q \\leq 2 \\times 10^{5}\n\n|s| = N\n\ns_i and t_i are uppercase English letters.\n\nd_i is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\ns\nt_1 d_1\n\\vdots\nt_{Q} d_Q\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 4\nABC\nA L\nB L\nB R\nA R\n\nSample Output 1\n\n2\n\nInitially, there is one golem on each square.\n\nIn the first spell, the golem on Square 1 tries to move left and disappears.\n\nIn the second spell, the golem on Square 2 moves left.\n\nIn the third spell, no golem moves.\n\nIn the fourth spell, the golem on Square 1 moves right.\n\nAfter the four spells are cast, there is one golem on Square 2 and one golem on Square 3, for a total of two golems remaining.\n\nSample Input 2\n\n8 3\nAABCBDBA\nA L\nB R\nA R\n\nSample Output 2\n\n5\n\nAfter the three spells are cast, there is one golem on Square 2, two golems on Square 4 and two golems on Square 6, for a total of five golems remaining.\n\nNote that a single spell may move multiple golems.\n\nSample Input 3\n\n10 15\nSNCZWRCEWB\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nS L\n\nSample Output 3\n\n3", "sample_input": "3 4\nABC\nA L\nB L\nB R\nA R\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03081", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N squares numbered 1 to N from left to right.\nEach square has a character written on it, and Square i has a letter s_i. Besides, there is initially one golem on each square.\n\nSnuke cast Q spells to move the golems.\n\nThe i-th spell consisted of two characters t_i and d_i, where d_i is L or R.\nWhen Snuke cast this spell, for each square with the character t_i, all golems on that square moved to the square adjacent to the left if d_i is L, and moved to the square adjacent to the right if d_i is R.\n\nHowever, when a golem tried to move left from Square 1 or move right from Square N, it disappeared.\n\nFind the number of golems remaining after Snuke cast the Q spells.\n\nConstraints\n\n1 \\leq N,Q \\leq 2 \\times 10^{5}\n\n|s| = N\n\ns_i and t_i are uppercase English letters.\n\nd_i is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\ns\nt_1 d_1\n\\vdots\nt_{Q} d_Q\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 4\nABC\nA L\nB L\nB R\nA R\n\nSample Output 1\n\n2\n\nInitially, there is one golem on each square.\n\nIn the first spell, the golem on Square 1 tries to move left and disappears.\n\nIn the second spell, the golem on Square 2 moves left.\n\nIn the third spell, no golem moves.\n\nIn the fourth spell, the golem on Square 1 moves right.\n\nAfter the four spells are cast, there is one golem on Square 2 and one golem on Square 3, for a total of two golems remaining.\n\nSample Input 2\n\n8 3\nAABCBDBA\nA L\nB R\nA R\n\nSample Output 2\n\n5\n\nAfter the three spells are cast, there is one golem on Square 2, two golems on Square 4 and two golems on Square 6, for a total of five golems remaining.\n\nNote that a single spell may move multiple golems.\n\nSample Input 3\n\n10 15\nSNCZWRCEWB\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nS L\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1362, "memory_kb": 73328}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s978115270", "group_id": "codeNet:p03085", "input_text": "my %dna = ;\n%dna{get}.say;", "language": "Perl", "metadata": {"date": 1556297669, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "low_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/Perl/s978115270.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s978115270", "user_id": "u390181802"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "my %dna = ;\n%dna{get}.say;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 309, "memory_kb": 63732}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s576855922", "group_id": "codeNet:p03085", "input_text": "my $string = <>;\nchomp $string;\nmy %hash = (\n A => 'T',\n T => 'A',\n G => 'C',\n C => 'G',\n);\n\nprint $hash{$string};", "language": "Perl", "metadata": {"date": 1553457803, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "low_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/Perl/s576855922.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s576855922", "user_id": "u512301216"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "my $string = <>;\nchomp $string;\nmy %hash = (\n A => 'T',\n T => 'A',\n G => 'C',\n C => 'G',\n);\n\nprint $hash{$string};", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s121615670", "group_id": "codeNet:p03087", "input_text": "@_=!<>;$_[@_]=$t+=/C/&$p=~A,$p=$_ for<>=~/./g;/ /,print$_[$']-$_[$`],$/for<>", "language": "Perl", "metadata": {"date": 1553461454, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03087.html", "problem_id": "p03087", "resource_group": "low_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/Perl/s121615670.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s121615670", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n0\n3\n", "input_to_evaluate": "@_=!<>;$_[@_]=$t+=/C/&$p=~A,$p=$_ for<>=~/./g;/ /,print$_[$']-$_[$`],$/for<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 228, "memory_kb": 19200}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s205583218", "group_id": "codeNet:p03088", "input_text": "map{/132|1.?2.?3|213|[4-9]/or$$i[$_/10]+=$s=$I[$_%$<]%=$%=1e9+7,$I+=$s}(*I=$i--)..4e3for(@I=1)..<>;print$I%$%", "language": "Perl", "metadata": {"date": 1553557025, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03088.html", "problem_id": "p03088", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03088/input.txt", "sample_output_relpath": "derived/input_output/data/p03088/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03088/Perl/s205583218.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s205583218", "user_id": "u657913472"}, "prompt_components": {"gold_output": "61\n", "input_to_evaluate": "map{/132|1.?2.?3|213|[4-9]/or$$i[$_/10]+=$s=$I[$_%$<]%=$%=1e9+7,$I+=$s}(*I=$i--)..4e3for(@I=1)..<>;print$I%$%", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "sample_input": "3\n"}, "reference_outputs": ["61\n"], "source_document_id": "p03088", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s540826443", "group_id": "codeNet:p03088", "input_text": "map$$i+=/3$/*((${$_/10|0}[-$i]+=!/102|1.?2.?0|210|[4-9]/*${$_%$<}[~$i])%=$%=1e9+7),--$i..4e3for(@333=1)..<>;print$$i%$%", "language": "Perl", "metadata": {"date": 1553525090, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03088.html", "problem_id": "p03088", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03088/input.txt", "sample_output_relpath": "derived/input_output/data/p03088/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03088/Perl/s540826443.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s540826443", "user_id": "u657913472"}, "prompt_components": {"gold_output": "61\n", "input_to_evaluate": "map$$i+=/3$/*((${$_/10|0}[-$i]+=!/102|1.?2.?0|210|[4-9]/*${$_%$<}[~$i])%=$%=1e9+7),--$i..4e3for(@333=1)..<>;print$$i%$%", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "sample_input": "3\n"}, "reference_outputs": ["61\n"], "source_document_id": "p03088", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 880, "memory_kb": 2816}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s697324483", "group_id": "codeNet:p03088", "input_text": "$x=!++$i,map$x+=/^D/*((${/./;$'}[$i]+=!/ABC|A.*C.*B|CAB/*${/.$/;$`}[-2])%=$%=1e9+7),glob'{A,B,C,D}'x4for(@DDD=1)..<>;print$x%$%", "language": "Perl", "metadata": {"date": 1553471317, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03088.html", "problem_id": "p03088", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03088/input.txt", "sample_output_relpath": "derived/input_output/data/p03088/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03088/Perl/s697324483.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s697324483", "user_id": "u283869437"}, "prompt_components": {"gold_output": "61\n", "input_to_evaluate": "$x=!++$i,map$x+=/^D/*((${/./;$'}[$i]+=!/ABC|A.*C.*B|CAB/*${/.$/;$`}[-2])%=$%=1e9+7),glob'{A,B,C,D}'x4for(@DDD=1)..<>;print$x%$%", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "sample_input": "3\n"}, "reference_outputs": ["61\n"], "source_document_id": "p03088", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 127, "cpu_time_ms": 92, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s727350625", "group_id": "codeNet:p03088", "input_text": "@{$_ x3}=1for A..D;for$i(1..<>-1){$x=0;for$j(glob'{A,B,C,D}'x3){$j=~/../,($$j[$i]+=\"$_$j\"!~/ABC|A.*C.*B|CAB/&&${$_.$&}[$i-1])%=$%=1e9+7for A..D;$x+=$$j[-1]}}print$x%$%", "language": "Perl", "metadata": {"date": 1553468178, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03088.html", "problem_id": "p03088", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03088/input.txt", "sample_output_relpath": "derived/input_output/data/p03088/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03088/Perl/s727350625.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s727350625", "user_id": "u283869437"}, "prompt_components": {"gold_output": "61\n", "input_to_evaluate": "@{$_ x3}=1for A..D;for$i(1..<>-1){$x=0;for$j(glob'{A,B,C,D}'x3){$j=~/../,($$j[$i]+=\"$_$j\"!~/ABC|A.*C.*B|CAB/&&${$_.$&}[$i-1])%=$%=1e9+7for A..D;$x+=$$j[-1]}}print$x%$%", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "sample_input": "3\n"}, "reference_outputs": ["61\n"], "source_document_id": "p03088", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n\nThe string does not contain characters other than A, C, G and T.\n\nThe string does not contain AGC as a substring.\n\nThe condition above cannot be violated by swapping two adjacent characters once.\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\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of strings of length N that satisfy the following conditions, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n61\n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other than A, C, G and T. Among them, only AGC, ACG and GAC violate the condition, so the answer is 64 - 3 = 61.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n230\n\nSample Input 3\n\n100\n\nSample Output 3\n\n388130742\n\nBe sure to print the number of strings modulo 10^9+7.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 167, "cpu_time_ms": 69, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s707963743", "group_id": "codeNet:p03089", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nchomp (my @b = split / /, );\n@b = sort {$a <=> $b} @b;\nmy @a;\nfor my $i (0..$n-1) {\n if (0 <= $b[$i] && $b[$i] <= $i + 1) {\n splice @a, $i, 0, $b[$i];\n }\n}\nif ($n == @a) {\n say $_ for @a;\n} else {\n say -1;\n}", "language": "Perl", "metadata": {"date": 1586368718, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03089.html", "problem_id": "p03089", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03089/input.txt", "sample_output_relpath": "derived/input_output/data/p03089/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03089/Perl/s707963743.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s707963743", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n1\n2\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nchomp (my @b = split / /, );\n@b = sort {$a <=> $b} @b;\nmy @a;\nfor my $i (0..$n-1) {\n if (0 <= $b[$i] && $b[$i] <= $i + 1) {\n splice @a, $i, 0, $b[$i];\n }\n}\nif ($n == @a) {\n say $_ for @a;\n} else {\n say -1;\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has an empty sequence a.\n\nHe will perform N operations on this sequence.\n\nIn the i-th operation, he chooses an integer j satisfying 1 \\leq j \\leq i, and insert j at position j in a (the beginning is position 1).\n\nYou are given a sequence b of length N. Determine if it is possible that a is equal to b after N operations. If it is, show one possible sequence of operations that achieves it.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq b_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nb_1 \\dots b_N\n\nOutput\n\nIf there is no sequence of N operations after which a would be equal to b, print -1.\nIf there is, print N lines. In the i-th line, the integer chosen in the i-th operation should be printed. If there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n3\n1 2 1\n\nSample Output 1\n\n1\n1\n2\n\nIn this sequence of operations, the sequence a changes as follows:\n\nAfter the first operation: (1)\n\nAfter the second operation: (1,1)\n\nAfter the third operation: (1,2,1)\n\nSample Input 2\n\n2\n2 2\n\nSample Output 2\n\n-1\n\n2 cannot be inserted at the beginning of the sequence, so this is impossible.\n\nSample Input 3\n\n9\n1 1 1 2 2 1 2 3 2\n\nSample Output 3\n\n1\n2\n2\n3\n1\n2\n2\n1\n1", "sample_input": "3\n1 2 1\n"}, "reference_outputs": ["1\n1\n2\n"], "source_document_id": "p03089", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has an empty sequence a.\n\nHe will perform N operations on this sequence.\n\nIn the i-th operation, he chooses an integer j satisfying 1 \\leq j \\leq i, and insert j at position j in a (the beginning is position 1).\n\nYou are given a sequence b of length N. Determine if it is possible that a is equal to b after N operations. If it is, show one possible sequence of operations that achieves it.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq b_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nb_1 \\dots b_N\n\nOutput\n\nIf there is no sequence of N operations after which a would be equal to b, print -1.\nIf there is, print N lines. In the i-th line, the integer chosen in the i-th operation should be printed. If there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n3\n1 2 1\n\nSample Output 1\n\n1\n1\n2\n\nIn this sequence of operations, the sequence a changes as follows:\n\nAfter the first operation: (1)\n\nAfter the second operation: (1,1)\n\nAfter the third operation: (1,2,1)\n\nSample Input 2\n\n2\n2 2\n\nSample Output 2\n\n-1\n\n2 cannot be inserted at the beginning of the sequence, so this is impossible.\n\nSample Input 3\n\n9\n1 1 1 2 2 1 2 3 2\n\nSample Output 3\n\n1\n2\n2\n3\n1\n2\n2\n1\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 337, "cpu_time_ms": 5, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s184644474", "group_id": "codeNet:p03089", "input_text": "@_=!<>;splice@_,$_,0,$_--for glob<>;print@_[-1]?-1:\"@_\"", "language": "Perl", "metadata": {"date": 1553390022, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03089.html", "problem_id": "p03089", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03089/input.txt", "sample_output_relpath": "derived/input_output/data/p03089/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03089/Perl/s184644474.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s184644474", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n1\n2\n", "input_to_evaluate": "@_=!<>;splice@_,$_,0,$_--for glob<>;print@_[-1]?-1:\"@_\"", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has an empty sequence a.\n\nHe will perform N operations on this sequence.\n\nIn the i-th operation, he chooses an integer j satisfying 1 \\leq j \\leq i, and insert j at position j in a (the beginning is position 1).\n\nYou are given a sequence b of length N. Determine if it is possible that a is equal to b after N operations. If it is, show one possible sequence of operations that achieves it.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq b_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nb_1 \\dots b_N\n\nOutput\n\nIf there is no sequence of N operations after which a would be equal to b, print -1.\nIf there is, print N lines. In the i-th line, the integer chosen in the i-th operation should be printed. If there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n3\n1 2 1\n\nSample Output 1\n\n1\n1\n2\n\nIn this sequence of operations, the sequence a changes as follows:\n\nAfter the first operation: (1)\n\nAfter the second operation: (1,1)\n\nAfter the third operation: (1,2,1)\n\nSample Input 2\n\n2\n2 2\n\nSample Output 2\n\n-1\n\n2 cannot be inserted at the beginning of the sequence, so this is impossible.\n\nSample Input 3\n\n9\n1 1 1 2 2 1 2 3 2\n\nSample Output 3\n\n1\n2\n2\n3\n1\n2\n2\n1\n1", "sample_input": "3\n1 2 1\n"}, "reference_outputs": ["1\n1\n2\n"], "source_document_id": "p03089", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has an empty sequence a.\n\nHe will perform N operations on this sequence.\n\nIn the i-th operation, he chooses an integer j satisfying 1 \\leq j \\leq i, and insert j at position j in a (the beginning is position 1).\n\nYou are given a sequence b of length N. Determine if it is possible that a is equal to b after N operations. If it is, show one possible sequence of operations that achieves it.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq b_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nb_1 \\dots b_N\n\nOutput\n\nIf there is no sequence of N operations after which a would be equal to b, print -1.\nIf there is, print N lines. In the i-th line, the integer chosen in the i-th operation should be printed. If there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n3\n1 2 1\n\nSample Output 1\n\n1\n1\n2\n\nIn this sequence of operations, the sequence a changes as follows:\n\nAfter the first operation: (1)\n\nAfter the second operation: (1,1)\n\nAfter the third operation: (1,2,1)\n\nSample Input 2\n\n2\n2 2\n\nSample Output 2\n\n-1\n\n2 cannot be inserted at the beginning of the sequence, so this is impossible.\n\nSample Input 3\n\n9\n1 1 1 2 2 1 2 3 2\n\nSample Output 3\n\n1\n2\n2\n3\n1\n2\n2\n1\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 55, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s091863216", "group_id": "codeNet:p03089", "input_text": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @b = map { $_ - 0 } split(/\\s+/,);\n\nmy %cnt = ();\nforeach my $b (@b){\n $cnt{$b} ++;\n}\n\nforeach my $c (keys %cnt){\n if( $cnt{$c} > $n + 1 - ( $c - 0 ) ){\n print \"-1\\n\"; exit(0);\n }\n}\n\nmy @bb = @b;\nmy @op = ();\nmy $cl = $n;\nfor(my $i=0;$i<$n;$i++){\n my $j;\n for($j=$cl;$j>0;$j--){\n last if $bb[$j - 1] == $j;\n }\n if( $j<=0 ){\n print \"-1\\n\"; exit(0);\n }\n unshift(@op,$j);\n my @newbb = ();\n push(@newbb,@bb[0..($j-2)]) if $j>1;\n push(@newbb,@bb[$j..($cl-1)]) if $j<$cl;\n @bb = (@newbb);\n $cl--;\n}\nfor(my $i=0;$i<$n;$i++){\n print \"$op[$i]\\n\";\n}\n\nexit(0);\n\n", "language": "Perl", "metadata": {"date": 1553376607, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03089.html", "problem_id": "p03089", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03089/input.txt", "sample_output_relpath": "derived/input_output/data/p03089/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03089/Perl/s091863216.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s091863216", "user_id": "u750383873"}, "prompt_components": {"gold_output": "1\n1\n2\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\nmy @b = map { $_ - 0 } split(/\\s+/,);\n\nmy %cnt = ();\nforeach my $b (@b){\n $cnt{$b} ++;\n}\n\nforeach my $c (keys %cnt){\n if( $cnt{$c} > $n + 1 - ( $c - 0 ) ){\n print \"-1\\n\"; exit(0);\n }\n}\n\nmy @bb = @b;\nmy @op = ();\nmy $cl = $n;\nfor(my $i=0;$i<$n;$i++){\n my $j;\n for($j=$cl;$j>0;$j--){\n last if $bb[$j - 1] == $j;\n }\n if( $j<=0 ){\n print \"-1\\n\"; exit(0);\n }\n unshift(@op,$j);\n my @newbb = ();\n push(@newbb,@bb[0..($j-2)]) if $j>1;\n push(@newbb,@bb[$j..($cl-1)]) if $j<$cl;\n @bb = (@newbb);\n $cl--;\n}\nfor(my $i=0;$i<$n;$i++){\n print \"$op[$i]\\n\";\n}\n\nexit(0);\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has an empty sequence a.\n\nHe will perform N operations on this sequence.\n\nIn the i-th operation, he chooses an integer j satisfying 1 \\leq j \\leq i, and insert j at position j in a (the beginning is position 1).\n\nYou are given a sequence b of length N. Determine if it is possible that a is equal to b after N operations. If it is, show one possible sequence of operations that achieves it.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq b_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nb_1 \\dots b_N\n\nOutput\n\nIf there is no sequence of N operations after which a would be equal to b, print -1.\nIf there is, print N lines. In the i-th line, the integer chosen in the i-th operation should be printed. If there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n3\n1 2 1\n\nSample Output 1\n\n1\n1\n2\n\nIn this sequence of operations, the sequence a changes as follows:\n\nAfter the first operation: (1)\n\nAfter the second operation: (1,1)\n\nAfter the third operation: (1,2,1)\n\nSample Input 2\n\n2\n2 2\n\nSample Output 2\n\n-1\n\n2 cannot be inserted at the beginning of the sequence, so this is impossible.\n\nSample Input 3\n\n9\n1 1 1 2 2 1 2 3 2\n\nSample Output 3\n\n1\n2\n2\n3\n1\n2\n2\n1\n1", "sample_input": "3\n1 2 1\n"}, "reference_outputs": ["1\n1\n2\n"], "source_document_id": "p03089", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has an empty sequence a.\n\nHe will perform N operations on this sequence.\n\nIn the i-th operation, he chooses an integer j satisfying 1 \\leq j \\leq i, and insert j at position j in a (the beginning is position 1).\n\nYou are given a sequence b of length N. Determine if it is possible that a is equal to b after N operations. If it is, show one possible sequence of operations that achieves it.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq b_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nb_1 \\dots b_N\n\nOutput\n\nIf there is no sequence of N operations after which a would be equal to b, print -1.\nIf there is, print N lines. In the i-th line, the integer chosen in the i-th operation should be printed. If there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n3\n1 2 1\n\nSample Output 1\n\n1\n1\n2\n\nIn this sequence of operations, the sequence a changes as follows:\n\nAfter the first operation: (1)\n\nAfter the second operation: (1,1)\n\nAfter the third operation: (1,2,1)\n\nSample Input 2\n\n2\n2 2\n\nSample Output 2\n\n-1\n\n2 cannot be inserted at the beginning of the sequence, so this is impossible.\n\nSample Input 3\n\n9\n1 1 1 2 2 1 2 3 2\n\nSample Output 3\n\n1\n2\n2\n3\n1\n2\n2\n1\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s673492615", "group_id": "codeNet:p03090", "input_text": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\n\nmy $c = 1+int($n/2);\n\nmy %path = ();\nmy $j = $c-1;\nfor(my $i=$c;$i<=$n;$i++){\n for(my $k=1;$k<=$n;$k++){\n next if( $k==$i or $k==$j );\n if( $k<$i ){\n $path{\"$k $i\"} = 1;\n } else {\n $path{\"$i $k\"} = 1;\n }\n if( $j>=1 ){\n if( $k<$j ){\n $path{\"$k $j\"} = 1;\n } else {\n $path{\"$j $k\"} = 1;\n }\n }\n }\n $j--;\n}\nmy @path = keys %path;\nmy $np = 1 + $#path;\nprint \"$np\\n\";\nforeach my $k (@path){\n print \"$k\\n\";\n}\n\nexit(0);\n\n", "language": "Perl", "metadata": {"date": 1553380988, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03090.html", "problem_id": "p03090", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03090/input.txt", "sample_output_relpath": "derived/input_output/data/p03090/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03090/Perl/s673492615.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s673492615", "user_id": "u750383873"}, "prompt_components": {"gold_output": "2\n1 3\n2 3\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\n\nmy $c = 1+int($n/2);\n\nmy %path = ();\nmy $j = $c-1;\nfor(my $i=$c;$i<=$n;$i++){\n for(my $k=1;$k<=$n;$k++){\n next if( $k==$i or $k==$j );\n if( $k<$i ){\n $path{\"$k $i\"} = 1;\n } else {\n $path{\"$i $k\"} = 1;\n }\n if( $j>=1 ){\n if( $k<$j ){\n $path{\"$k $j\"} = 1;\n } else {\n $path{\"$j $k\"} = 1;\n }\n }\n }\n $j--;\n}\nmy @path = keys %path;\nmy $np = 1 + $#path;\nprint \"$np\\n\";\nforeach my $k (@path){\n print \"$k\\n\";\n}\n\nexit(0);\n\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given an integer N.\nBuild an undirected graph with N vertices with indices 1 to N that satisfies the following two conditions:\n\nThe graph is simple and connected.\n\nThere exists an integer S such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is S.\n\nIt can be proved that at least one such graph exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIn the first line, print the number of edges, M, in the graph you made. In the i-th of the following M lines, print two integers a_i and b_i, representing the endpoints of the i-th edge.\n\nThe output will be judged correct if the graph satisfies the conditions.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n2\n1 3\n2 3\n\nFor every vertex, the sum of the indices of the vertices adjacent to that vertex is 3.", "sample_input": "3\n"}, "reference_outputs": ["2\n1 3\n2 3\n"], "source_document_id": "p03090", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given an integer N.\nBuild an undirected graph with N vertices with indices 1 to N that satisfies the following two conditions:\n\nThe graph is simple and connected.\n\nThere exists an integer S such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is S.\n\nIt can be proved that at least one such graph exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIn the first line, print the number of edges, M, in the graph you made. In the i-th of the following M lines, print two integers a_i and b_i, representing the endpoints of the i-th edge.\n\nThe output will be judged correct if the graph satisfies the conditions.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n2\n1 3\n2 3\n\nFor every vertex, the sum of the indices of the vertices adjacent to that vertex is 3.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 537, "cpu_time_ms": 8, "memory_kb": 1536}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s912221840", "group_id": "codeNet:p03095", "input_text": "<>;$s=<>;$o=1;$o*=1+eval\"$s=~tr/$_/$_/\"for(a..z);print$o-1", "language": "Perl", "metadata": {"date": 1559123394, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03095.html", "problem_id": "p03095", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03095/input.txt", "sample_output_relpath": "derived/input_output/data/p03095/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03095/Perl/s912221840.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s912221840", "user_id": "u573154728"}, "prompt_components": {"gold_output": "15\n", "input_to_evaluate": "<>;$s=<>;$o=1;$o*=1+eval\"$s=~tr/$_/$_/\"for(a..z);print$o-1", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N.\nAmong its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.\n\nHere, a subsequence of a string is a concatenation of one or more characters from the string without changing the order.\n\nConstraints\n\n1 \\leq N \\leq 100000\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\nPrint the number of the subsequences such that all characters are different, modulo 10^9+7.\n\nSample Input 1\n\n4\nabcd\n\nSample Output 1\n\n15\n\nSince all characters in S itself are different, all its subsequences satisfy the condition.\n\nSample Input 2\n\n3\nbaa\n\nSample Output 2\n\n5\n\nThe answer is five: b, two occurrences of a, two occurrences of ba. Note that we do not count baa, since it contains two as.\n\nSample Input 3\n\n5\nabcab\n\nSample Output 3\n\n17", "sample_input": "4\nabcd\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03095", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N.\nAmong its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.\n\nHere, a subsequence of a string is a concatenation of one or more characters from the string without changing the order.\n\nConstraints\n\n1 \\leq N \\leq 100000\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\nPrint the number of the subsequences such that all characters are different, modulo 10^9+7.\n\nSample Input 1\n\n4\nabcd\n\nSample Output 1\n\n15\n\nSince all characters in S itself are different, all its subsequences satisfy the condition.\n\nSample Input 2\n\n3\nbaa\n\nSample Output 2\n\n5\n\nThe answer is five: b, two occurrences of a, two occurrences of ba. Note that we do not count baa, since it contains two as.\n\nSample Input 3\n\n5\nabcab\n\nSample Output 3\n\n17", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 2, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s131066036", "group_id": "codeNet:p03096", "input_text": "<>;$.=($$_+=$.)%=1e9+7for`uniq`;print$.", "language": "Perl", "metadata": {"date": 1552796043, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03096.html", "problem_id": "p03096", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03096/input.txt", "sample_output_relpath": "derived/input_output/data/p03096/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03096/Perl/s131066036.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s131066036", "user_id": "u019489252"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;$.=($$_+=$.)%=1e9+7for`uniq`;print$.", "problem_context": "Score : 700 points\n\nProblem Statement\n\nThere are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.\n\nSnuke will perform the following operation zero or more times:\n\nChoose two stones painted in the same color. Repaint all the stones between them, with the color of the chosen stones.\n\nFind the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq C_i \\leq 2\\times 10^5(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\nC_1\n:\nC_N\n\nOutput\n\nPrint the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nSample Input 1\n\n5\n1\n2\n1\n2\n2\n\nSample Output 1\n\n3\n\nWe can make three sequences of colors of stones, as follows:\n\n(1,2,1,2,2), by doing nothing.\n\n(1,1,1,2,2), by choosing the first and third stones to perform the operation.\n\n(1,2,2,2,2), by choosing the second and fourth stones to perform the operation.\n\nSample Input 2\n\n6\n4\n2\n5\n4\n2\n4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1\n3\n1\n2\n3\n3\n2\n\nSample Output 3\n\n5", "sample_input": "5\n1\n2\n1\n2\n2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03096", "source_text": "Score : 700 points\n\nProblem Statement\n\nThere are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.\n\nSnuke will perform the following operation zero or more times:\n\nChoose two stones painted in the same color. Repaint all the stones between them, with the color of the chosen stones.\n\nFind the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq C_i \\leq 2\\times 10^5(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\nC_1\n:\nC_N\n\nOutput\n\nPrint the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nSample Input 1\n\n5\n1\n2\n1\n2\n2\n\nSample Output 1\n\n3\n\nWe can make three sequences of colors of stones, as follows:\n\n(1,2,1,2,2), by doing nothing.\n\n(1,1,1,2,2), by choosing the first and third stones to perform the operation.\n\n(1,2,2,2,2), by choosing the second and fourth stones to perform the operation.\n\nSample Input 2\n\n6\n4\n2\n5\n4\n2\n4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1\n3\n1\n2\n3\n3\n2\n\nSample Output 3\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 265, "memory_kb": 78296}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s393643032", "group_id": "codeNet:p03096", "input_text": "$\\=@d=!<>;$$_=push@d,($\\+=$$_<@d&&$d[$-=$$_-1])%=1e9+7for<>;print", "language": "Perl", "metadata": {"date": 1552779167, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03096.html", "problem_id": "p03096", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03096/input.txt", "sample_output_relpath": "derived/input_output/data/p03096/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03096/Perl/s393643032.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s393643032", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$\\=@d=!<>;$$_=push@d,($\\+=$$_<@d&&$d[$-=$$_-1])%=1e9+7for<>;print", "problem_context": "Score : 700 points\n\nProblem Statement\n\nThere are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.\n\nSnuke will perform the following operation zero or more times:\n\nChoose two stones painted in the same color. Repaint all the stones between them, with the color of the chosen stones.\n\nFind the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq C_i \\leq 2\\times 10^5(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\nC_1\n:\nC_N\n\nOutput\n\nPrint the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nSample Input 1\n\n5\n1\n2\n1\n2\n2\n\nSample Output 1\n\n3\n\nWe can make three sequences of colors of stones, as follows:\n\n(1,2,1,2,2), by doing nothing.\n\n(1,1,1,2,2), by choosing the first and third stones to perform the operation.\n\n(1,2,2,2,2), by choosing the second and fourth stones to perform the operation.\n\nSample Input 2\n\n6\n4\n2\n5\n4\n2\n4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1\n3\n1\n2\n3\n3\n2\n\nSample Output 3\n\n5", "sample_input": "5\n1\n2\n1\n2\n2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03096", "source_text": "Score : 700 points\n\nProblem Statement\n\nThere are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.\n\nSnuke will perform the following operation zero or more times:\n\nChoose two stones painted in the same color. Repaint all the stones between them, with the color of the chosen stones.\n\nFind the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq C_i \\leq 2\\times 10^5(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\nC_1\n:\nC_N\n\nOutput\n\nPrint the number of possible final sequences of colors of the stones, modulo 10^9+7.\n\nSample Input 1\n\n5\n1\n2\n1\n2\n2\n\nSample Output 1\n\n3\n\nWe can make three sequences of colors of stones, as follows:\n\n(1,2,1,2,2), by doing nothing.\n\n(1,1,1,2,2), by choosing the first and third stones to perform the operation.\n\n(1,2,2,2,2), by choosing the second and fourth stones to perform the operation.\n\nSample Input 2\n\n6\n4\n2\n5\n4\n2\n4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1\n3\n1\n2\n3\n3\n2\n\nSample Output 3\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 564, "memory_kb": 106240}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s696997692", "group_id": "codeNet:p03097", "input_text": "#!/usr/bin/perl\nmy ($n,$a,$b) = map { $_ - 0 } split(/\\s+/,);\nmy $n2 = 2 ** $n;\nmy %fac = ();\nfor(my $i=0;$i<18;$i++){\n my $ii = 2 ** $i;\n $fac{$ii} = 1;\n}\nmy $xab = ( $a ^ $b );\nunless( $fac{$xab} ){\n print \"NO\\n\";\n exit(0);\n}\nprint \"YES\\n\";\nmy @l = map { oct('0b' . $_ ) } &mkl($n);\nmy $i_a = -1;\nfor(my $i=0;$i<=$#l;$i++){\n if( $l[$i] == $a ){\n $i_a = $i;\n last;\n }\n}\nif( $l[($i_a+1) % $n2] == $b ){\n for(my $i=0;$i<$n2;$i++){\n print \" \" if $i>0;\n print $l[ ( $n2 + $i_a - $i ) % $n2 ];\n }\n} else {\n for(my $i=0;$i<$n2;$i++){\n print \" \" if $i>0;\n print $l[ ( $n2 + $i_a + $i ) % $n2 ];\n }\n}\nprint \"\\n\";\nexit(0);\n\nsub mkl {\n my $lv = shift;\n if( $lv == 1 ){\n my @r = ('0','1');\n return @r;\n }\n my @a = &mkl($lv-1);\n my @ra = reverse(@a);\n my @r = (map { \"0$_\" } @a , map { \"1$_\" } @ra );\n return @r;\n}\n", "language": "Perl", "metadata": {"date": 1552772758, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03097.html", "problem_id": "p03097", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03097/input.txt", "sample_output_relpath": "derived/input_output/data/p03097/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03097/Perl/s696997692.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s696997692", "user_id": "u750383873"}, "prompt_components": {"gold_output": "YES\n1 0 2 3\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n,$a,$b) = map { $_ - 0 } split(/\\s+/,);\nmy $n2 = 2 ** $n;\nmy %fac = ();\nfor(my $i=0;$i<18;$i++){\n my $ii = 2 ** $i;\n $fac{$ii} = 1;\n}\nmy $xab = ( $a ^ $b );\nunless( $fac{$xab} ){\n print \"NO\\n\";\n exit(0);\n}\nprint \"YES\\n\";\nmy @l = map { oct('0b' . $_ ) } &mkl($n);\nmy $i_a = -1;\nfor(my $i=0;$i<=$#l;$i++){\n if( $l[$i] == $a ){\n $i_a = $i;\n last;\n }\n}\nif( $l[($i_a+1) % $n2] == $b ){\n for(my $i=0;$i<$n2;$i++){\n print \" \" if $i>0;\n print $l[ ( $n2 + $i_a - $i ) % $n2 ];\n }\n} else {\n for(my $i=0;$i<$n2;$i++){\n print \" \" if $i>0;\n print $l[ ( $n2 + $i_a + $i ) % $n2 ];\n }\n}\nprint \"\\n\";\nexit(0);\n\nsub mkl {\n my $lv = shift;\n if( $lv == 1 ){\n my @r = ('0','1');\n return @r;\n }\n my @a = &mkl($lv-1);\n my @ra = reverse(@a);\n my @r = (map { \"0$_\" } @a , map { \"1$_\" } @ra );\n return @r;\n}\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nYou are given integers N,\\ A and B.\nDetermine if there exists a permutation (P_0,\\ P_1,\\ ...\\ P_{2^N-1}) of (0,\\ 1,\\ ...\\ 2^N-1) that satisfies all of the following conditions, and create one such permutation if it exists.\n\nP_0=A\n\nP_{2^N-1}=B\n\nFor all 0 \\leq i < 2^N-1, the binary representations of P_i and P_{i+1} differ by exactly one bit.\n\nConstraints\n\n1 \\leq N \\leq 17\n\n0 \\leq A \\leq 2^N-1\n\n0 \\leq B \\leq 2^N-1\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\nN A B\n\nOutput\n\nIf there is no permutation that satisfies the conditions, print NO.\n\nIf there is such a permutation, print YES in the first line.\nThen, print (P_0,\\ P_1,\\ ...\\ P_{2^N-1}) in the second line, with spaces in between.\nIf there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n2 1 3\n\nSample Output 1\n\nYES\n1 0 2 3\n\nThe binary representation of P=(1,0,2,3) is (01,00,10,11), where any two adjacent elements differ by exactly one bit.\n\nSample Input 2\n\n3 2 1\n\nSample Output 2\n\nNO", "sample_input": "2 1 3\n"}, "reference_outputs": ["YES\n1 0 2 3\n"], "source_document_id": "p03097", "source_text": "Score : 800 points\n\nProblem Statement\n\nYou are given integers N,\\ A and B.\nDetermine if there exists a permutation (P_0,\\ P_1,\\ ...\\ P_{2^N-1}) of (0,\\ 1,\\ ...\\ 2^N-1) that satisfies all of the following conditions, and create one such permutation if it exists.\n\nP_0=A\n\nP_{2^N-1}=B\n\nFor all 0 \\leq i < 2^N-1, the binary representations of P_i and P_{i+1} differ by exactly one bit.\n\nConstraints\n\n1 \\leq N \\leq 17\n\n0 \\leq A \\leq 2^N-1\n\n0 \\leq B \\leq 2^N-1\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\nN A B\n\nOutput\n\nIf there is no permutation that satisfies the conditions, print NO.\n\nIf there is such a permutation, print YES in the first line.\nThen, print (P_0,\\ P_1,\\ ...\\ P_{2^N-1}) in the second line, with spaces in between.\nIf there are multiple solutions, any of them is accepted.\n\nSample Input 1\n\n2 1 3\n\nSample Output 1\n\nYES\n1 0 2 3\n\nThe binary representation of P=(1,0,2,3) is (01,00,10,11), where any two adjacent elements differ by exactly one bit.\n\nSample Input 2\n\n3 2 1\n\nSample Output 2\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 852, "cpu_time_ms": 6, "memory_kb": 1152}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s082070578", "group_id": "codeNet:p03101", "input_text": "use v5.18.2;\n\nmy ($H, $W) = split ' ', ;\nmy ($h, $w) = split ' ', ;\n\nmy $total = $H * $W;\nmy $black = $H * $w + $h * $W - $h * $w;\nmy $white = $total - $black;\n\nsay $white;\n", "language": "Perl", "metadata": {"date": 1553025274, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03101.html", "problem_id": "p03101", "resource_group": "low_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/Perl/s082070578.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s082070578", "user_id": "u929114311"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use v5.18.2;\n\nmy ($H, $W) = split ' ', ;\nmy ($h, $w) = split ' ', ;\n\nmy $total = $H * $W;\nmy $black = $H * $w + $h * $W - $h * $w;\nmy $white = $total - $black;\n\nsay $white;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 187, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s829401175", "group_id": "codeNet:p03102", "input_text": "<>=~/ .* /;@b=glob<>;\nmap{$s=$';$i=0;$s+=$_*$b[$i++]for glob;$\\+=$s>0}<>;\nprint", "language": "Perl", "metadata": {"date": 1552165255, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03102.html", "problem_id": "p03102", "resource_group": "low_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/Perl/s829401175.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s829401175", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>=~/ .* /;@b=glob<>;\nmap{$s=$';$i=0;$s+=$_*$b[$i++]for glob;$\\+=$s>0}<>;\nprint", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 79, "cpu_time_ms": 6, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s619551826", "group_id": "codeNet:p03106", "input_text": "$/=get.words;grep(($0&$1)%%*,1..$1)[*-$2].say", "language": "Perl", "metadata": {"date": 1551643914, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03106.html", "problem_id": "p03106", "resource_group": "low_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/Perl/s619551826.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s619551826", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$/=get.words;grep(($0&$1)%%*,1..$1)[*-$2].say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 284, "memory_kb": 65764}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s393851033", "group_id": "codeNet:p03107", "input_text": "print map($a+=$_*2-1,<>=~/./g)-abs$a", "language": "Perl", "metadata": {"date": 1551649130, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03107.html", "problem_id": "p03107", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03107/input.txt", "sample_output_relpath": "derived/input_output/data/p03107/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03107/Perl/s393851033.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s393851033", "user_id": "u019489252"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "print map($a+=$_*2-1,<>=~/./g)-abs$a", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "0011\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03107", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 45, "memory_kb": 11520}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s858676578", "group_id": "codeNet:p03107", "input_text": "/$_[-1]/?$_[@_]=$_:($#_--,$%+=2)for<>=~/./g;print$%", "language": "Perl", "metadata": {"date": 1551644561, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03107.html", "problem_id": "p03107", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03107/input.txt", "sample_output_relpath": "derived/input_output/data/p03107/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03107/Perl/s858676578.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s858676578", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "/$_[-1]/?$_[@_]=$_:($#_--,$%+=2)for<>=~/./g;print$%", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "0011\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03107", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 240, "memory_kb": 17024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s631639918", "group_id": "codeNet:p03108", "input_text": "@$_=$_ for@p=0..<>;map{unshift@a,$#p*~-$#p/2-$%;@{$A=$p[$'*/ /]}<@{$B=$p[$`]}or$A^=$B^=$A^=$B;$%+=@$B*map$p[$$B[@$B]=$_]=$B,@$A if$B-$A}reverse<>;print\"@a\"", "language": "Perl", "metadata": {"date": 1551689561, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03108.html", "problem_id": "p03108", "resource_group": "low_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/Perl/s631639918.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s631639918", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0\n0\n4\n5\n6\n", "input_to_evaluate": "@$_=$_ for@p=0..<>;map{unshift@a,$#p*~-$#p/2-$%;@{$A=$p[$'*/ /]}<@{$B=$p[$`]}or$A^=$B^=$A^=$B;$%+=@$B*map$p[$$B[@$B]=$_]=$B,@$A if$B-$A}reverse<>;print\"@a\"", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 155, "cpu_time_ms": 623, "memory_kb": 97152}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s601381772", "group_id": "codeNet:p03109", "input_text": "use strict;\nuse warnings;\n\nmy $input = ;\nchomp $input;\nmy ($year,$man,$day) = split(/\\//,$input);\n\nif($man<=4){\n print \"Heisei\\n\";\n}else{\n print \"TBD\\n\";\n}", "language": "Perl", "metadata": {"date": 1551040775, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "low_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/Perl/s601381772.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s601381772", "user_id": "u686303803"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $input = ;\nchomp $input;\nmy ($year,$man,$day) = split(/\\//,$input);\n\nif($man<=4){\n print \"Heisei\\n\";\n}else{\n print \"TBD\\n\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s378097451", "group_id": "codeNet:p03110", "input_text": "$n=<>;\nforeach (1..$n){\n ($p,$q)=glob<>;\n $p*=380000.0 if($q=~B);\n $s+=$p;\n}\nprint $s;\n", "language": "Perl", "metadata": {"date": 1558078843, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03110.html", "problem_id": "p03110", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03110/input.txt", "sample_output_relpath": "derived/input_output/data/p03110/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03110/Perl/s378097451.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s378097451", "user_id": "u573154728"}, "prompt_components": {"gold_output": "48000.0\n", "input_to_evaluate": "$n=<>;\nforeach (1..$n){\n ($p,$q)=glob<>;\n $p*=380000.0 if($q=~B);\n $s+=$p;\n}\nprint $s;\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi received otoshidama (New Year's money gifts) from N of his relatives.\n\nYou are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.\n\nFor example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.\n\nIf we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?\n\nConstraints\n\n2 \\leq N \\leq 10\n\nu_i = JPY or BTC.\n\nIf u_i = JPY, x_i is an integer such that 1 \\leq x_i \\leq 10^8.\n\nIf u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \\leq x_i \\leq 100.00000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 u_1\nx_2 u_2\n:\nx_N u_N\n\nOutput\n\nIf the gifts are worth Y yen in total, print the value Y (not necessarily an integer).\n\nOutput will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10000 JPY\n0.10000000 BTC\n\nSample Output 1\n\n48000.0\n\nThe otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.\n\nOutputs such as 48000 and 48000.1 will also be judged correct.\n\nSample Input 2\n\n3\n100000000 JPY\n100.00000000 BTC\n0.00000001 BTC\n\nSample Output 2\n\n138000000.0038\n\nIn this case, outputs such as 138001000 and 1.38e8 will also be judged correct.", "sample_input": "2\n10000 JPY\n0.10000000 BTC\n"}, "reference_outputs": ["48000.0\n"], "source_document_id": "p03110", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi received otoshidama (New Year's money gifts) from N of his relatives.\n\nYou are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.\n\nFor example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.\n\nIf we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?\n\nConstraints\n\n2 \\leq N \\leq 10\n\nu_i = JPY or BTC.\n\nIf u_i = JPY, x_i is an integer such that 1 \\leq x_i \\leq 10^8.\n\nIf u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \\leq x_i \\leq 100.00000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 u_1\nx_2 u_2\n:\nx_N u_N\n\nOutput\n\nIf the gifts are worth Y yen in total, print the value Y (not necessarily an integer).\n\nOutput will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10000 JPY\n0.10000000 BTC\n\nSample Output 1\n\n48000.0\n\nThe otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.\n\nOutputs such as 48000 and 48000.1 will also be judged correct.\n\nSample Input 2\n\n3\n100000000 JPY\n100.00000000 BTC\n0.00000001 BTC\n\nSample Output 2\n\n138000000.0038\n\nIn this case, outputs such as 138001000 and 1.38e8 will also be judged correct.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s304877216", "group_id": "codeNet:p03110", "input_text": "<>;$a+=$_*($_=~J?1:38e4)for<>;print$a", "language": "Perl", "metadata": {"date": 1551039632, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03110.html", "problem_id": "p03110", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03110/input.txt", "sample_output_relpath": "derived/input_output/data/p03110/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03110/Perl/s304877216.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304877216", "user_id": "u207056619"}, "prompt_components": {"gold_output": "48000.0\n", "input_to_evaluate": "<>;$a+=$_*($_=~J?1:38e4)for<>;print$a", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi received otoshidama (New Year's money gifts) from N of his relatives.\n\nYou are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.\n\nFor example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.\n\nIf we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?\n\nConstraints\n\n2 \\leq N \\leq 10\n\nu_i = JPY or BTC.\n\nIf u_i = JPY, x_i is an integer such that 1 \\leq x_i \\leq 10^8.\n\nIf u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \\leq x_i \\leq 100.00000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 u_1\nx_2 u_2\n:\nx_N u_N\n\nOutput\n\nIf the gifts are worth Y yen in total, print the value Y (not necessarily an integer).\n\nOutput will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10000 JPY\n0.10000000 BTC\n\nSample Output 1\n\n48000.0\n\nThe otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.\n\nOutputs such as 48000 and 48000.1 will also be judged correct.\n\nSample Input 2\n\n3\n100000000 JPY\n100.00000000 BTC\n0.00000001 BTC\n\nSample Output 2\n\n138000000.0038\n\nIn this case, outputs such as 138001000 and 1.38e8 will also be judged correct.", "sample_input": "2\n10000 JPY\n0.10000000 BTC\n"}, "reference_outputs": ["48000.0\n"], "source_document_id": "p03110", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi received otoshidama (New Year's money gifts) from N of his relatives.\n\nYou are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.\n\nFor example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.\n\nIf we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?\n\nConstraints\n\n2 \\leq N \\leq 10\n\nu_i = JPY or BTC.\n\nIf u_i = JPY, x_i is an integer such that 1 \\leq x_i \\leq 10^8.\n\nIf u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \\leq x_i \\leq 100.00000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 u_1\nx_2 u_2\n:\nx_N u_N\n\nOutput\n\nIf the gifts are worth Y yen in total, print the value Y (not necessarily an integer).\n\nOutput will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10000 JPY\n0.10000000 BTC\n\nSample Output 1\n\n48000.0\n\nThe otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.\n\nOutputs such as 48000 and 48000.1 will also be judged correct.\n\nSample Input 2\n\n3\n100000000 JPY\n100.00000000 BTC\n0.00000001 BTC\n\nSample Output 2\n\n138000000.0038\n\nIn this case, outputs such as 138001000 and 1.38e8 will also be judged correct.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s450276787", "group_id": "codeNet:p03111", "input_text": "@A=glob<>;\n@l=<>;\nprintf sort{$a-$b}map{\n\t@v=//;\n\t$x=-30;\n\tfor(0..$#l){\n\t\tif($t=$'>>2*$_&3){\n\t\t\t$v[$t]+=$l[$_];\n\t\t\t$x+=10\n\t\t}\n\t}\n\tfor(1..3){\n\t\t$x+=abs$A[$_]-($v[$_]||1e9)\n\t}\n\t$x\n}1..1<<2*@l\n", "language": "Perl", "metadata": {"date": 1551052814, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03111.html", "problem_id": "p03111", "resource_group": "low_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/Perl/s450276787.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s450276787", "user_id": "u283869437"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "@A=glob<>;\n@l=<>;\nprintf sort{$a-$b}map{\n\t@v=//;\n\t$x=-30;\n\tfor(0..$#l){\n\t\tif($t=$'>>2*$_&3){\n\t\t\t$v[$t]+=$l[$_];\n\t\t\t$x+=10\n\t\t}\n\t}\n\tfor(1..3){\n\t\t$x+=abs$A[$_]-($v[$_]||1e9)\n\t}\n\t$x\n}1..1<<2*@l\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 439, "memory_kb": 9472}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s693603814", "group_id": "codeNet:p03112", "input_text": "#!/usr/bin/perl\nuse Data::Dumper;\nmy ($A,$B,$Q) = map { $_ - 0 } split(/[\\s]+/,);\nmy @d_o = ();\nmy $bg = 10**12;\nfor(my $i=0;$i<$A;$i++){\n my ($s) = map { $_ - 0 } split(/[\\s]+/,);\n push(@d_o,+[$s,$bg,'s']);\n}\nfor(my $i=0;$i<$B;$i++){\n my ($t) = map { $_ - 0 } split(/[\\s]+/,);\n push(@d_o,+[$t,$bg,'t']);\n}\nmy @d = sort {$a->[0] <=> $b->[0]} @d_o;\nmy $s_i = -1;\nmy $t_i = -1;\nfor(my $i=0;$i<=$#d;$i++){\n if( $d[$i]->[2] eq 's' ){\n $s_i = $i;\n $d[$i]->[1] = abs($d[$t_i]->[0] - $d[$i]->[0]) if $t_i != -1 and abs($d[$t_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n if( $d[$i]->[2] eq 't' ){\n $t_i = $i;\n $d[$i]->[1] = abs($d[$s_i]->[0] - $d[$i]->[0]) if $s_i != -1 and abs($d[$s_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n}\n$s_i = -1;\n$t_i = -1;\nfor(my $i=$#d;$i>=0;$i--){\n if( $d[$i]->[2] eq 's' ){\n $s_i = $i;\n $d[$i]->[1] = abs($d[$t_i]->[0] - $d[$i]->[0]) if $t_i != -1 and abs($d[$t_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n if( $d[$i]->[2] eq 't' ){\n $t_i = $i;\n $d[$i]->[1] = abs($d[$s_i]->[0] - $d[$i]->[0]) if $s_i != -1 and abs($d[$s_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n}\n\nmy @x_o = ();\nfor(my $i=0;$i<$Q;$i++){\n my ($x) = map { $_ - 0 } split(/[\\s]+/,);\n push(@x_o,+[$x,$i,'x',-1]);\n}\nmy @x = sort { $a->[0] <=> $b->[0] } @x_o;\n\nmy @z = sort { $a->[0] <=> $b->[0] } (@x,@d);\n\n$s_i = -1;\n$t_i = -1;\n\nfor(my $i=0;$i<=$#z;$i++){\n $s_i = $i if $z[$i]->[2] eq 's';\n $t_i = $i if $z[$i]->[2] eq 't';\n if( $z[$i]->[2] eq 'x' ){\n if( $s_i != -1 ){\n my $di = abs( $z[$s_i]->[0] - $z[$i]->[0] ) + $z[$s_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n if( $t_i != -1 ){\n my $di = abs( $z[$t_i]->[0] - $z[$i]->[0] ) + $z[$t_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n }\n}\n\n$s_i = -1;\n$t_i = -1;\nfor(my $i=$#z;$i>=0;$i--){\n $s_i = $i if $z[$i]->[2] eq 's';\n $t_i = $i if $z[$i]->[2] eq 't';\n if( $z[$i]->[2] eq 'x' ){\n if( $s_i != -1 ){\n my $di = abs( $z[$s_i]->[0] - $z[$i]->[0] ) + $z[$s_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n if( $t_i != -1 ){\n my $di = abs( $z[$t_i]->[0] - $z[$i]->[0] ) + $z[$t_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n }\n}\n\nmy @xx = sort { $a->[1] <=> $b->[1] } @x;\nforeach my $xx1 (@xx){\n print \"$xx1->[3]\\n\";\n}\n\nexit(0);\n\nsub mg {\n my $a1 = shift;\n my $b1 = shift;\n my @res = ();\n $#res = 1 + $#{$a1} + $#{$b1};\n my $a2 = 0;\n my $b2 = 0;\n my $t = 0;\n while($t<=$#res){\n if( $a2 > $#{$a1} ){\n $res[$t++] = $b1->[$b2++];\n } elsif( $b2 > $#{$b1} ){\n $res[$t++] = $a1->[$a2++];\n } elsif( $a1->[$a2]->[0] < $b1->[$b2]->[0] ) {\n $res[$t++] = $a1->[$a2++];\n } else {\n $res[$t++] = $b1->[$b2++];\n }\n }\n return @res;\n}\n\n", "language": "Perl", "metadata": {"date": 1552696985, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03112.html", "problem_id": "p03112", "resource_group": "low_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/Perl/s693603814.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s693603814", "user_id": "u750383873"}, "prompt_components": {"gold_output": "350\n1400\n301\n399\n", "input_to_evaluate": "#!/usr/bin/perl\nuse Data::Dumper;\nmy ($A,$B,$Q) = map { $_ - 0 } split(/[\\s]+/,);\nmy @d_o = ();\nmy $bg = 10**12;\nfor(my $i=0;$i<$A;$i++){\n my ($s) = map { $_ - 0 } split(/[\\s]+/,);\n push(@d_o,+[$s,$bg,'s']);\n}\nfor(my $i=0;$i<$B;$i++){\n my ($t) = map { $_ - 0 } split(/[\\s]+/,);\n push(@d_o,+[$t,$bg,'t']);\n}\nmy @d = sort {$a->[0] <=> $b->[0]} @d_o;\nmy $s_i = -1;\nmy $t_i = -1;\nfor(my $i=0;$i<=$#d;$i++){\n if( $d[$i]->[2] eq 's' ){\n $s_i = $i;\n $d[$i]->[1] = abs($d[$t_i]->[0] - $d[$i]->[0]) if $t_i != -1 and abs($d[$t_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n if( $d[$i]->[2] eq 't' ){\n $t_i = $i;\n $d[$i]->[1] = abs($d[$s_i]->[0] - $d[$i]->[0]) if $s_i != -1 and abs($d[$s_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n}\n$s_i = -1;\n$t_i = -1;\nfor(my $i=$#d;$i>=0;$i--){\n if( $d[$i]->[2] eq 's' ){\n $s_i = $i;\n $d[$i]->[1] = abs($d[$t_i]->[0] - $d[$i]->[0]) if $t_i != -1 and abs($d[$t_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n if( $d[$i]->[2] eq 't' ){\n $t_i = $i;\n $d[$i]->[1] = abs($d[$s_i]->[0] - $d[$i]->[0]) if $s_i != -1 and abs($d[$s_i]->[0] - $d[$i]->[0]) < $d[$i]->[1];\n }\n}\n\nmy @x_o = ();\nfor(my $i=0;$i<$Q;$i++){\n my ($x) = map { $_ - 0 } split(/[\\s]+/,);\n push(@x_o,+[$x,$i,'x',-1]);\n}\nmy @x = sort { $a->[0] <=> $b->[0] } @x_o;\n\nmy @z = sort { $a->[0] <=> $b->[0] } (@x,@d);\n\n$s_i = -1;\n$t_i = -1;\n\nfor(my $i=0;$i<=$#z;$i++){\n $s_i = $i if $z[$i]->[2] eq 's';\n $t_i = $i if $z[$i]->[2] eq 't';\n if( $z[$i]->[2] eq 'x' ){\n if( $s_i != -1 ){\n my $di = abs( $z[$s_i]->[0] - $z[$i]->[0] ) + $z[$s_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n if( $t_i != -1 ){\n my $di = abs( $z[$t_i]->[0] - $z[$i]->[0] ) + $z[$t_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n }\n}\n\n$s_i = -1;\n$t_i = -1;\nfor(my $i=$#z;$i>=0;$i--){\n $s_i = $i if $z[$i]->[2] eq 's';\n $t_i = $i if $z[$i]->[2] eq 't';\n if( $z[$i]->[2] eq 'x' ){\n if( $s_i != -1 ){\n my $di = abs( $z[$s_i]->[0] - $z[$i]->[0] ) + $z[$s_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n if( $t_i != -1 ){\n my $di = abs( $z[$t_i]->[0] - $z[$i]->[0] ) + $z[$t_i]->[1];\n $z[$i]->[3] = $di if $z[$i]->[3] == -1 or $di < $z[$i]->[3];\n }\n }\n}\n\nmy @xx = sort { $a->[1] <=> $b->[1] } @x;\nforeach my $xx1 (@xx){\n print \"$xx1->[3]\\n\";\n}\n\nexit(0);\n\nsub mg {\n my $a1 = shift;\n my $b1 = shift;\n my @res = ();\n $#res = 1 + $#{$a1} + $#{$b1};\n my $a2 = 0;\n my $b2 = 0;\n my $t = 0;\n while($t<=$#res){\n if( $a2 > $#{$a1} ){\n $res[$t++] = $b1->[$b2++];\n } elsif( $b2 > $#{$b1} ){\n $res[$t++] = $a1->[$a2++];\n } elsif( $a1->[$a2]->[0] < $b1->[$b2]->[0] ) {\n $res[$t++] = $a1->[$a2++];\n } else {\n $res[$t++] = $b1->[$b2++];\n }\n }\n return @res;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2843, "cpu_time_ms": 2110, "memory_kb": 110268}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s711344189", "group_id": "codeNet:p03126", "input_text": "get;say +[(&)] lines>>.words>>.[1..*]", "language": "Perl", "metadata": {"date": 1550369231, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03126.html", "problem_id": "p03126", "resource_group": "low_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/Perl/s711344189.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s711344189", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "get;say +[(&)] lines>>.words>>.[1..*]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 279, "memory_kb": 72400}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s281791540", "group_id": "codeNet:p03127", "input_text": "get;say [gcd] get.words", "language": "Perl", "metadata": {"date": 1550706762, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03127.html", "problem_id": "p03127", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03127/input.txt", "sample_output_relpath": "derived/input_output/data/p03127/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03127/Perl/s281791540.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s281791540", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get;say [gcd] get.words", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\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 possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "sample_input": "4\n2 10 8 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03127", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\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 possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 23, "cpu_time_ms": 2108, "memory_kb": 79076}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s290663565", "group_id": "codeNet:p03128", "input_text": "$%=<>;@c=(0,2,5,5,4,5,6,3,7,6)[@a=sort{$a-$b}glob<>];\n$==-//,map($=+=$-=$'>=$_&&$p[$'-$_]+1-$=,@c),$p[$']=$=for@@=1..$%;\n$%-=$c[$i=(grep$p[$#_=$%-$c[$_]]+1==$p[$%],@@)[-1]],print$a[$i]while$%", "language": "Perl", "metadata": {"date": 1550378057, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03128.html", "problem_id": "p03128", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03128/input.txt", "sample_output_relpath": "derived/input_output/data/p03128/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03128/Perl/s290663565.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s290663565", "user_id": "u657913472"}, "prompt_components": {"gold_output": "777773\n", "input_to_evaluate": "$%=<>;@c=(0,2,5,5,4,5,6,3,7,6)[@a=sort{$a-$b}glob<>];\n$==-//,map($=+=$-=$'>=$_&&$p[$'-$_]+1-$=,@c),$p[$']=$=for@@=1..$%;\n$%-=$c[$i=(grep$p[$#_=$%-$c[$_]]+1==$p[$%],@@)[-1]],print$a[$i]while$%", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFind the largest integer that can be formed with exactly N matchsticks, under the following conditions:\n\nEvery digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \\leq A_i \\leq 9).\n\nThe number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^4\n\n1 \\leq M \\leq 9\n\n1 \\leq A_i \\leq 9\n\nA_i are all different.\n\nThere exists an integer that can be formed by exactly N matchsticks under the conditions.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_M\n\nOutput\n\nPrint the largest integer that can be formed with exactly N matchsticks under the conditions in the problem statement.\n\nSample Input 1\n\n20 4\n3 7 8 4\n\nSample Output 1\n\n777773\n\nThe integer 777773 can be formed with 3 + 3 + 3 + 3 + 3 + 5 = 20 matchsticks, and this is the largest integer that can be formed by 20 matchsticks under the conditions.\n\nSample Input 2\n\n101 9\n9 8 7 6 5 4 3 2 1\n\nSample Output 2\n\n71111111111111111111111111111111111111111111111111\n\nThe output may not fit into a 64-bit integer type.\n\nSample Input 3\n\n15 3\n5 4 6\n\nSample Output 3\n\n654", "sample_input": "20 4\n3 7 8 4\n"}, "reference_outputs": ["777773\n"], "source_document_id": "p03128", "source_text": "Score : 400 points\n\nProblem Statement\n\nFind the largest integer that can be formed with exactly N matchsticks, under the following conditions:\n\nEvery digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \\leq A_i \\leq 9).\n\nThe number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^4\n\n1 \\leq M \\leq 9\n\n1 \\leq A_i \\leq 9\n\nA_i are all different.\n\nThere exists an integer that can be formed by exactly N matchsticks under the conditions.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_M\n\nOutput\n\nPrint the largest integer that can be formed with exactly N matchsticks under the conditions in the problem statement.\n\nSample Input 1\n\n20 4\n3 7 8 4\n\nSample Output 1\n\n777773\n\nThe integer 777773 can be formed with 3 + 3 + 3 + 3 + 3 + 5 = 20 matchsticks, and this is the largest integer that can be formed by 20 matchsticks under the conditions.\n\nSample Input 2\n\n101 9\n9 8 7 6 5 4 3 2 1\n\nSample Output 2\n\n71111111111111111111111111111111111111111111111111\n\nThe output may not fit into a 64-bit integer type.\n\nSample Input 3\n\n15 3\n5 4 6\n\nSample Output 3\n\n654", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2104, "memory_kb": 3072}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s731420533", "group_id": "codeNet:p03130", "input_text": "say [\"NO\",\"YES\"][lines.words.sum==15]", "language": "Perl", "metadata": {"date": 1549774425, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03130.html", "problem_id": "p03130", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03130/input.txt", "sample_output_relpath": "derived/input_output/data/p03130/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03130/Perl/s731420533.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s731420533", "user_id": "u280667879"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "say [\"NO\",\"YES\"][lines.words.sum==15]", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "sample_input": "4 2\n1 3\n2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03130", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 257, "memory_kb": 63984}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s030794477", "group_id": "codeNet:p03131", "input_text": "$/=get.words;say $0+1 max($_=$0-$1+1)+>1*($2-$1)+$_%2+$1", "language": "Perl", "metadata": {"date": 1549771768, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03131.html", "problem_id": "p03131", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03131/input.txt", "sample_output_relpath": "derived/input_output/data/p03131/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03131/Perl/s030794477.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s030794477", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "$/=get.words;say $0+1 max($_=$0-$1+1)+>1*($2-$1)+$_%2+$1", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has one biscuit and zero Japanese yen (the currency) in his pocket.\nHe will perform the following operations exactly K times in total, in the order he likes:\n\nHit his pocket, which magically increases the number of biscuits by one.\n\nExchange A biscuits to 1 yen.\n\nExchange 1 yen to B biscuits.\n\nFind the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nConstraints\n\n1 \\leq K,A,B \\leq 10^9\n\nK,A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nPrint the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nSample Input 1\n\n4 2 6\n\nSample Output 1\n\n7\n\nThe number of biscuits in Snuke's pocket after K operations is maximized as follows:\n\nHit his pocket. Now he has 2 biscuits and 0 yen.\n\nExchange 2 biscuits to 1 yen. his pocket. Now he has 0 biscuits and 1 yen.\n\nHit his pocket. Now he has 1 biscuits and 1 yen.\n\nExchange 1 yen to 6 biscuits. his pocket. Now he has 7 biscuits and 0 yen.\n\nSample Input 2\n\n7 3 4\n\nSample Output 2\n\n8\n\nSample Input 3\n\n314159265 35897932 384626433\n\nSample Output 3\n\n48518828981938099", "sample_input": "4 2 6\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03131", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has one biscuit and zero Japanese yen (the currency) in his pocket.\nHe will perform the following operations exactly K times in total, in the order he likes:\n\nHit his pocket, which magically increases the number of biscuits by one.\n\nExchange A biscuits to 1 yen.\n\nExchange 1 yen to B biscuits.\n\nFind the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nConstraints\n\n1 \\leq K,A,B \\leq 10^9\n\nK,A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nPrint the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nSample Input 1\n\n4 2 6\n\nSample Output 1\n\n7\n\nThe number of biscuits in Snuke's pocket after K operations is maximized as follows:\n\nHit his pocket. Now he has 2 biscuits and 0 yen.\n\nExchange 2 biscuits to 1 yen. his pocket. Now he has 0 biscuits and 1 yen.\n\nHit his pocket. Now he has 1 biscuits and 1 yen.\n\nExchange 1 yen to 6 biscuits. his pocket. Now he has 7 biscuits and 0 yen.\n\nSample Input 2\n\n7 3 4\n\nSample Output 2\n\n8\n\nSample Input 3\n\n314159265 35897932 384626433\n\nSample Output 3\n\n48518828981938099", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 56, "cpu_time_ms": 285, "memory_kb": 63836}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s645992593", "group_id": "codeNet:p03132", "input_text": "<>;$\\=$,@@=map$\\-=$-=$\\-$_-shift@@,$_,$y=$_>0?$_%2:2,~$_%2,$y,$_ for<>;print", "language": "Perl", "metadata": {"date": 1579496501, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03132.html", "problem_id": "p03132", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03132/input.txt", "sample_output_relpath": "derived/input_output/data/p03132/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03132/Perl/s645992593.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s645992593", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>;$\\=$,@@=map$\\-=$-=$\\-$_-shift@@,$_,$y=$_>0?$_%2:2,~$_%2,$y,$_ for<>;print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke stands on a number line. He has L ears, and he will walk along the line continuously under the following conditions:\n\nHe never visits a point with coordinate less than 0, or a point with coordinate greater than L.\n\nHe starts walking at a point with integer coordinate, and also finishes walking at a point with integer coordinate.\n\nHe only changes direction at a point with integer coordinate.\n\nEach time when Snuke passes a point with coordinate i-0.5, where i is an integer, he put a stone in his i-th ear.\n\nAfter Snuke finishes walking, Ringo will repeat the following operations in some order so that, for each i, Snuke's i-th ear contains A_i stones:\n\nPut a stone in one of Snuke's ears.\n\nRemove a stone from one of Snuke's ears.\n\nFind the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nConstraints\n\n1 \\leq L \\leq 2\\times 10^5\n\n0 \\leq A_i \\leq 10^9(1\\leq i\\leq L)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\nA_1\n:\nA_L\n\nOutput\n\nPrint the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nSample Input 1\n\n4\n1\n0\n2\n3\n\nSample Output 1\n\n1\n\nAssume that Snuke walks as follows:\n\nHe starts walking at coordinate 3 and finishes walking at coordinate 4, visiting coordinates 3,4,3,2,3,4 in this order.\n\nThen, Snuke's four ears will contain 0,0,2,3 stones, respectively.\nRingo can satisfy the requirement by putting one stone in the first ear.\n\nSample Input 2\n\n8\n2\n0\n0\n2\n1\n3\n4\n1\n\nSample Output 2\n\n3\n\nSample Input 3\n\n7\n314159265\n358979323\n846264338\n327950288\n419716939\n937510582\n0\n\nSample Output 3\n\n1", "sample_input": "4\n1\n0\n2\n3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03132", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke stands on a number line. He has L ears, and he will walk along the line continuously under the following conditions:\n\nHe never visits a point with coordinate less than 0, or a point with coordinate greater than L.\n\nHe starts walking at a point with integer coordinate, and also finishes walking at a point with integer coordinate.\n\nHe only changes direction at a point with integer coordinate.\n\nEach time when Snuke passes a point with coordinate i-0.5, where i is an integer, he put a stone in his i-th ear.\n\nAfter Snuke finishes walking, Ringo will repeat the following operations in some order so that, for each i, Snuke's i-th ear contains A_i stones:\n\nPut a stone in one of Snuke's ears.\n\nRemove a stone from one of Snuke's ears.\n\nFind the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nConstraints\n\n1 \\leq L \\leq 2\\times 10^5\n\n0 \\leq A_i \\leq 10^9(1\\leq i\\leq L)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\nA_1\n:\nA_L\n\nOutput\n\nPrint the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nSample Input 1\n\n4\n1\n0\n2\n3\n\nSample Output 1\n\n1\n\nAssume that Snuke walks as follows:\n\nHe starts walking at coordinate 3 and finishes walking at coordinate 4, visiting coordinates 3,4,3,2,3,4 in this order.\n\nThen, Snuke's four ears will contain 0,0,2,3 stones, respectively.\nRingo can satisfy the requirement by putting one stone in the first ear.\n\nSample Input 2\n\n8\n2\n0\n0\n2\n1\n3\n4\n1\n\nSample Output 2\n\n3\n\nSample Input 3\n\n7\n314159265\n358979323\n846264338\n327950288\n419716939\n937510582\n0\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1141, "memory_kb": 36352}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s928088788", "group_id": "codeNet:p03132", "input_text": "<>;$\\=9e9,@@=map$\\-=$-=$\\-$@[$i++%5]-$_,$_,$y=$_>0?$_%2:2,~$_%2,$y,$_ for<>;print", "language": "Perl", "metadata": {"date": 1549778348, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03132.html", "problem_id": "p03132", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03132/input.txt", "sample_output_relpath": "derived/input_output/data/p03132/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03132/Perl/s928088788.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s928088788", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>;$\\=9e9,@@=map$\\-=$-=$\\-$@[$i++%5]-$_,$_,$y=$_>0?$_%2:2,~$_%2,$y,$_ for<>;print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke stands on a number line. He has L ears, and he will walk along the line continuously under the following conditions:\n\nHe never visits a point with coordinate less than 0, or a point with coordinate greater than L.\n\nHe starts walking at a point with integer coordinate, and also finishes walking at a point with integer coordinate.\n\nHe only changes direction at a point with integer coordinate.\n\nEach time when Snuke passes a point with coordinate i-0.5, where i is an integer, he put a stone in his i-th ear.\n\nAfter Snuke finishes walking, Ringo will repeat the following operations in some order so that, for each i, Snuke's i-th ear contains A_i stones:\n\nPut a stone in one of Snuke's ears.\n\nRemove a stone from one of Snuke's ears.\n\nFind the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nConstraints\n\n1 \\leq L \\leq 2\\times 10^5\n\n0 \\leq A_i \\leq 10^9(1\\leq i\\leq L)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\nA_1\n:\nA_L\n\nOutput\n\nPrint the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nSample Input 1\n\n4\n1\n0\n2\n3\n\nSample Output 1\n\n1\n\nAssume that Snuke walks as follows:\n\nHe starts walking at coordinate 3 and finishes walking at coordinate 4, visiting coordinates 3,4,3,2,3,4 in this order.\n\nThen, Snuke's four ears will contain 0,0,2,3 stones, respectively.\nRingo can satisfy the requirement by putting one stone in the first ear.\n\nSample Input 2\n\n8\n2\n0\n0\n2\n1\n3\n4\n1\n\nSample Output 2\n\n3\n\nSample Input 3\n\n7\n314159265\n358979323\n846264338\n327950288\n419716939\n937510582\n0\n\nSample Output 3\n\n1", "sample_input": "4\n1\n0\n2\n3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03132", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke stands on a number line. He has L ears, and he will walk along the line continuously under the following conditions:\n\nHe never visits a point with coordinate less than 0, or a point with coordinate greater than L.\n\nHe starts walking at a point with integer coordinate, and also finishes walking at a point with integer coordinate.\n\nHe only changes direction at a point with integer coordinate.\n\nEach time when Snuke passes a point with coordinate i-0.5, where i is an integer, he put a stone in his i-th ear.\n\nAfter Snuke finishes walking, Ringo will repeat the following operations in some order so that, for each i, Snuke's i-th ear contains A_i stones:\n\nPut a stone in one of Snuke's ears.\n\nRemove a stone from one of Snuke's ears.\n\nFind the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nConstraints\n\n1 \\leq L \\leq 2\\times 10^5\n\n0 \\leq A_i \\leq 10^9(1\\leq i\\leq L)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\nA_1\n:\nA_L\n\nOutput\n\nPrint the minimum number of operations required when Ringo can freely decide how Snuke walks.\n\nSample Input 1\n\n4\n1\n0\n2\n3\n\nSample Output 1\n\n1\n\nAssume that Snuke walks as follows:\n\nHe starts walking at coordinate 3 and finishes walking at coordinate 4, visiting coordinates 3,4,3,2,3,4 in this order.\n\nThen, Snuke's four ears will contain 0,0,2,3 stones, respectively.\nRingo can satisfy the requirement by putting one stone in the first ear.\n\nSample Input 2\n\n8\n2\n0\n0\n2\n1\n3\n4\n1\n\nSample Output 2\n\n3\n\nSample Input 3\n\n7\n314159265\n358979323\n846264338\n327950288\n419716939\n937510582\n0\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1562, "memory_kb": 34944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s497063540", "group_id": "codeNet:p03134", "input_text": "@d=1;for($#d=4e3;$%+=getc=~/./&&($c-=$&,2);$d[$%--+$c]=0){($d[$_]+=$d[$_+1])%=998244353for$c..-1}print$d[$c]", "language": "Perl", "metadata": {"date": 1550041394, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03134.html", "problem_id": "p03134", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03134/input.txt", "sample_output_relpath": "derived/input_output/data/p03134/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03134/Perl/s497063540.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s497063540", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "@d=1;for($#d=4e3;$%+=getc=~/./&&($c-=$&,2);$d[$%--+$c]=0){($d[$_]+=$d[$_+1])%=998244353for$c..-1}print$d[$c]", "problem_context": "Score : 900 points\n\nProblem Statement\n\nThere are N Snukes lining up in a row.\nYou are given a string S of length N. The i-th Snuke from the front has two red balls if the i-th character in S is 0; one red ball and one blue ball if the i-th character in S is 1; two blue balls if the i-th character in S is 2.\n\nTakahashi has a sequence that is initially empty. Find the number of the possible sequences he may have after repeating the following procedure 2N times, modulo 998244353:\n\nEach Snuke who has one or more balls simultaneously chooses one of his balls and hand it to the Snuke in front of him, or hand it to Takahashi if he is the first Snuke in the row.\n\nTakahashi receives the ball and put it to the end of his sequence.\n\nConstraints\n\n1 \\leq |S| \\leq 2000\n\nS consists of 0,1 and 2.\n\nNote that the integer N is not directly given in input; it is given indirectly as the length of the string S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of the possible sequences Takahashi may have after repeating the procedure 2N times, modulo 998244353.\n\nSample Input 1\n\n02\n\nSample Output 1\n\n3\n\nThere are three sequences that Takahashi may have: rrbb, rbrb and rbbr, where r and b stand for red and blue balls, respectively.\n\nSample Input 2\n\n1210\n\nSample Output 2\n\n55\n\nSample Input 3\n\n12001021211100201020\n\nSample Output 3\n\n543589959", "sample_input": "02\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03134", "source_text": "Score : 900 points\n\nProblem Statement\n\nThere are N Snukes lining up in a row.\nYou are given a string S of length N. The i-th Snuke from the front has two red balls if the i-th character in S is 0; one red ball and one blue ball if the i-th character in S is 1; two blue balls if the i-th character in S is 2.\n\nTakahashi has a sequence that is initially empty. Find the number of the possible sequences he may have after repeating the following procedure 2N times, modulo 998244353:\n\nEach Snuke who has one or more balls simultaneously chooses one of his balls and hand it to the Snuke in front of him, or hand it to Takahashi if he is the first Snuke in the row.\n\nTakahashi receives the ball and put it to the end of his sequence.\n\nConstraints\n\n1 \\leq |S| \\leq 2000\n\nS consists of 0,1 and 2.\n\nNote that the integer N is not directly given in input; it is given indirectly as the length of the string S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of the possible sequences Takahashi may have after repeating the procedure 2N times, modulo 998244353.\n\nSample Input 1\n\n02\n\nSample Output 1\n\n3\n\nThere are three sequences that Takahashi may have: rrbb, rbrb and rbbr, where r and b stand for red and blue balls, respectively.\n\nSample Input 2\n\n1210\n\nSample Output 2\n\n55\n\nSample Input 3\n\n12001021211100201020\n\nSample Output 3\n\n543589959", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 108, "cpu_time_ms": 2103, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s431301259", "group_id": "codeNet:p03134", "input_text": "@d=$t=1;\n$/=\\1;\nfor(;$t+=($j=ord<>)>10?($c+=$j%3,1):-1;$d[$c<$t?$t:$c-$t]=0){\n\tfor($j=$c;$j;){\n\t\t$d[$j]-=($d[$j]+=$d[--$j])>119<<23&&998244353\n\t}\n}\nprint$d[$c]+0", "language": "Perl", "metadata": {"date": 1550024044, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03134.html", "problem_id": "p03134", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03134/input.txt", "sample_output_relpath": "derived/input_output/data/p03134/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03134/Perl/s431301259.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s431301259", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "@d=$t=1;\n$/=\\1;\nfor(;$t+=($j=ord<>)>10?($c+=$j%3,1):-1;$d[$c<$t?$t:$c-$t]=0){\n\tfor($j=$c;$j;){\n\t\t$d[$j]-=($d[$j]+=$d[--$j])>119<<23&&998244353\n\t}\n}\nprint$d[$c]+0", "problem_context": "Score : 900 points\n\nProblem Statement\n\nThere are N Snukes lining up in a row.\nYou are given a string S of length N. The i-th Snuke from the front has two red balls if the i-th character in S is 0; one red ball and one blue ball if the i-th character in S is 1; two blue balls if the i-th character in S is 2.\n\nTakahashi has a sequence that is initially empty. Find the number of the possible sequences he may have after repeating the following procedure 2N times, modulo 998244353:\n\nEach Snuke who has one or more balls simultaneously chooses one of his balls and hand it to the Snuke in front of him, or hand it to Takahashi if he is the first Snuke in the row.\n\nTakahashi receives the ball and put it to the end of his sequence.\n\nConstraints\n\n1 \\leq |S| \\leq 2000\n\nS consists of 0,1 and 2.\n\nNote that the integer N is not directly given in input; it is given indirectly as the length of the string S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of the possible sequences Takahashi may have after repeating the procedure 2N times, modulo 998244353.\n\nSample Input 1\n\n02\n\nSample Output 1\n\n3\n\nThere are three sequences that Takahashi may have: rrbb, rbrb and rbbr, where r and b stand for red and blue balls, respectively.\n\nSample Input 2\n\n1210\n\nSample Output 2\n\n55\n\nSample Input 3\n\n12001021211100201020\n\nSample Output 3\n\n543589959", "sample_input": "02\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03134", "source_text": "Score : 900 points\n\nProblem Statement\n\nThere are N Snukes lining up in a row.\nYou are given a string S of length N. The i-th Snuke from the front has two red balls if the i-th character in S is 0; one red ball and one blue ball if the i-th character in S is 1; two blue balls if the i-th character in S is 2.\n\nTakahashi has a sequence that is initially empty. Find the number of the possible sequences he may have after repeating the following procedure 2N times, modulo 998244353:\n\nEach Snuke who has one or more balls simultaneously chooses one of his balls and hand it to the Snuke in front of him, or hand it to Takahashi if he is the first Snuke in the row.\n\nTakahashi receives the ball and put it to the end of his sequence.\n\nConstraints\n\n1 \\leq |S| \\leq 2000\n\nS consists of 0,1 and 2.\n\nNote that the integer N is not directly given in input; it is given indirectly as the length of the string S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of the possible sequences Takahashi may have after repeating the procedure 2N times, modulo 998244353.\n\nSample Input 1\n\n02\n\nSample Output 1\n\n3\n\nThere are three sequences that Takahashi may have: rrbb, rbrb and rbbr, where r and b stand for red and blue balls, respectively.\n\nSample Input 2\n\n1210\n\nSample Output 2\n\n55\n\nSample Input 3\n\n12001021211100201020\n\nSample Output 3\n\n543589959", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 161, "cpu_time_ms": 2103, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s369698043", "group_id": "codeNet:p03135", "input_text": "say [/] get.words", "language": "Perl", "metadata": {"date": 1549249807, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03135.html", "problem_id": "p03135", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03135/input.txt", "sample_output_relpath": "derived/input_output/data/p03135/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03135/Perl/s369698043.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s369698043", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2.6666666667\n", "input_to_evaluate": "say [/] get.words", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn order to pass the entrance examination tomorrow, Taro has to study for T more hours.\n\nFortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).\n\nWhile (X \\times t) hours pass in World B, t hours pass in World A.\n\nHow many hours will pass in World A while Taro studies for T hours in World B?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq T \\leq 100\n\n1 \\leq X \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT X\n\nOutput\n\nPrint the number of hours that will pass in World A.\n\nThe output will be regarded as correct when its absolute or relative error from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n8 3\n\nSample Output 1\n\n2.6666666667\n\nWhile Taro studies for eight hours in World B where time passes three times as fast, 2.6666... hours will pass in World A.\n\nNote that an absolute or relative error of at most 10^{-3} is allowed.\n\nSample Input 2\n\n99 1\n\nSample Output 2\n\n99.0000000000\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n0.0100000000", "sample_input": "8 3\n"}, "reference_outputs": ["2.6666666667\n"], "source_document_id": "p03135", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn order to pass the entrance examination tomorrow, Taro has to study for T more hours.\n\nFortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).\n\nWhile (X \\times t) hours pass in World B, t hours pass in World A.\n\nHow many hours will pass in World A while Taro studies for T hours in World B?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq T \\leq 100\n\n1 \\leq X \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT X\n\nOutput\n\nPrint the number of hours that will pass in World A.\n\nThe output will be regarded as correct when its absolute or relative error from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n8 3\n\nSample Output 1\n\n2.6666666667\n\nWhile Taro studies for eight hours in World B where time passes three times as fast, 2.6666... hours will pass in World A.\n\nNote that an absolute or relative error of at most 10^{-3} is allowed.\n\nSample Input 2\n\n99 1\n\nSample Output 2\n\n99.0000000000\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n0.0100000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 17, "cpu_time_ms": 262, "memory_kb": 62204}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s142320100", "group_id": "codeNet:p03136", "input_text": "get;$_=+<[.sum-.max*2>0]", "language": "Perl", "metadata": {"date": 1550804843, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03136.html", "problem_id": "p03136", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03136/input.txt", "sample_output_relpath": "derived/input_output/data/p03136/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03136/Perl/s142320100.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s142320100", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "get;$_=+<[.sum-.max*2>0]", "problem_context": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "sample_input": "4\n3 8 5 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03136", "source_text": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 313, "memory_kb": 63908}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s037952117", "group_id": "codeNet:p03137", "input_text": "my @NM = split(' ', );\nmy ($N, $M) = @NM;\nmy @X = split(' ', );\n@X = sort { $a <=> $b } @X;\nmy @d;\nfor my $i (1..$#X) {\n\tpush(@d, abs($X[$i] - $X[$i - 1]));\n}\n@d = sort { $a <=> $b } @d;\n@d = splice(@d, 0, $M - $N);\n\nmy $sum = 0;\nfor my $d (@d) {\n\t$sum += $d;\n}\nprint $sum;\n", "language": "Perl", "metadata": {"date": 1549251027, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03137.html", "problem_id": "p03137", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03137/input.txt", "sample_output_relpath": "derived/input_output/data/p03137/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03137/Perl/s037952117.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s037952117", "user_id": "u130813824"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "my @NM = split(' ', );\nmy ($N, $M) = @NM;\nmy @X = split(' ', );\n@X = sort { $a <=> $b } @X;\nmy @d;\nfor my $i (1..$#X) {\n\tpush(@d, abs($X[$i] - $X[$i - 1]));\n}\n@d = sort { $a <=> $b } @d;\n@d = splice(@d, 0, $M - $N);\n\nmy $sum = 0;\nfor my $d (@d) {\n\t$sum += $d;\n}\nprint $sum;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "sample_input": "2 5\n10 12 1 2 14\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03137", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 288, "cpu_time_ms": 116, "memory_kb": 19132}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s523025935", "group_id": "codeNet:p03139", "input_text": "@line = split(/ /, );\n\n$N = $line[0];\n$A = $line[1];\n$B = $line[2];\n\nif ($A < $B) {\n $Ans1 = $A;\n} else {\n $Ans1 = $B;\n}\n\nif ($N > $A + $B) {\n $Ans2 = 0;\n} else {\n $Ans2 = ($A + $B) - $N;\n}\n\n\nprint \"$Ans1 $Ans2\\n\";\n", "language": "Perl", "metadata": {"date": 1548642826, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03139.html", "problem_id": "p03139", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03139/input.txt", "sample_output_relpath": "derived/input_output/data/p03139/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03139/Perl/s523025935.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s523025935", "user_id": "u463508504"}, "prompt_components": {"gold_output": "3 0\n", "input_to_evaluate": "@line = split(/ /, );\n\n$N = $line[0];\n$A = $line[1];\n$B = $line[2];\n\nif ($A < $B) {\n $Ans1 = $A;\n} else {\n $Ans1 = $B;\n}\n\nif ($N > $A + $B) {\n $Ans2 = 0;\n} else {\n $Ans2 = ($A + $B) - $N;\n}\n\n\nprint \"$Ans1 $Ans2\\n\";\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe conducted a survey on newspaper subscriptions.\nMore specifically, we asked each of the N respondents the following two questions:\n\nQuestion 1: Are you subscribing to Newspaper X?\n\nQuestion 2: Are you subscribing to Newspaper Y?\n\nAs the result, A respondents answered \"yes\" to Question 1, and B respondents answered \"yes\" to Question 2.\n\nWhat are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?\n\nWrite a program to answer this question.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq A \\leq N\n\n0 \\leq B \\leq N\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 maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.\n\nSample Input 1\n\n10 3 5\n\nSample Output 1\n\n3 0\n\nIn this sample, out of the 10 respondents, 3 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 3 and at least 0.\n\nSample Input 2\n\n10 7 5\n\nSample Output 2\n\n5 2\n\nIn this sample, out of the 10 respondents, 7 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 5 and at least 2.\n\nSample Input 3\n\n100 100 100\n\nSample Output 3\n\n100 100", "sample_input": "10 3 5\n"}, "reference_outputs": ["3 0\n"], "source_document_id": "p03139", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe conducted a survey on newspaper subscriptions.\nMore specifically, we asked each of the N respondents the following two questions:\n\nQuestion 1: Are you subscribing to Newspaper X?\n\nQuestion 2: Are you subscribing to Newspaper Y?\n\nAs the result, A respondents answered \"yes\" to Question 1, and B respondents answered \"yes\" to Question 2.\n\nWhat are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?\n\nWrite a program to answer this question.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq A \\leq N\n\n0 \\leq B \\leq N\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 maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.\n\nSample Input 1\n\n10 3 5\n\nSample Output 1\n\n3 0\n\nIn this sample, out of the 10 respondents, 3 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 3 and at least 0.\n\nSample Input 2\n\n10 7 5\n\nSample Output 2\n\n5 2\n\nIn this sample, out of the 10 respondents, 7 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 5 and at least 2.\n\nSample Input 3\n\n100 100 100\n\nSample Output 3\n\n100 100", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s309123506", "group_id": "codeNet:p03140", "input_text": "say get*3-[Z(+)](lines>>.comb)>>.values>>.max.sum", "language": "Perl", "metadata": {"date": 1548648073, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03140.html", "problem_id": "p03140", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03140/input.txt", "sample_output_relpath": "derived/input_output/data/p03140/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03140/Perl/s309123506.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s309123506", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "say get*3-[Z(+)](lines>>.comb)>>.values>>.max.sum", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters.\n\nOur objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:\n\nOperation: Choose one of the strings A, B and C, and specify an integer i between 1 and N (inclusive). Change the i-th character from the beginning of the chosen string to some other lowercase English letter.\n\nWhat is the minimum number of operations required to achieve the objective?\n\nConstraints\n\n1 \\leq N \\leq 100\n\nEach of the strings A, B and C is a string of length N.\n\nEach character in each of the strings A, B and C is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\nwest\neast\nwait\n\nSample Output 1\n\n3\n\nIn this sample, initially A = west、B = east、C = wait. We can achieve the objective in the minimum number of operations by performing three operations as follows:\n\nChange the second character in A to a. A is now wast.\n\nChange the first character in B to w. B is now wast.\n\nChange the third character in C to s. C is now wast.\n\nSample Input 2\n\n9\ndifferent\ndifferent\ndifferent\n\nSample Output 2\n\n0\n\nIf A, B and C are already equal in the beginning, the number of operations required is 0.\n\nSample Input 3\n\n7\nzenkoku\ntouitsu\nprogram\n\nSample Output 3\n\n13", "sample_input": "4\nwest\neast\nwait\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03140", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters.\n\nOur objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:\n\nOperation: Choose one of the strings A, B and C, and specify an integer i between 1 and N (inclusive). Change the i-th character from the beginning of the chosen string to some other lowercase English letter.\n\nWhat is the minimum number of operations required to achieve the objective?\n\nConstraints\n\n1 \\leq N \\leq 100\n\nEach of the strings A, B and C is a string of length N.\n\nEach character in each of the strings A, B and C is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\nwest\neast\nwait\n\nSample Output 1\n\n3\n\nIn this sample, initially A = west、B = east、C = wait. We can achieve the objective in the minimum number of operations by performing three operations as follows:\n\nChange the second character in A to a. A is now wast.\n\nChange the first character in B to w. B is now wast.\n\nChange the third character in C to s. C is now wast.\n\nSample Input 2\n\n9\ndifferent\ndifferent\ndifferent\n\nSample Output 2\n\n0\n\nIf A, B and C are already equal in the beginning, the number of operations required is 0.\n\nSample Input 3\n\n7\nzenkoku\ntouitsu\nprogram\n\nSample Output 3\n\n13", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 49, "cpu_time_ms": 322, "memory_kb": 70064}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s524671367", "group_id": "codeNet:p03140", "input_text": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\n( my $a = ) =~ s/[\\x0a\\x0d]+$//ios;\n( my $b = ) =~ s/[\\x0a\\x0d]+$//ios;\n( my $c = ) =~ s/[\\x0a\\x0d]+$//ios;\n\nmy $tot = 0;\nfor(my $i=0;$i<$n;$i++){\n my $x = substr($a,$i,1);\n my $y = substr($b,$i,1);\n my $z = substr($c,$i,1);\n if( $x eq $y and $x eq $z ){\n $tot += 0;\n } elsif ( $x eq $y or $y eq $z or $z eq $x ){\n $tot += 1;\n } else {\n $tot += 2;\n }\n}\nprint \"$tot\\n\";\n", "language": "Perl", "metadata": {"date": 1548641236, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03140.html", "problem_id": "p03140", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03140/input.txt", "sample_output_relpath": "derived/input_output/data/p03140/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03140/Perl/s524671367.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s524671367", "user_id": "u750383873"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($n) = map { $_ - 0 } split(/\\s+/,);\n( my $a = ) =~ s/[\\x0a\\x0d]+$//ios;\n( my $b = ) =~ s/[\\x0a\\x0d]+$//ios;\n( my $c = ) =~ s/[\\x0a\\x0d]+$//ios;\n\nmy $tot = 0;\nfor(my $i=0;$i<$n;$i++){\n my $x = substr($a,$i,1);\n my $y = substr($b,$i,1);\n my $z = substr($c,$i,1);\n if( $x eq $y and $x eq $z ){\n $tot += 0;\n } elsif ( $x eq $y or $y eq $z or $z eq $x ){\n $tot += 1;\n } else {\n $tot += 2;\n }\n}\nprint \"$tot\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters.\n\nOur objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:\n\nOperation: Choose one of the strings A, B and C, and specify an integer i between 1 and N (inclusive). Change the i-th character from the beginning of the chosen string to some other lowercase English letter.\n\nWhat is the minimum number of operations required to achieve the objective?\n\nConstraints\n\n1 \\leq N \\leq 100\n\nEach of the strings A, B and C is a string of length N.\n\nEach character in each of the strings A, B and C is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\nwest\neast\nwait\n\nSample Output 1\n\n3\n\nIn this sample, initially A = west、B = east、C = wait. We can achieve the objective in the minimum number of operations by performing three operations as follows:\n\nChange the second character in A to a. A is now wast.\n\nChange the first character in B to w. B is now wast.\n\nChange the third character in C to s. C is now wast.\n\nSample Input 2\n\n9\ndifferent\ndifferent\ndifferent\n\nSample Output 2\n\n0\n\nIf A, B and C are already equal in the beginning, the number of operations required is 0.\n\nSample Input 3\n\n7\nzenkoku\ntouitsu\nprogram\n\nSample Output 3\n\n13", "sample_input": "4\nwest\neast\nwait\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03140", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters.\n\nOur objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:\n\nOperation: Choose one of the strings A, B and C, and specify an integer i between 1 and N (inclusive). Change the i-th character from the beginning of the chosen string to some other lowercase English letter.\n\nWhat is the minimum number of operations required to achieve the objective?\n\nConstraints\n\n1 \\leq N \\leq 100\n\nEach of the strings A, B and C is a string of length N.\n\nEach character in each of the strings A, B and C is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\nwest\neast\nwait\n\nSample Output 1\n\n3\n\nIn this sample, initially A = west、B = east、C = wait. We can achieve the objective in the minimum number of operations by performing three operations as follows:\n\nChange the second character in A to a. A is now wast.\n\nChange the first character in B to w. B is now wast.\n\nChange the third character in C to s. C is now wast.\n\nSample Input 2\n\n9\ndifferent\ndifferent\ndifferent\n\nSample Output 2\n\n0\n\nIf A, B and C are already equal in the beginning, the number of operations required is 0.\n\nSample Input 3\n\n7\nzenkoku\ntouitsu\nprogram\n\nSample Output 3\n\n13", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s235332475", "group_id": "codeNet:p03141", "input_text": "$ii = 0;\nwhile(){\n\tchomp;\n\tif ($_ =~ /.+/) {\n \tif ($ii == 0) {\n \t$N = $_\n } else {\n \t@line = split(/ /, $_);\n $data[$ii-1][0] = $line[0] + $line[1];\n $data[$ii-1][1] = $line[0]; # Takahashi\n $data[$ii-1][2] = $line[1]; # Aoki\n }\n $ii++;\n }\n}\n\n@score = sort { $b->[0] <=> $a->[0] } @data;\n\n$Ans = 0;\nfor ($ii = 0; $ii < $N; $ii++) {\n if ($ii % 2 == 0) {\n $Ans += $score[$ii][1];\n } else {\n $Ans -= $score[$ii][2];\n }\n}\n\nprint \"$Ans\\n\";\n\n", "language": "Perl", "metadata": {"date": 1549161499, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03141.html", "problem_id": "p03141", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03141/input.txt", "sample_output_relpath": "derived/input_output/data/p03141/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03141/Perl/s235332475.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s235332475", "user_id": "u463508504"}, "prompt_components": {"gold_output": "20\n", "input_to_evaluate": "$ii = 0;\nwhile(){\n\tchomp;\n\tif ($_ =~ /.+/) {\n \tif ($ii == 0) {\n \t$N = $_\n } else {\n \t@line = split(/ /, $_);\n $data[$ii-1][0] = $line[0] + $line[1];\n $data[$ii-1][1] = $line[0]; # Takahashi\n $data[$ii-1][2] = $line[1]; # Aoki\n }\n $ii++;\n }\n}\n\n@score = sort { $b->[0] <=> $a->[0] } @data;\n\n$Ans = 0;\nfor ($ii = 0; $ii < $N; $ii++) {\n if ($ii % 2 == 0) {\n $Ans += $score[$ii][1];\n } else {\n $Ans -= $score[$ii][2];\n }\n}\n\nprint \"$Ans\\n\";\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N dishes of cuisine placed in front of Takahashi and Aoki.\nFor convenience, we call these dishes Dish 1, Dish 2, ..., Dish N.\n\nWhen Takahashi eats Dish i, he earns A_i points of happiness; when Aoki eats Dish i, she earns B_i points of happiness.\n\nStarting from Takahashi, they alternately choose one dish and eat it, until there is no more dish to eat.\nHere, both of them choose dishes so that the following value is maximized: \"the sum of the happiness he/she will earn in the end\" minus \"the sum of the happiness the other person will earn in the end\".\n\nFind the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\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\nAll values in input are integers.\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 value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nSample Input 1\n\n3\n10 10\n20 20\n30 30\n\nSample Output 1\n\n20\n\nIn this sample, both of them earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since Takahashi and Aoki have the same \"taste\", each time they will choose the dish with which they can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (30 + 10) - 20 = 20.\n\nSample Input 2\n\n3\n20 10\n20 20\n20 30\n\nSample Output 2\n\n20\n\nIn this sample, Takahashi earns 20 points of happiness by eating any one of the dishes 1, 2 and 3, but Aoki earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since only Aoki has likes and dislikes, each time they will choose the dish with which Aoki can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (20 + 20) - 20 = 20.\n\nSample Input 3\n\n6\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 3\n\n-2999999997\n\nNote that the answer may not fit into a 32-bit integer.", "sample_input": "3\n10 10\n20 20\n30 30\n"}, "reference_outputs": ["20\n"], "source_document_id": "p03141", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N dishes of cuisine placed in front of Takahashi and Aoki.\nFor convenience, we call these dishes Dish 1, Dish 2, ..., Dish N.\n\nWhen Takahashi eats Dish i, he earns A_i points of happiness; when Aoki eats Dish i, she earns B_i points of happiness.\n\nStarting from Takahashi, they alternately choose one dish and eat it, until there is no more dish to eat.\nHere, both of them choose dishes so that the following value is maximized: \"the sum of the happiness he/she will earn in the end\" minus \"the sum of the happiness the other person will earn in the end\".\n\nFind the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\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\nAll values in input are integers.\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 value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nSample Input 1\n\n3\n10 10\n20 20\n30 30\n\nSample Output 1\n\n20\n\nIn this sample, both of them earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since Takahashi and Aoki have the same \"taste\", each time they will choose the dish with which they can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (30 + 10) - 20 = 20.\n\nSample Input 2\n\n3\n20 10\n20 20\n20 30\n\nSample Output 2\n\n20\n\nIn this sample, Takahashi earns 20 points of happiness by eating any one of the dishes 1, 2 and 3, but Aoki earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since only Aoki has likes and dislikes, each time they will choose the dish with which Aoki can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (20 + 20) - 20 = 20.\n\nSample Input 3\n\n6\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 3\n\n-2999999997\n\nNote that the answer may not fit into a 32-bit integer.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 662, "memory_kb": 36732}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s809591846", "group_id": "codeNet:p03142", "input_text": "$ii = 0;\nwhile(){\n\tchomp;\n\tif ($_ =~ /.+/) {\n \tif ($ii == 0) {\n \t$N = [split(/ /, $_)]->[0];\n \t$M = [split(/ /, $_)]->[1];\n } else {\n \t@line = split(/ /, $_);\n $data[$ii-1][0] = $line[0];\n $data[$ii-1][1] = $line[1];\n }\n $ii++;\n }\n}\n\n$Ans = 0;\nfor ($node = 1; $node <= $N; $node++) {\n\t$tree[$node][0] = 0;\t# Generation\n\t$tree[$node][1] = 0;\t# Parent\n}\n\nfor ($gen = 0; $gen < $N; $gen++) {\n for ($node = 1; $node <= $N; $node++) {\n if ( $tree[$node][0] == $gen ) {\n for ($ii = 0; $ii <= $#data; $ii++) {\n \tif ($node == $data[$ii][1]) {\n\t \tif ($gen <= $tree[$data[$ii][0]][0]) {\n $tree[$node][0] = $gen + 1;\n $tree[$node][1] = $data[$ii][0];\n\t }\n }\n }\n }\n }\n}\n\nfor ($node = 1; $node <= $N; $node++) {\n #print \"$node $tree[$node][0] $tree[$node][1]\\n\";\n print \"$tree[$node][1]\\n\";\n}\n\n", "language": "Perl", "metadata": {"date": 1549169857, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03142.html", "problem_id": "p03142", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03142/input.txt", "sample_output_relpath": "derived/input_output/data/p03142/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03142/Perl/s809591846.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s809591846", "user_id": "u463508504"}, "prompt_components": {"gold_output": "0\n1\n2\n", "input_to_evaluate": "$ii = 0;\nwhile(){\n\tchomp;\n\tif ($_ =~ /.+/) {\n \tif ($ii == 0) {\n \t$N = [split(/ /, $_)]->[0];\n \t$M = [split(/ /, $_)]->[1];\n } else {\n \t@line = split(/ /, $_);\n $data[$ii-1][0] = $line[0];\n $data[$ii-1][1] = $line[1];\n }\n $ii++;\n }\n}\n\n$Ans = 0;\nfor ($node = 1; $node <= $N; $node++) {\n\t$tree[$node][0] = 0;\t# Generation\n\t$tree[$node][1] = 0;\t# Parent\n}\n\nfor ($gen = 0; $gen < $N; $gen++) {\n for ($node = 1; $node <= $N; $node++) {\n if ( $tree[$node][0] == $gen ) {\n for ($ii = 0; $ii <= $#data; $ii++) {\n \tif ($node == $data[$ii][1]) {\n\t \tif ($gen <= $tree[$data[$ii][0]][0]) {\n $tree[$node][0] = $gen + 1;\n $tree[$node][1] = $data[$ii][0];\n\t }\n }\n }\n }\n }\n}\n\nfor ($node = 1; $node <= $N; $node++) {\n #print \"$node $tree[$node][0] $tree[$node][1]\\n\";\n print \"$tree[$node][1]\\n\";\n}\n\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is a rooted tree (see Notes) with N vertices numbered 1 to N.\nEach of the vertices, except the root, has a directed edge coming from its parent.\nNote that the root may not be Vertex 1.\n\nTakahashi has added M new directed edges to this graph.\nEach of these M edges, u \\rightarrow v, extends from some vertex u to its descendant v.\n\nYou are given the directed graph with N vertices and N-1+M edges after Takahashi added edges.\nMore specifically, you are given N-1+M pairs of integers, (A_1, B_1), ..., (A_{N-1+M}, B_{N-1+M}), which represent that the i-th edge extends from Vertex A_i to Vertex B_i.\n\nRestore the original rooted tree.\n\nNotes\n\nFor \"tree\" and other related terms in graph theory, see the article in Wikipedia, for example.\n\nConstraints\n\n3 \\leq N\n\n1 \\leq M\n\nN + M \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\nIf i \\neq j, (A_i, B_i) \\neq (A_j, B_j).\n\nThe graph in input can be obtained by adding M edges satisfying the condition in the problem statement to a rooted tree with N vertices.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_{N-1+M} B_{N-1+M}\n\nOutput\n\nPrint N lines.\nIn the i-th line, print 0 if Vertex i is the root of the original tree, and otherwise print the integer representing the parent of Vertex i in the original tree.\n\nNote that it can be shown that the original tree is uniquely determined.\n\nSample Input 1\n\n3 1\n1 2\n1 3\n2 3\n\nSample Output 1\n\n0\n1\n2\n\nThe graph in this input is shown below:\n\nIt can be seen that this graph is obtained by adding the edge 1 \\rightarrow 3 to the rooted tree 1 \\rightarrow 2 \\rightarrow 3.\n\nSample Input 2\n\n6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n4 6\n6 5\n\nSample Output 2\n\n6\n4\n2\n0\n6\n2", "sample_input": "3 1\n1 2\n1 3\n2 3\n"}, "reference_outputs": ["0\n1\n2\n"], "source_document_id": "p03142", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is a rooted tree (see Notes) with N vertices numbered 1 to N.\nEach of the vertices, except the root, has a directed edge coming from its parent.\nNote that the root may not be Vertex 1.\n\nTakahashi has added M new directed edges to this graph.\nEach of these M edges, u \\rightarrow v, extends from some vertex u to its descendant v.\n\nYou are given the directed graph with N vertices and N-1+M edges after Takahashi added edges.\nMore specifically, you are given N-1+M pairs of integers, (A_1, B_1), ..., (A_{N-1+M}, B_{N-1+M}), which represent that the i-th edge extends from Vertex A_i to Vertex B_i.\n\nRestore the original rooted tree.\n\nNotes\n\nFor \"tree\" and other related terms in graph theory, see the article in Wikipedia, for example.\n\nConstraints\n\n3 \\leq N\n\n1 \\leq M\n\nN + M \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\nIf i \\neq j, (A_i, B_i) \\neq (A_j, B_j).\n\nThe graph in input can be obtained by adding M edges satisfying the condition in the problem statement to a rooted tree with N vertices.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_{N-1+M} B_{N-1+M}\n\nOutput\n\nPrint N lines.\nIn the i-th line, print 0 if Vertex i is the root of the original tree, and otherwise print the integer representing the parent of Vertex i in the original tree.\n\nNote that it can be shown that the original tree is uniquely determined.\n\nSample Input 1\n\n3 1\n1 2\n1 3\n2 3\n\nSample Output 1\n\n0\n1\n2\n\nThe graph in this input is shown below:\n\nIt can be seen that this graph is obtained by adding the edge 1 \\rightarrow 3 to the rooted tree 1 \\rightarrow 2 \\rightarrow 3.\n\nSample Input 2\n\n6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n4 6\n6 5\n\nSample Output 2\n\n6\n4\n2\n0\n6\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1004, "cpu_time_ms": 2107, "memory_kb": 52228}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s941788926", "group_id": "codeNet:p03145", "input_text": " use warnings;\n use Data::Dumper;\n \n sub GetInputData{\n \n my @array_data;\n \n my $line = ;\n \n chomp($line);\n \n while($line ne \"\"){\n \n push(@array_data,$line);\n \n $line = ;\n \n chomp($line);\n \n }\n \n return @array_data;\n \n }\n \n sub GetSpaceInputData{\n \n my @array_temp=GetInputData();\n \n my @array_buf;\n \n for(@array_temp){\n \n #戻りは配列スペース区切りを分解\n # myを先頭につける必要あり\n my @array_work=split(\" \",$_);\n\n # リファレンスを配列に代入\n push(@array_buf,\\@array_work);\n }\n \n return @array_buf;\n \n }\n \n my @arr_result = GetSpaceInputData();\n\n my $ab = $arr_result[0][0];\n my $bc = $arr_result[0][1];\n\n print $ab*$bc / 2;\n \n \n ", "language": "Perl", "metadata": {"date": 1548605434, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03145.html", "problem_id": "p03145", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03145/input.txt", "sample_output_relpath": "derived/input_output/data/p03145/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03145/Perl/s941788926.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s941788926", "user_id": "u200239931"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": " use warnings;\n use Data::Dumper;\n \n sub GetInputData{\n \n my @array_data;\n \n my $line = ;\n \n chomp($line);\n \n while($line ne \"\"){\n \n push(@array_data,$line);\n \n $line = ;\n \n chomp($line);\n \n }\n \n return @array_data;\n \n }\n \n sub GetSpaceInputData{\n \n my @array_temp=GetInputData();\n \n my @array_buf;\n \n for(@array_temp){\n \n #戻りは配列スペース区切りを分解\n # myを先頭につける必要あり\n my @array_work=split(\" \",$_);\n\n # リファレンスを配列に代入\n push(@array_buf,\\@array_work);\n }\n \n return @array_buf;\n \n }\n \n my @arr_result = GetSpaceInputData();\n\n my $ab = $arr_result[0][0];\n my $bc = $arr_result[0][1];\n\n print $ab*$bc / 2;\n \n \n ", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "sample_input": "3 4 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03145", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 933, "cpu_time_ms": 14, "memory_kb": 1920}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s369801247", "group_id": "codeNet:p03146", "input_text": "chomp($t = <>);\n\n$cnt = 2;\n$f{$t} = 1;\nwhile(1){\n\t$t = ($t % 2 == 0) ? ($t / 2) : (($t * 3) + 1);\n\tlast if($f{$t} == 1);\n\t$f{$t} = 1;\n\t$cnt++;\n}\n\nprint \"$cnt\\n\";\n", "language": "Perl", "metadata": {"date": 1569300066, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03146.html", "problem_id": "p03146", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03146/input.txt", "sample_output_relpath": "derived/input_output/data/p03146/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03146/Perl/s369801247.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s369801247", "user_id": "u609426052"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "chomp($t = <>);\n\n$cnt = 2;\n$f{$t} = 1;\nwhile(1){\n\t$t = ($t % 2 == 0) ? ($t / 2) : (($t * 3) + 1);\n\tlast if($f{$t} == 1);\n\t$f{$t} = 1;\n\t$cnt++;\n}\n\nprint \"$cnt\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "sample_input": "8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03146", "source_text": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 162, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s359263660", "group_id": "codeNet:p03146", "input_text": "$n=$n%2?3*$n-1:$n/2until++$\\,${$n-=<>}++;print", "language": "Perl", "metadata": {"date": 1548054997, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03146.html", "problem_id": "p03146", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03146/input.txt", "sample_output_relpath": "derived/input_output/data/p03146/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03146/Perl/s359263660.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s359263660", "user_id": "u283869437"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "$n=$n%2?3*$n-1:$n/2until++$\\,${$n-=<>}++;print", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "sample_input": "8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03146", "source_text": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s077118158", "group_id": "codeNet:p03146", "input_text": "say 1+(get,{$_%2??$_*3+1!!$_/2}...2>*)max 4", "language": "Perl", "metadata": {"date": 1548036821, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03146.html", "problem_id": "p03146", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03146/input.txt", "sample_output_relpath": "derived/input_output/data/p03146/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03146/Perl/s077118158.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s077118158", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "say 1+(get,{$_%2??$_*3+1!!$_/2}...2>*)max 4", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "sample_input": "8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03146", "source_text": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 1178, "memory_kb": 64516}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s306225273", "group_id": "codeNet:p03149", "input_text": "[get.comb⊇1974.comb].say", "language": "Perl", "metadata": {"date": 1547412615, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03149.html", "problem_id": "p03149", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03149/input.txt", "sample_output_relpath": "derived/input_output/data/p03149/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03149/Perl/s306225273.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s306225273", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "[get.comb⊇1974.comb].say", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "sample_input": "1 7 9 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03149", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 34, "cpu_time_ms": 549, "memory_kb": 64380}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s970288106", "group_id": "codeNet:p03149", "input_text": "[get.words.sort.join~~1479].say", "language": "Perl", "metadata": {"date": 1547412549, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03149.html", "problem_id": "p03149", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03149/input.txt", "sample_output_relpath": "derived/input_output/data/p03149/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03149/Perl/s970288106.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s970288106", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "[get.words.sort.join~~1479].say", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "sample_input": "1 7 9 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03149", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 454, "memory_kb": 62336}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s790582634", "group_id": "codeNet:p03150", "input_text": "print<>=~/e$/?YES:NO", "language": "Perl", "metadata": {"date": 1547426514, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03150.html", "problem_id": "p03150", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03150/input.txt", "sample_output_relpath": "derived/input_output/data/p03150/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03150/Perl/s790582634.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s790582634", "user_id": "u049095189"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "print<>=~/e$/?YES:NO", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string is called a KEYENCE string when it can be changed to keyence by removing its contiguous substring (possibly empty) only once.\n\nGiven a string S consisting of lowercase English letters, determine if S is a KEYENCE string.\n\nConstraints\n\nThe length of S is between 7 and 100 (inclusive).\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 S is a KEYENCE string, print YES; otherwise, print NO.\n\nSample Input 1\n\nkeyofscience\n\nSample Output 1\n\nYES\n\nkeyence is an abbreviation of key of science.\n\nSample Input 2\n\nmpyszsbznf\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nashlfyha\n\nSample Output 3\n\nNO\n\nSample Input 4\n\nkeyence\n\nSample Output 4\n\nYES", "sample_input": "keyofscience\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03150", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string is called a KEYENCE string when it can be changed to keyence by removing its contiguous substring (possibly empty) only once.\n\nGiven a string S consisting of lowercase English letters, determine if S is a KEYENCE string.\n\nConstraints\n\nThe length of S is between 7 and 100 (inclusive).\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 S is a KEYENCE string, print YES; otherwise, print NO.\n\nSample Input 1\n\nkeyofscience\n\nSample Output 1\n\nYES\n\nkeyence is an abbreviation of key of science.\n\nSample Input 2\n\nmpyszsbznf\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nashlfyha\n\nSample Output 3\n\nNO\n\nSample Input 4\n\nkeyence\n\nSample Output 4\n\nYES", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s084138496", "group_id": "codeNet:p03155", "input_text": "#!/usr/bin/perl\n#= CPAN mocules =====================================================#\nuse strict;\t\t\t\t# strictモード\nuse warnings;\t\t\t# 警告有効\n\n#= Global values ====================================================#\n#= Local routines ===================================================#\nsub main(){\n\tmy @inData;\n\tforeach (0..2){\n\t\t$inData[$_] = <>;\n\t\tchomp $inData[$_];\n\t}\n\n\tmy $tate = $inData[0];\n\tmy $yoko = $inData[0];\n\n\t$tate -= $inData[1];\n\t$tate++;\n\t$yoko -= $inData[2];\n\t$yoko++;\n\t\n\tprint $tate * $yoko;\n\tprint \"\\n\";\n\n\treturn 0;\n}\n\n#----- 実行 -----#\nexit( main() );\n\n\n", "language": "Perl", "metadata": {"date": 1547323855, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03155.html", "problem_id": "p03155", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03155/input.txt", "sample_output_relpath": "derived/input_output/data/p03155/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03155/Perl/s084138496.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s084138496", "user_id": "u833717093"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n#= CPAN mocules =====================================================#\nuse strict;\t\t\t\t# strictモード\nuse warnings;\t\t\t# 警告有効\n\n#= Global values ====================================================#\n#= Local routines ===================================================#\nsub main(){\n\tmy @inData;\n\tforeach (0..2){\n\t\t$inData[$_] = <>;\n\t\tchomp $inData[$_];\n\t}\n\n\tmy $tate = $inData[0];\n\tmy $yoko = $inData[0];\n\n\t$tate -= $inData[1];\n\t$tate++;\n\t$yoko -= $inData[2];\n\t$yoko++;\n\t\n\tprint $tate * $yoko;\n\tprint \"\\n\";\n\n\treturn 0;\n}\n\n#----- 実行 -----#\nexit( main() );\n\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.\n\nThe bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.\n\nHow many ways are there to choose where to put the notice so that it completely covers exactly HW squares?\n\nConstraints\n\n1 \\leq H, W \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH\nW\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n\nSample Output 1\n\n2\n\nThere are two ways to put the notice, as follows:\n\n### ...\n### ###\n... ###\n\nHere, # represents a square covered by the notice, and . represents a square not covered.\n\nSample Input 2\n\n100\n1\n1\n\nSample Output 2\n\n10000\n\nSample Input 3\n\n5\n4\n2\n\nSample Output 3\n\n8", "sample_input": "3\n2\n3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03155", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.\n\nThe bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.\n\nHow many ways are there to choose where to put the notice so that it completely covers exactly HW squares?\n\nConstraints\n\n1 \\leq H, W \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH\nW\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n\nSample Output 1\n\n2\n\nThere are two ways to put the notice, as follows:\n\n### ...\n### ###\n... ###\n\nHere, # represents a square covered by the notice, and . represents a square not covered.\n\nSample Input 2\n\n100\n1\n1\n\nSample Output 2\n\n10000\n\nSample Input 3\n\n5\n4\n2\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 585, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s926312942", "group_id": "codeNet:p03155", "input_text": "$_={($//=get)-get+1};say .()*.()", "language": "Perl", "metadata": {"date": 1547323348, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03155.html", "problem_id": "p03155", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03155/input.txt", "sample_output_relpath": "derived/input_output/data/p03155/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03155/Perl/s926312942.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s926312942", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$_={($//=get)-get+1};say .()*.()", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.\n\nThe bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.\n\nHow many ways are there to choose where to put the notice so that it completely covers exactly HW squares?\n\nConstraints\n\n1 \\leq H, W \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH\nW\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n\nSample Output 1\n\n2\n\nThere are two ways to put the notice, as follows:\n\n### ...\n### ###\n... ###\n\nHere, # represents a square covered by the notice, and . represents a square not covered.\n\nSample Input 2\n\n100\n1\n1\n\nSample Output 2\n\n10000\n\nSample Input 3\n\n5\n4\n2\n\nSample Output 3\n\n8", "sample_input": "3\n2\n3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03155", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.\n\nThe bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.\n\nHow many ways are there to choose where to put the notice so that it completely covers exactly HW squares?\n\nConstraints\n\n1 \\leq H, W \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH\nW\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n\nSample Output 1\n\n2\n\nThere are two ways to put the notice, as follows:\n\n### ...\n### ###\n... ###\n\nHere, # represents a square covered by the notice, and . represents a square not covered.\n\nSample Input 2\n\n100\n1\n1\n\nSample Output 2\n\n10000\n\nSample Input 3\n\n5\n4\n2\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32, "cpu_time_ms": 1102, "memory_kb": 64796}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s044777610", "group_id": "codeNet:p03155", "input_text": "print+(($_=<>)-<>+1)*($_-<>+1)", "language": "Perl", "metadata": {"date": 1547323288, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03155.html", "problem_id": "p03155", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03155/input.txt", "sample_output_relpath": "derived/input_output/data/p03155/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03155/Perl/s044777610.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s044777610", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print+(($_=<>)-<>+1)*($_-<>+1)", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.\n\nThe bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.\n\nHow many ways are there to choose where to put the notice so that it completely covers exactly HW squares?\n\nConstraints\n\n1 \\leq H, W \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH\nW\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n\nSample Output 1\n\n2\n\nThere are two ways to put the notice, as follows:\n\n### ...\n### ###\n... ###\n\nHere, # represents a square covered by the notice, and . represents a square not covered.\n\nSample Input 2\n\n100\n1\n1\n\nSample Output 2\n\n10000\n\nSample Input 3\n\n5\n4\n2\n\nSample Output 3\n\n8", "sample_input": "3\n2\n3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03155", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.\n\nThe bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.\n\nHow many ways are there to choose where to put the notice so that it completely covers exactly HW squares?\n\nConstraints\n\n1 \\leq H, W \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH\nW\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n\nSample Output 1\n\n2\n\nThere are two ways to put the notice, as follows:\n\n### ...\n### ###\n... ###\n\nHere, # represents a square covered by the notice, and . represents a square not covered.\n\nSample Input 2\n\n100\n1\n1\n\nSample Output 2\n\n10000\n\nSample Input 3\n\n5\n4\n2\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s185569822", "group_id": "codeNet:p03156", "input_text": "$m=<>;<>=~$\";@a=0;\nfor(glob<>){\n if($_<=$`){$a[0]++}\n elsif($_>$'){$a[2]++}\n else{$a[1]++}\n}\n$m=$m<$_?$m:$_ for@a;\nprint$m", "language": "Perl", "metadata": {"date": 1562929660, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03156.html", "problem_id": "p03156", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03156/input.txt", "sample_output_relpath": "derived/input_output/data/p03156/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03156/Perl/s185569822.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s185569822", "user_id": "u573154728"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$m=<>;<>=~$\";@a=0;\nfor(glob<>){\n if($_<=$`){$a[0]++}\n elsif($_>$'){$a[2]++}\n else{$a[1]++}\n}\n$m=$m<$_?$m:$_ for@a;\nprint$m", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have written N problems to hold programming contests.\nThe i-th problem will have a score of P_i points if used in a contest.\n\nWith these problems, you would like to hold as many contests as possible under the following condition:\n\nA contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points.\n\nThe same problem should not be used in multiple contests.\nAt most how many contests can be held?\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1 \\leq P_i \\leq 20 (1 \\leq i \\leq N)\n\n1 \\leq A < B < 20\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA B\nP_1 P_2 ... P_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n5 15\n1 10 16 2 7 20 12\n\nSample Output 1\n\n2\n\nTwo contests can be held by putting the first, second, third problems and the fourth, fifth, sixth problems together.\n\nSample Input 2\n\n8\n3 8\n5 5 5 10 10 10 15 20\n\nSample Output 2\n\n0\n\nNo contest can be held, because there is no problem with a score of A = 3 or less.\n\nSample Input 3\n\n3\n5 6\n5 6 10\n\nSample Output 3\n\n1", "sample_input": "7\n5 15\n1 10 16 2 7 20 12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03156", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have written N problems to hold programming contests.\nThe i-th problem will have a score of P_i points if used in a contest.\n\nWith these problems, you would like to hold as many contests as possible under the following condition:\n\nA contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points.\n\nThe same problem should not be used in multiple contests.\nAt most how many contests can be held?\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1 \\leq P_i \\leq 20 (1 \\leq i \\leq N)\n\n1 \\leq A < B < 20\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA B\nP_1 P_2 ... P_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n5 15\n1 10 16 2 7 20 12\n\nSample Output 1\n\n2\n\nTwo contests can be held by putting the first, second, third problems and the fourth, fifth, sixth problems together.\n\nSample Input 2\n\n8\n3 8\n5 5 5 10 10 10 15 20\n\nSample Output 2\n\n0\n\nNo contest can be held, because there is no problem with a score of A = 3 or less.\n\nSample Input 3\n\n3\n5 6\n5 6 10\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 131, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s840436402", "group_id": "codeNet:p03157", "input_text": "#!/usr/bin/perl\n#= CPAN mocules =====================================================#\nuse strict;\t\t\t\t# strictモード\nuse warnings;\t\t\t# 警告有効\n\n#= Global values ====================================================#\nmy ($H, $W);\nmy @g_field;\nmy @g_chkedField;\nmy @startMark;\nmy @detect;\nmy $g_detCnt = 0;\n\n#= Local routines ===================================================#\n# 1ならチェック済み、0なら未チェック\nsub isChked{\n\tmy $i = shift;\n\tmy $j = shift;\n\n\tif (($i < 0) || ($H <= $i)){\n\t\treturn 1;\n\t}\n\tif (($j < 0) || ($W <= $j)){\n\t\treturn 1;\n\t}\n\tif ($g_chkedField[$i]){\n\t\treturn $g_chkedField[$i]->[$j];\n\t}else{\n\t\treturn 0;\n\t};\n}\n\nsub nextChk{\n\tmy $i = shift;\n\tmy $j = shift;\n\tmy $expMark = shift;\n\tmy $moveList = shift;\n\n\tmy $mark = $g_field[$i]->[$j];\n\tif ($expMark eq $mark){\n\t\tif ($expMark eq \".\"){\n\t\t\t# ここで条件合致\n\t\t\t$g_detCnt++;\n\t\t}\n\n\t\t$g_chkedField[$i]->[$j] = 1;\n\n\t\tmy $nextMark = ($mark eq \".\")? \"#\" : \".\" ;\n\t\t# 上右下左\n\t\t# 上をチェックする\n\t\tif ($moveList & 0x8){\n\t\t\tif (!isChked($i-1, $j)){\n\t\t\t\tnextChk($i-1, $j, $nextMark, 0xD);\n\t\t\t}\n\t\t}\n\t\t# 右をチェックする\n\t\tif ($moveList & 0x4){\n\t\t\tif (!isChked($i, $j+1)){\n\t\t\t\tnextChk($i, $j+1, $nextMark, 0xE);\n\t\t\t}\n\t\t}\n\t\t# 下をチェックする\n\t\tif ($moveList & 0x2){\n\t\t\tif (!isChked($i+1, $j)){\n\t\t\t\tnextChk($i+1, $j, $nextMark, 0x7);\n\t\t\t}\n\t\t}\n\t\t# 左をチェックする\n\t\tif ($moveList & 0x1){\n\t\t\tif (!isChked($i, $j-1)){\n\t\t\t\tnextChk($i, $j-1, $nextMark, 0xB);\n\t\t\t}\n\t\t}\n\t}\n\n\n}\n\nsub main(){\n\tmy $in = <>;chomp $in;\n\t($H, $W) = split(/ /, $in);\n\n\tforeach (1..$H){\n\t\t$in = <>; chomp $in;\n\t\t$g_field[$_ - 1] = [split(//, $in)];\n\t}\n\n\tforeach my $i (1..$H){\n\t\tforeach my $j (1..$W){\n\t\t\tmy $nextMark = $g_field[$i-1]->[$j-1];\n\t\t\tif ($nextMark eq \"#\"){\n\t\t\t\t$startMark[0] = $i - 1;\n\t\t\t\t$startMark[1] = $j - 1;\n\t\t\t\t$startMark[2] = $nextMark;\n\t\t\t\t@g_chkedField = ();\n\t\t\t\tforeach my $a (1..$H){\n\t\t\t\t\t$g_chkedField[$a-1] = [];\n\t\t\t\t\tforeach my $b (1..$W){\n\t\t\t\t\t\t$g_chkedField[$a-1]->[$b-1] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextChk($i - 1, $j - 1, $nextMark, 0xF);\n\t\t\t}\n\t\t}\n\t}\n\n\tprint $g_detCnt, \"\\n\";\n\n\treturn 0;\n}\n\n#----- 実行 -----#\nexit( main() );\n\n\n", "language": "Perl", "metadata": {"date": 1547328794, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03157.html", "problem_id": "p03157", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03157/input.txt", "sample_output_relpath": "derived/input_output/data/p03157/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03157/Perl/s840436402.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s840436402", "user_id": "u833717093"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "#!/usr/bin/perl\n#= CPAN mocules =====================================================#\nuse strict;\t\t\t\t# strictモード\nuse warnings;\t\t\t# 警告有効\n\n#= Global values ====================================================#\nmy ($H, $W);\nmy @g_field;\nmy @g_chkedField;\nmy @startMark;\nmy @detect;\nmy $g_detCnt = 0;\n\n#= Local routines ===================================================#\n# 1ならチェック済み、0なら未チェック\nsub isChked{\n\tmy $i = shift;\n\tmy $j = shift;\n\n\tif (($i < 0) || ($H <= $i)){\n\t\treturn 1;\n\t}\n\tif (($j < 0) || ($W <= $j)){\n\t\treturn 1;\n\t}\n\tif ($g_chkedField[$i]){\n\t\treturn $g_chkedField[$i]->[$j];\n\t}else{\n\t\treturn 0;\n\t};\n}\n\nsub nextChk{\n\tmy $i = shift;\n\tmy $j = shift;\n\tmy $expMark = shift;\n\tmy $moveList = shift;\n\n\tmy $mark = $g_field[$i]->[$j];\n\tif ($expMark eq $mark){\n\t\tif ($expMark eq \".\"){\n\t\t\t# ここで条件合致\n\t\t\t$g_detCnt++;\n\t\t}\n\n\t\t$g_chkedField[$i]->[$j] = 1;\n\n\t\tmy $nextMark = ($mark eq \".\")? \"#\" : \".\" ;\n\t\t# 上右下左\n\t\t# 上をチェックする\n\t\tif ($moveList & 0x8){\n\t\t\tif (!isChked($i-1, $j)){\n\t\t\t\tnextChk($i-1, $j, $nextMark, 0xD);\n\t\t\t}\n\t\t}\n\t\t# 右をチェックする\n\t\tif ($moveList & 0x4){\n\t\t\tif (!isChked($i, $j+1)){\n\t\t\t\tnextChk($i, $j+1, $nextMark, 0xE);\n\t\t\t}\n\t\t}\n\t\t# 下をチェックする\n\t\tif ($moveList & 0x2){\n\t\t\tif (!isChked($i+1, $j)){\n\t\t\t\tnextChk($i+1, $j, $nextMark, 0x7);\n\t\t\t}\n\t\t}\n\t\t# 左をチェックする\n\t\tif ($moveList & 0x1){\n\t\t\tif (!isChked($i, $j-1)){\n\t\t\t\tnextChk($i, $j-1, $nextMark, 0xB);\n\t\t\t}\n\t\t}\n\t}\n\n\n}\n\nsub main(){\n\tmy $in = <>;chomp $in;\n\t($H, $W) = split(/ /, $in);\n\n\tforeach (1..$H){\n\t\t$in = <>; chomp $in;\n\t\t$g_field[$_ - 1] = [split(//, $in)];\n\t}\n\n\tforeach my $i (1..$H){\n\t\tforeach my $j (1..$W){\n\t\t\tmy $nextMark = $g_field[$i-1]->[$j-1];\n\t\t\tif ($nextMark eq \"#\"){\n\t\t\t\t$startMark[0] = $i - 1;\n\t\t\t\t$startMark[1] = $j - 1;\n\t\t\t\t$startMark[2] = $nextMark;\n\t\t\t\t@g_chkedField = ();\n\t\t\t\tforeach my $a (1..$H){\n\t\t\t\t\t$g_chkedField[$a-1] = [];\n\t\t\t\t\tforeach my $b (1..$W){\n\t\t\t\t\t\t$g_chkedField[$a-1]->[$b-1] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextChk($i - 1, $j - 1, $nextMark, 0xF);\n\t\t\t}\n\t\t}\n\t}\n\n\tprint $g_detCnt, \"\\n\";\n\n\treturn 0;\n}\n\n#----- 実行 -----#\nexit( main() );\n\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with H rows and W columns, where each square is painted black or white.\n\nYou are given H strings S_1, S_2, ..., S_H, each of length W.\nIf the square at the i-th row from the top and the j-th column from the left is painted black, the j-th character in the string S_i is #; if that square is painted white, the j-th character in the string S_i is ..\n\nFind the number of pairs of a black square c_1 and a white square c_2 that satisfy the following condition:\n\nThere is a path from the square c_1 to the square c_2 where we repeatedly move to a vertically or horizontally adjacent square through an alternating sequence of black and white squares: black, white, black, white...\n\nConstraints\n\n1 \\leq H, W \\leq 400\n\n|S_i| = W (1 \\leq i \\leq H)\n\nFor each i (1 \\leq i \\leq H), the string S_i consists of characters # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\nS_2\n:\nS_H\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n.#.\n..#\n#..\n\nSample Output 1\n\n10\n\nSome of the pairs satisfying the condition are ((1, 2), (3, 3)) and ((3, 1), (3, 2)), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nSample Input 2\n\n2 4\n....\n....\n\nSample Output 2\n\n0\n\nSample Input 3\n\n4 3\n###\n###\n...\n###\n\nSample Output 3\n\n6", "sample_input": "3 3\n.#.\n..#\n#..\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03157", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with H rows and W columns, where each square is painted black or white.\n\nYou are given H strings S_1, S_2, ..., S_H, each of length W.\nIf the square at the i-th row from the top and the j-th column from the left is painted black, the j-th character in the string S_i is #; if that square is painted white, the j-th character in the string S_i is ..\n\nFind the number of pairs of a black square c_1 and a white square c_2 that satisfy the following condition:\n\nThere is a path from the square c_1 to the square c_2 where we repeatedly move to a vertically or horizontally adjacent square through an alternating sequence of black and white squares: black, white, black, white...\n\nConstraints\n\n1 \\leq H, W \\leq 400\n\n|S_i| = W (1 \\leq i \\leq H)\n\nFor each i (1 \\leq i \\leq H), the string S_i consists of characters # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\nS_2\n:\nS_H\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n.#.\n..#\n#..\n\nSample Output 1\n\n10\n\nSome of the pairs satisfying the condition are ((1, 2), (3, 3)) and ((3, 1), (3, 2)), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nSample Input 2\n\n2 4\n....\n....\n\nSample Output 2\n\n0\n\nSample Input 3\n\n4 3\n###\n###\n...\n###\n\nSample Output 3\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2149, "cpu_time_ms": 2122, "memory_kb": 317568}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s842439510", "group_id": "codeNet:p03166", "input_text": "sub f{map$M[$_]||=(sort{$b-$a}&f)[0]+1,@$_}@a[f]=map{/ /,push@{$`},$'+0}<>for 1..<>;print$#a", "language": "Perl", "metadata": {"date": 1576793428, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/Perl/s842439510.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s842439510", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "sub f{map$M[$_]||=(sort{$b-$a}&f)[0]+1,@$_}@a[f]=map{/ /,push@{$`},$'+0}<>for 1..<>;print$#a", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\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 x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\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 x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 92, "cpu_time_ms": 832, "memory_kb": 113920}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s395441243", "group_id": "codeNet:p03166", "input_text": "sub f{map 1+($M[$_]||=()=sort{$b-$a}&f),@$_}@a[f]=map{/ /,push@{$`},$'+0}<>for 1..<>;print$#a", "language": "Perl", "metadata": {"date": 1576793322, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/Perl/s395441243.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s395441243", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "sub f{map 1+($M[$_]||=()=sort{$b-$a}&f),@$_}@a[f]=map{/ /,push@{$`},$'+0}<>for 1..<>;print$#a", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\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 x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\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 x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 844, "memory_kb": 113024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s595515652", "group_id": "codeNet:p03166", "input_text": "sub f{$M[$_]=1;$M[$_]||&f for@$_;unshift@s,$_;}$%=<>;/ /,push@\n$`,$'+0for<>;$M[$_]||f for 1..$%;map{$\\+=$-=($p=$p[$_])-$\\;$p[$_]+=$-=$p+1-$p[$_]for@$_}@s;print", "language": "Perl", "metadata": {"date": 1546819462, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/Perl/s595515652.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s595515652", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "sub f{$M[$_]=1;$M[$_]||&f for@$_;unshift@s,$_;}$%=<>;/ /,push@\n$`,$'+0for<>;$M[$_]||f for 1..$%;map{$\\+=$-=($p=$p[$_])-$\\;$p[$_]+=$-=$p+1-$p[$_]for@$_}@s;print", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\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 x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\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 x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 663, "memory_kb": 111232}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s154317152", "group_id": "codeNet:p03168", "input_text": "@@=map$_+$t-($t=$'*$_),@@,//*?? for!<>,glob<>;$\\+=pop@@for@@;print", "language": "Perl", "metadata": {"date": 1546966570, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03168.html", "problem_id": "p03168", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03168/input.txt", "sample_output_relpath": "derived/input_output/data/p03168/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03168/Perl/s154317152.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s154317152", "user_id": "u283869437"}, "prompt_components": {"gold_output": "0.612\n", "input_to_evaluate": "@@=map$_+$t-($t=$'*$_),@@,//*?? for!<>,glob<>;$\\+=pop@@for@@;print", "problem_context": "Score : 100 points\n\nProblem Statement\n\nLet N be a positive odd number.\n\nThere are N coins, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), when Coin i is tossed, it comes up heads with probability p_i and tails with probability 1 - p_i.\n\nTaro has tossed all the N coins.\nFind the probability of having more heads than tails.\n\nConstraints\n\nN is an odd number.\n\n1 \\leq N \\leq 2999\n\np_i is a real number and has two decimal places.\n\n0 < p_i < 1\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 the probability of having more heads than tails.\nThe output is considered correct when the absolute error is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n0.30 0.60 0.80\n\nSample Output 1\n\n0.612\n\nThe probability of each case where we have more heads than tails is as follows:\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Head, Head, Head) is 0.3 × 0.6 × 0.8 = 0.144;\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Tail, Head, Head) is 0.7 × 0.6 × 0.8 = 0.336;\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Head, Tail, Head) is 0.3 × 0.4 × 0.8 = 0.096;\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Head, Head, Tail) is 0.3 × 0.6 × 0.2 = 0.036.\n\nThus, the probability of having more heads than tails is 0.144 + 0.336 + 0.096 + 0.036 = 0.612.\n\nSample Input 2\n\n1\n0.50\n\nSample Output 2\n\n0.5\n\nOutputs such as 0.500, 0.500000001 and 0.499999999 are also considered correct.\n\nSample Input 3\n\n5\n0.42 0.01 0.42 0.99 0.42\n\nSample Output 3\n\n0.3821815872", "sample_input": "3\n0.30 0.60 0.80\n"}, "reference_outputs": ["0.612\n"], "source_document_id": "p03168", "source_text": "Score : 100 points\n\nProblem Statement\n\nLet N be a positive odd number.\n\nThere are N coins, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), when Coin i is tossed, it comes up heads with probability p_i and tails with probability 1 - p_i.\n\nTaro has tossed all the N coins.\nFind the probability of having more heads than tails.\n\nConstraints\n\nN is an odd number.\n\n1 \\leq N \\leq 2999\n\np_i is a real number and has two decimal places.\n\n0 < p_i < 1\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 the probability of having more heads than tails.\nThe output is considered correct when the absolute error is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n0.30 0.60 0.80\n\nSample Output 1\n\n0.612\n\nThe probability of each case where we have more heads than tails is as follows:\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Head, Head, Head) is 0.3 × 0.6 × 0.8 = 0.144;\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Tail, Head, Head) is 0.7 × 0.6 × 0.8 = 0.336;\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Head, Tail, Head) is 0.3 × 0.4 × 0.8 = 0.096;\n\nThe probability of having (Coin 1, Coin 2, Coin 3) = (Head, Head, Tail) is 0.3 × 0.6 × 0.2 = 0.036.\n\nThus, the probability of having more heads than tails is 0.144 + 0.336 + 0.096 + 0.036 = 0.612.\n\nSample Input 2\n\n1\n0.50\n\nSample Output 2\n\n0.5\n\nOutputs such as 0.500, 0.500000001 and 0.499999999 are also considered correct.\n\nSample Input 3\n\n5\n0.42 0.01 0.42 0.99 0.42\n\nSample Output 3\n\n0.3821815872", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2014, "memory_kb": 2048}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s721109784", "group_id": "codeNet:p03169", "input_text": "sub f{\n\tmy($i,$j,$k)=@_;\n\t~$i&~$j&~$k and$$i[$j][$k]//=($i*f($i-1,$j,$k)+$j*f($i+1,$j-1,$k)+$k*f($i,$j+1,$k-1)+$n)/($i+$j+$k)\n}\n$n=<>;\n$0[0][0]=1;\n$c[$_]++for glob<>;\nprint f@c[1..3]", "language": "Perl", "metadata": {"date": 1547030259, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03169.html", "problem_id": "p03169", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03169/input.txt", "sample_output_relpath": "derived/input_output/data/p03169/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03169/Perl/s721109784.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s721109784", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5.5\n", "input_to_evaluate": "sub f{\n\tmy($i,$j,$k)=@_;\n\t~$i&~$j&~$k and$$i[$j][$k]//=($i*f($i-1,$j,$k)+$j*f($i+1,$j-1,$k)+$k*f($i,$j+1,$k-1)+$n)/($i+$j+$k)\n}\n$n=<>;\n$0[0][0]=1;\n$c[$_]++for glob<>;\nprint f@c[1..3]", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N dishes, numbered 1, 2, \\ldots, N.\nInitially, for each i (1 \\leq i \\leq N), Dish i has a_i (1 \\leq a_i \\leq 3) pieces of sushi on it.\n\nTaro will perform the following operation repeatedly until all the pieces of sushi are eaten:\n\nRoll a die that shows the numbers 1, 2, \\ldots, N with equal probabilities, and let i be the outcome. If there are some pieces of sushi on Dish i, eat one of them; if there is none, do nothing.\n\nFind the expected number of times the operation is performed before all the pieces of sushi are eaten.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 3\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 expected number of times the operation is performed before all the pieces of sushi are eaten.\nThe output is considered correct when the relative difference is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n1 1 1\n\nSample Output 1\n\n5.5\n\nThe expected number of operations before the first piece of sushi is eaten, is 1.\nAfter that, the expected number of operations before the second sushi is eaten, is 1.5.\nAfter that, the expected number of operations before the third sushi is eaten, is 3.\nThus, the expected total number of operations is 1 + 1.5 + 3 = 5.5.\n\nSample Input 2\n\n1\n3\n\nSample Output 2\n\n3\n\nOutputs such as 3.00, 3.000000003 and 2.999999997 will also be accepted.\n\nSample Input 3\n\n2\n1 2\n\nSample Output 3\n\n4.5\n\nSample Input 4\n\n10\n1 3 2 3 3 2 3 2 1 3\n\nSample Output 4\n\n54.48064457488221", "sample_input": "3\n1 1 1\n"}, "reference_outputs": ["5.5\n"], "source_document_id": "p03169", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N dishes, numbered 1, 2, \\ldots, N.\nInitially, for each i (1 \\leq i \\leq N), Dish i has a_i (1 \\leq a_i \\leq 3) pieces of sushi on it.\n\nTaro will perform the following operation repeatedly until all the pieces of sushi are eaten:\n\nRoll a die that shows the numbers 1, 2, \\ldots, N with equal probabilities, and let i be the outcome. If there are some pieces of sushi on Dish i, eat one of them; if there is none, do nothing.\n\nFind the expected number of times the operation is performed before all the pieces of sushi are eaten.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 3\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 expected number of times the operation is performed before all the pieces of sushi are eaten.\nThe output is considered correct when the relative difference is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n1 1 1\n\nSample Output 1\n\n5.5\n\nThe expected number of operations before the first piece of sushi is eaten, is 1.\nAfter that, the expected number of operations before the second sushi is eaten, is 1.5.\nAfter that, the expected number of operations before the third sushi is eaten, is 3.\nThus, the expected total number of operations is 1 + 1.5 + 3 = 5.5.\n\nSample Input 2\n\n1\n3\n\nSample Output 2\n\n3\n\nOutputs such as 3.00, 3.000000003 and 2.999999997 will also be accepted.\n\nSample Input 3\n\n2\n1 2\n\nSample Output 3\n\n4.5\n\nSample Input 4\n\n10\n1 3 2 3 3 2 3 2 1 3\n\nSample Output 4\n\n54.48064457488221", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2106, "memory_kb": 37632}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s667741437", "group_id": "codeNet:p03185", "input_text": "sub g{\n\t($x,$y)=@q[$_[0],$_[0]+1];\n\t($d[$x]-$d[$y])/($H[$y]-$H[$x])-$H[$x]-$H[$y]\n}\n<>=~$\";\nmap{shift@q while@q>1&&g(0)>-2*$_;$d[@d]=$X=$d[$q[0]]+$'+($H[$q[0]]-$_)**2;$#q-=2while$q[@q]=$i,@q>2&&g(-2)>g(-3);$i++}@H=glob<>;\nprint$X-$'", "language": "Perl", "metadata": {"date": 1548213000, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03185.html", "problem_id": "p03185", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03185/input.txt", "sample_output_relpath": "derived/input_output/data/p03185/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03185/Perl/s667741437.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s667741437", "user_id": "u657913472"}, "prompt_components": {"gold_output": "20\n", "input_to_evaluate": "sub g{\n\t($x,$y)=@q[$_[0],$_[0]+1];\n\t($d[$x]-$d[$y])/($H[$y]-$H[$x])-$H[$x]-$H[$y]\n}\n<>=~$\";\nmap{shift@q while@q>1&&g(0)>-2*$_;$d[@d]=$X=$d[$q[0]]+$'+($H[$q[0]]-$_)**2;$#q-=2while$q[@q]=$i,@q>2&&g(-2)>g(-3);$i++}@H=glob<>;\nprint$X-$'", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N stones, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), the height of Stone i is h_i.\nHere, h_1 < h_2 < \\cdots < h_N holds.\n\nThere is a frog who is initially on Stone 1.\nHe will repeat the following action some number of times to reach Stone N:\n\nIf the frog is currently on Stone i, jump to one of the following: Stone i + 1, i + 2, \\ldots, N. Here, a cost of (h_j - h_i)^2 + C is incurred, where j is the stone to land on.\n\nFind the minimum possible total cost incurred before the frog reaches Stone N.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq C \\leq 10^{12}\n\n1 \\leq h_1 < h_2 < \\cdots < h_N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n5 6\n1 2 3 4 5\n\nSample Output 1\n\n20\n\nIf we follow the path 1 → 3 → 5, the total cost incurred would be ((3 - 1)^2 + 6) + ((5 - 3)^2 + 6) = 20.\n\nSample Input 2\n\n2 1000000000000\n500000 1000000\n\nSample Output 2\n\n1250000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n8 5\n1 3 4 5 10 11 12 13\n\nSample Output 3\n\n62\n\nIf we follow the path 1 → 2 → 4 → 5 → 8, the total cost incurred would be ((3 - 1)^2 + 5) + ((5 - 3)^2 + 5) + ((10 - 5)^2 + 5) + ((13 - 10)^2 + 5) = 62.", "sample_input": "5 6\n1 2 3 4 5\n"}, "reference_outputs": ["20\n"], "source_document_id": "p03185", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N stones, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), the height of Stone i is h_i.\nHere, h_1 < h_2 < \\cdots < h_N holds.\n\nThere is a frog who is initially on Stone 1.\nHe will repeat the following action some number of times to reach Stone N:\n\nIf the frog is currently on Stone i, jump to one of the following: Stone i + 1, i + 2, \\ldots, N. Here, a cost of (h_j - h_i)^2 + C is incurred, where j is the stone to land on.\n\nFind the minimum possible total cost incurred before the frog reaches Stone N.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq C \\leq 10^{12}\n\n1 \\leq h_1 < h_2 < \\cdots < h_N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n5 6\n1 2 3 4 5\n\nSample Output 1\n\n20\n\nIf we follow the path 1 → 3 → 5, the total cost incurred would be ((3 - 1)^2 + 6) + ((5 - 3)^2 + 6) = 20.\n\nSample Input 2\n\n2 1000000000000\n500000 1000000\n\nSample Output 2\n\n1250000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n8 5\n1 3 4 5 10 11 12 13\n\nSample Output 3\n\n62\n\nIf we follow the path 1 → 2 → 4 → 5 → 8, the total cost incurred would be ((3 - 1)^2 + 5) + ((5 - 3)^2 + 5) + ((10 - 5)^2 + 5) + ((13 - 10)^2 + 5) = 62.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 232, "cpu_time_ms": 1756, "memory_kb": 69668}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s368685421", "group_id": "codeNet:p03186", "input_text": "$/=get.words;say $1+($0+$1+1 min+$2)", "language": "Perl", "metadata": {"date": 1546135550, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03186.html", "problem_id": "p03186", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03186/input.txt", "sample_output_relpath": "derived/input_output/data/p03186/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03186/Perl/s368685421.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s368685421", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "$/=get.words;say $1+($0+$1+1 min+$2)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.\n\nEating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death.\nAs he wants to live, he cannot eat one in such a situation.\nEating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches.\n\nFind the maximum number of tasty cookies that Takahashi can eat.\n\nConstraints\n\n0 \\leq A,B,C \\leq 10^9\n\nA,B and C are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum number of tasty cookies that Takahashi can eat.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n5\n\nWe can eat all tasty cookies, in the following order:\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nA tasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nSample Input 2\n\n5 2 9\n\nSample Output 2\n\n10\n\nSample Input 3\n\n8 8 1\n\nSample Output 3\n\n9", "sample_input": "3 1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03186", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.\n\nEating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death.\nAs he wants to live, he cannot eat one in such a situation.\nEating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches.\n\nFind the maximum number of tasty cookies that Takahashi can eat.\n\nConstraints\n\n0 \\leq A,B,C \\leq 10^9\n\nA,B and C are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum number of tasty cookies that Takahashi can eat.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n5\n\nWe can eat all tasty cookies, in the following order:\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nA tasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nSample Input 2\n\n5 2 9\n\nSample Output 2\n\n10\n\nSample Input 3\n\n8 8 1\n\nSample Output 3\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 878, "memory_kb": 63100}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s217594339", "group_id": "codeNet:p03187", "input_text": "#!/usr/bin/perl\nmy ($l,$n) = map { $_ - 0 } split(/\\s+/,);\nmy @x=();\nfor(my $i=0;$i<$n;$i++){\n my ($x1) = map { $_ - 0 } split(/\\s+/,);\n push(@x,$x1);\n}\nif( $n==1 ){\n print \"$x[0]\\n\"; exit(0);\n}\nmy $maxdist = -1;\nfor(my $i=0;$i<$n;$i++){ ## 最初にUターン場所を選ぶ\n for(my $d=-1;$d<=1;$d+=2){\n my @b = (); $#b = $n-1;\n my $cntb = 0;\n my $dist = 0;\n my $prev = -1;\n my $pos = -1;\n while($pos!=$i){\n $pos = ( ($prev==-1 ? ( $d<0 ? $n-1 : 0 ) : $pos + $d ) + $n ) % $n;\n $dist += ($prev==-1 ? ( $d<0 ? ($l-($x[$n-1])) : $x[0] ) : &dis($prev,$pos,$d) );\n $b[$pos] = 1;\n $cntb++;\n $prev = $pos;\n }\n my $td = -$d;\n while($cntb<$n){\n while( $b[$pos] ){\n $pos = ( $pos + $td + $n ) % $n;\n }\n $dist += &dis($prev,$pos,$td);\n $b[$pos] = 1;\n $cntb++;\n $prev = $pos;\n $td = -$td;\n }\n $maxdist = $dist if $dist > $maxdist;\n }\n}\nprint \"$maxdist\\n\";\nexit(0);\n\nsub dis {\n my $prev = shift;\n my $pos = shift;\n my $d = shift;\n if( $pos > $prev ){\n return $x[$pos] - $x[$prev] if $d > 0;\n return $l - ($x[$pos] - $x[$prev]);\n } else {\n return $x[$prev]- $x[$pos] if $d < 0;\n return $l - ($x[$prev] - $x[$pos]);\n }\n}\n", "language": "Perl", "metadata": {"date": 1546148415, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03187.html", "problem_id": "p03187", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03187/input.txt", "sample_output_relpath": "derived/input_output/data/p03187/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03187/Perl/s217594339.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s217594339", "user_id": "u750383873"}, "prompt_components": {"gold_output": "15\n", "input_to_evaluate": "#!/usr/bin/perl\nmy ($l,$n) = map { $_ - 0 } split(/\\s+/,);\nmy @x=();\nfor(my $i=0;$i<$n;$i++){\n my ($x1) = map { $_ - 0 } split(/\\s+/,);\n push(@x,$x1);\n}\nif( $n==1 ){\n print \"$x[0]\\n\"; exit(0);\n}\nmy $maxdist = -1;\nfor(my $i=0;$i<$n;$i++){ ## 最初にUターン場所を選ぶ\n for(my $d=-1;$d<=1;$d+=2){\n my @b = (); $#b = $n-1;\n my $cntb = 0;\n my $dist = 0;\n my $prev = -1;\n my $pos = -1;\n while($pos!=$i){\n $pos = ( ($prev==-1 ? ( $d<0 ? $n-1 : 0 ) : $pos + $d ) + $n ) % $n;\n $dist += ($prev==-1 ? ( $d<0 ? ($l-($x[$n-1])) : $x[0] ) : &dis($prev,$pos,$d) );\n $b[$pos] = 1;\n $cntb++;\n $prev = $pos;\n }\n my $td = -$d;\n while($cntb<$n){\n while( $b[$pos] ){\n $pos = ( $pos + $td + $n ) % $n;\n }\n $dist += &dis($prev,$pos,$td);\n $b[$pos] = 1;\n $cntb++;\n $prev = $pos;\n $td = -$td;\n }\n $maxdist = $dist if $dist > $maxdist;\n }\n}\nprint \"$maxdist\\n\";\nexit(0);\n\nsub dis {\n my $prev = shift;\n my $pos = shift;\n my $d = shift;\n if( $pos > $prev ){\n return $x[$pos] - $x[$prev] if $d > 0;\n return $l - ($x[$pos] - $x[$prev]);\n } else {\n return $x[$prev]- $x[$pos] if $d < 0;\n return $l - ($x[$prev] - $x[$pos]);\n }\n}\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nTakahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi.\nEach point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise.\n\nThere are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence.\n\nStarting at his residence, Takahashi will repeat the following action:\n\nIf all trees are burnt, terminate the process.\n\nSpecify a direction: clockwise or counter-clockwise.\n\nWalk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time.\n\nWhen the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step.\n\nFind the longest possible total distance Takahashi walks during the process.\n\nPartial Score\n\nA partial score can be obtained in this problem:\n\n300 points will be awarded for passing the input satisfying N \\leq 2000.\n\nConstraints\n\n2 \\leq L \\leq 10^9\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq X_1 < ... < X_N \\leq L-1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL N\nX_1\n:\nX_N\n\nOutput\n\nPrint the longest possible total distance Takahashi walks during the process.\n\nSample Input 1\n\n10 3\n2\n7\n9\n\nSample Output 1\n\n15\n\nTakahashi walks the distance of 15 if the process goes as follows:\n\nWalk a distance of 2 counter-clockwise, burn the tree at the coordinate 2 and stay there.\n\nWalk a distance of 5 counter-clockwise, burn the tree at the coordinate 7 and stay there.\n\nWalk a distance of 8 clockwise, burn the tree at the coordinate 9 and stay there.\n\nSample Input 2\n\n10 6\n1\n2\n3\n6\n7\n9\n\nSample Output 2\n\n27\n\nSample Input 3\n\n314159265 7\n21662711\n77271666\n89022761\n156626166\n160332356\n166902656\n298992265\n\nSample Output 3\n\n1204124749", "sample_input": "10 3\n2\n7\n9\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03187", "source_text": "Score : 800 points\n\nProblem Statement\n\nTakahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi.\nEach point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise.\n\nThere are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence.\n\nStarting at his residence, Takahashi will repeat the following action:\n\nIf all trees are burnt, terminate the process.\n\nSpecify a direction: clockwise or counter-clockwise.\n\nWalk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time.\n\nWhen the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step.\n\nFind the longest possible total distance Takahashi walks during the process.\n\nPartial Score\n\nA partial score can be obtained in this problem:\n\n300 points will be awarded for passing the input satisfying N \\leq 2000.\n\nConstraints\n\n2 \\leq L \\leq 10^9\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq X_1 < ... < X_N \\leq L-1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL N\nX_1\n:\nX_N\n\nOutput\n\nPrint the longest possible total distance Takahashi walks during the process.\n\nSample Input 1\n\n10 3\n2\n7\n9\n\nSample Output 1\n\n15\n\nTakahashi walks the distance of 15 if the process goes as follows:\n\nWalk a distance of 2 counter-clockwise, burn the tree at the coordinate 2 and stay there.\n\nWalk a distance of 5 counter-clockwise, burn the tree at the coordinate 7 and stay there.\n\nWalk a distance of 8 clockwise, burn the tree at the coordinate 9 and stay there.\n\nSample Input 2\n\n10 6\n1\n2\n3\n6\n7\n9\n\nSample Output 2\n\n27\n\nSample Input 3\n\n314159265 7\n21662711\n77271666\n89022761\n156626166\n160332356\n166902656\n298992265\n\nSample Output 3\n\n1204124749", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1246, "cpu_time_ms": 2104, "memory_kb": 13184}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s476578339", "group_id": "codeNet:p03188", "input_text": "$,=$\";$k=(4-($K=<>)%4)%4;print$n=$K+3>>2<<1,$K-1?map{map{($t=($'+$_)%$n)+1+($'%2?$n-$k:$t<$n-$k?0:$K-$n)}//..$n}1..$n:(1)x4", "language": "Perl", "metadata": {"date": 1546183945, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03188.html", "problem_id": "p03188", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03188/input.txt", "sample_output_relpath": "derived/input_output/data/p03188/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03188/Perl/s476578339.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s476578339", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n1 1 1\n1 1 1\n2 2 2\n", "input_to_evaluate": "$,=$\";$k=(4-($K=<>)%4)%4;print$n=$K+3>>2<<1,$K-1?map{map{($t=($'+$_)%$n)+1+($'%2?$n-$k:$t<$n-$k?0:$K-$n)}//..$n}1..$n:(1)x4", "problem_context": "Score : 1000 points\n\nProblem Statement\n\nFor an n \\times n grid, let (r, c) denote the square at the (r+1)-th row from the top and the (c+1)-th column from the left.\nA good coloring of this grid using K colors is a coloring that satisfies the following:\n\nEach square is painted in one of the K colors.\n\nEach of the K colors is used for some squares.\n\nLet us number the K colors 1, 2, ..., K. For any colors i and j (1 \\leq i \\leq K, 1 \\leq j \\leq K), every square in Color i has the same number of adjacent squares in Color j. Here, the squares adjacent to square (r, c) are ((r-1)\\; mod\\; n, c), ((r+1)\\; mod\\; n, c), (r, (c-1)\\; mod\\; n) and (r, (c+1)\\; mod\\; n) (if the same square appears multiple times among these four, the square is counted that number of times).\n\nGiven K, choose n between 1 and 500 (inclusive) freely and construct a good coloring of an n \\times n grid using K colors.\nIt can be proved that this is always possible under the constraints of this problem,\n\nConstraints\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nOutput should be in the following format:\n\nn\nc_{0,0} c_{0,1} ... c_{0,n-1}\nc_{1,0} c_{1,1} ... c_{1,n-1}\n:\nc_{n-1,0} c_{n-1,1} ... c_{n-1,n-1}\n\nn should represent the size of the grid, and 1 \\leq n \\leq 500 must hold.\nc_{r,c} should be an integer such that 1 \\leq c_{r,c} \\leq K and represent the color for the square (r, c).\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n1 1 1\n1 1 1\n2 2 2\n\nEvery square in Color 1 has three adjacent squares in Color 1 and one adjacent square in Color 2.\n\nEvery square in Color 2 has two adjacent squares in Color 1 and two adjacent squares in Color 2.\n\nOutput such as the following will be judged incorrect:\n\n2\n1 2\n2 2\n\n3\n1 1 1\n1 1 1\n1 1 1\n\nSample Input 2\n\n9\n\nSample Output 2\n\n3\n1 2 3\n4 5 6\n7 8 9", "sample_input": "2\n"}, "reference_outputs": ["3\n1 1 1\n1 1 1\n2 2 2\n"], "source_document_id": "p03188", "source_text": "Score : 1000 points\n\nProblem Statement\n\nFor an n \\times n grid, let (r, c) denote the square at the (r+1)-th row from the top and the (c+1)-th column from the left.\nA good coloring of this grid using K colors is a coloring that satisfies the following:\n\nEach square is painted in one of the K colors.\n\nEach of the K colors is used for some squares.\n\nLet us number the K colors 1, 2, ..., K. For any colors i and j (1 \\leq i \\leq K, 1 \\leq j \\leq K), every square in Color i has the same number of adjacent squares in Color j. Here, the squares adjacent to square (r, c) are ((r-1)\\; mod\\; n, c), ((r+1)\\; mod\\; n, c), (r, (c-1)\\; mod\\; n) and (r, (c+1)\\; mod\\; n) (if the same square appears multiple times among these four, the square is counted that number of times).\n\nGiven K, choose n between 1 and 500 (inclusive) freely and construct a good coloring of an n \\times n grid using K colors.\nIt can be proved that this is always possible under the constraints of this problem,\n\nConstraints\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nOutput should be in the following format:\n\nn\nc_{0,0} c_{0,1} ... c_{0,n-1}\nc_{1,0} c_{1,1} ... c_{1,n-1}\n:\nc_{n-1,0} c_{n-1,1} ... c_{n-1,n-1}\n\nn should represent the size of the grid, and 1 \\leq n \\leq 500 must hold.\nc_{r,c} should be an integer such that 1 \\leq c_{r,c} \\leq K and represent the color for the square (r, c).\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n1 1 1\n1 1 1\n2 2 2\n\nEvery square in Color 1 has three adjacent squares in Color 1 and one adjacent square in Color 2.\n\nEvery square in Color 2 has two adjacent squares in Color 1 and two adjacent squares in Color 2.\n\nOutput such as the following will be judged incorrect:\n\n2\n1 2\n2 2\n\n3\n1 1 1\n1 1 1\n1 1 1\n\nSample Input 2\n\n9\n\nSample Output 2\n\n3\n1 2 3\n4 5 6\n7 8 9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 226, "memory_kb": 11264}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s739738406", "group_id": "codeNet:p03192", "input_text": "my $i = ;\nmy $c = $i =~ s/2//g;\nprint \"$c\\n\";", "language": "Perl", "metadata": {"date": 1545532169, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03192.html", "problem_id": "p03192", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03192/input.txt", "sample_output_relpath": "derived/input_output/data/p03192/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03192/Perl/s739738406.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s739738406", "user_id": "u223360494"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my $i = ;\nmy $c = $i =~ s/2//g;\nprint \"$c\\n\";", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer N that has exactly four digits in base ten.\nHow many times does 2 occur in the base-ten representation of N?\n\nConstraints\n\n1000 \\leq N \\leq 9999\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\n1222\n\nSample Output 1\n\n3\n\n2 occurs three times in 1222. By the way, this contest is held on December 22 (JST).\n\nSample Input 2\n\n3456\n\nSample Output 2\n\n0\n\nSample Input 3\n\n9592\n\nSample Output 3\n\n1", "sample_input": "1222\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03192", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer N that has exactly four digits in base ten.\nHow many times does 2 occur in the base-ten representation of N?\n\nConstraints\n\n1000 \\leq N \\leq 9999\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\n1222\n\nSample Output 1\n\n3\n\n2 occurs three times in 1222. By the way, this contest is held on December 22 (JST).\n\nSample Input 2\n\n3456\n\nSample Output 2\n\n0\n\nSample Input 3\n\n9592\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 52, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s459590882", "group_id": "codeNet:p03193", "input_text": "use v5.18;\nuse warnings;\nsub read_line { chomp(my $s = <>); $s }\nsub splited_read_line { split / /, read_line }\n\nmy ($n, $h, $w) = splited_read_line;\nmy @boards = map {\n my ($h, $w) = splited_read_line;\n +{\n h => $h,\n w => $w,\n }\n} 0 .. $n - 1;\n\nmy @greped = grep { $_->{h} >= $h && $_->{w} >= $w } @boards;\nsay ~~@greped;", "language": "Perl", "metadata": {"date": 1545531110, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03193.html", "problem_id": "p03193", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03193/input.txt", "sample_output_relpath": "derived/input_output/data/p03193/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03193/Perl/s459590882.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s459590882", "user_id": "u376692089"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nsub read_line { chomp(my $s = <>); $s }\nsub splited_read_line { split / /, read_line }\n\nmy ($n, $h, $w) = splited_read_line;\nmy @boards = map {\n my ($h, $w) = splited_read_line;\n +{\n h => $h,\n w => $w,\n }\n} 0 .. $n - 1;\n\nmy @greped = grep { $_->{h} >= $h && $_->{w} >= $w } @boards;\nsay ~~@greped;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N rectangular plate materials made of special metal called AtCoder Alloy.\nThe dimensions of the i-th material are A_i \\times B_i (A_i vertically and B_i horizontally).\n\nTakahashi wants a rectangular plate made of AtCoder Alloy whose dimensions are exactly H \\times W.\nHe is trying to obtain such a plate by choosing one of the N materials and cutting it if necessary.\nWhen cutting a material, the cuts must be parallel to one of the sides of the material.\nAlso, the materials have fixed directions and cannot be rotated.\nFor example, a 5 \\times 3 material cannot be used as a 3 \\times 5 plate.\n\nOut of the N materials, how many can produce an H \\times W plate if properly cut?\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n1 \\leq H \\leq 10^9\n\n1 \\leq W \\leq 10^9\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 H W\nA_1 B_1\nA_2 B_2\n:\nA_N B_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 5 2\n10 3\n5 2\n2 5\n\nSample Output 1\n\n2\n\nTakahashi wants a 5 \\times 2 plate.\n\nThe dimensions of the first material are 10 \\times 3. We can obtain a 5 \\times 2 plate by properly cutting it.\n\nThe dimensions of the second material are 5 \\times 2. We can obtain a 5 \\times 2 plate without cutting it.\n\nThe dimensions of the third material are 2 \\times 5. We cannot obtain a 5 \\times 2 plate, whatever cuts are made. Note that the material cannot be rotated and used as a 5 \\times 2 plate.\n\nSample Input 2\n\n10 587586158 185430194\n894597290 708587790\n680395892 306946994\n590262034 785368612\n922328576 106880540\n847058850 326169610\n936315062 193149191\n702035777 223363392\n11672949 146832978\n779291680 334178158\n615808191 701464268\n\nSample Output 2\n\n8", "sample_input": "3 5 2\n10 3\n5 2\n2 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03193", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N rectangular plate materials made of special metal called AtCoder Alloy.\nThe dimensions of the i-th material are A_i \\times B_i (A_i vertically and B_i horizontally).\n\nTakahashi wants a rectangular plate made of AtCoder Alloy whose dimensions are exactly H \\times W.\nHe is trying to obtain such a plate by choosing one of the N materials and cutting it if necessary.\nWhen cutting a material, the cuts must be parallel to one of the sides of the material.\nAlso, the materials have fixed directions and cannot be rotated.\nFor example, a 5 \\times 3 material cannot be used as a 3 \\times 5 plate.\n\nOut of the N materials, how many can produce an H \\times W plate if properly cut?\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n1 \\leq H \\leq 10^9\n\n1 \\leq W \\leq 10^9\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 H W\nA_1 B_1\nA_2 B_2\n:\nA_N B_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 5 2\n10 3\n5 2\n2 5\n\nSample Output 1\n\n2\n\nTakahashi wants a 5 \\times 2 plate.\n\nThe dimensions of the first material are 10 \\times 3. We can obtain a 5 \\times 2 plate by properly cutting it.\n\nThe dimensions of the second material are 5 \\times 2. We can obtain a 5 \\times 2 plate without cutting it.\n\nThe dimensions of the third material are 2 \\times 5. We cannot obtain a 5 \\times 2 plate, whatever cuts are made. Note that the material cannot be rotated and used as a 5 \\times 2 plate.\n\nSample Input 2\n\n10 587586158 185430194\n894597290 708587790\n680395892 306946994\n590262034 785368612\n922328576 106880540\n847058850 326169610\n936315062 193149191\n702035777 223363392\n11672949 146832978\n779291680 334178158\n615808191 701464268\n\nSample Output 2\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 331, "cpu_time_ms": 6, "memory_kb": 1152}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s662445530", "group_id": "codeNet:p03194", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse 5.010;\n\nuse Data::Dumper;\nuse POSIX qw(floor);\n\nmy @INPUT;\nwhile (<>) {\n chomp;\n push @INPUT, $_;\n}\n\nmy ($N, $P) = split \" \", shift @INPUT;\n\nmy $n = $P;\nmy @f = factorization($n);\nmy %f;\nfor my $f (@f) {\n $f{$f}++;\n}\n\nmy $ans = 1;\n\nfor my $d (keys %f) {\n my $num = $f{$d};\n my $times = floor($num / $N);\n $ans = $ans * ($d ** $times);\n}\n\nsay $ans;\n\nsub factorization {\n my $n = shift;\n my @f;\n for my $i (2 .. ($n - 1)) {\n while ($n % $i == 0) {\n $n = $n / $i;\n push @f, $i;\n }\n if ($n == 1) {\n last;\n }\n }\n return @f;\n}\n\n", "language": "Perl", "metadata": {"date": 1545532196, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03194.html", "problem_id": "p03194", "resource_group": "low_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/Perl/s662445530.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s662445530", "user_id": "u243453868"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse 5.010;\n\nuse Data::Dumper;\nuse POSIX qw(floor);\n\nmy @INPUT;\nwhile (<>) {\n chomp;\n push @INPUT, $_;\n}\n\nmy ($N, $P) = split \" \", shift @INPUT;\n\nmy $n = $P;\nmy @f = factorization($n);\nmy %f;\nfor my $f (@f) {\n $f{$f}++;\n}\n\nmy $ans = 1;\n\nfor my $d (keys %f) {\n my $num = $f{$d};\n my $times = floor($num / $N);\n $ans = $ans * ($d ** $times);\n}\n\nsay $ans;\n\nsub factorization {\n my $n = shift;\n my @f;\n for my $i (2 .. ($n - 1)) {\n while ($n % $i == 0) {\n $n = $n / $i;\n push @f, $i;\n }\n if ($n == 1) {\n last;\n }\n }\n return @f;\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 663, "cpu_time_ms": 2103, "memory_kb": 2560}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s068205365", "group_id": "codeNet:p03195", "input_text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse 5.010;\n\nuse Data::Dumper;\nuse POSIX qw(floor);\n\nmy @INPUT;\nwhile (<>) {\n chomp;\n push @INPUT, $_;\n}\n\nmy ($N, $P) = split \" \", shift @INPUT;\n\nmy $n = $P;\nmy @f = factorization($n);\nmy %f;\nfor my $f (@f) {\n $f{$f}++;\n}\n\nmy $ans = 1;\n\nfor my $d (keys %f) {\n my $num = $f{$d};\n my $times = floor($num / $N);\n $ans = $ans * ($d ** $times);\n}\n\nsay $ans;\n\nsub factorization {\n my $arg = shift;\n my $max = sqrt($arg) + 1;\n for my $i (2 .. $max) {\n if ($arg % $i == 0) {\n return ($i, &factorization($arg / $i));\n }\n }\n return $arg;\n}\n\n\n", "language": "Perl", "metadata": {"date": 1545531670, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03195.html", "problem_id": "p03195", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03195/input.txt", "sample_output_relpath": "derived/input_output/data/p03195/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03195/Perl/s068205365.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s068205365", "user_id": "u243453868"}, "prompt_components": {"gold_output": "first\n", "input_to_evaluate": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse 5.010;\n\nuse Data::Dumper;\nuse POSIX qw(floor);\n\nmy @INPUT;\nwhile (<>) {\n chomp;\n push @INPUT, $_;\n}\n\nmy ($N, $P) = split \" \", shift @INPUT;\n\nmy $n = $P;\nmy @f = factorization($n);\nmy %f;\nfor my $f (@f) {\n $f{$f}++;\n}\n\nmy $ans = 1;\n\nfor my $d (keys %f) {\n my $num = $f{$d};\n my $times = floor($num / $N);\n $ans = $ans * ($d ** $times);\n}\n\nsay $ans;\n\nsub factorization {\n my $arg = shift;\n my $max = sqrt($arg) + 1;\n for my $i (2 .. $max) {\n if ($arg % $i == 0) {\n return ($i, &factorization($arg / $i));\n }\n }\n return $arg;\n}\n\n\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.\n\nYou and Lunlun the dachshund alternately perform the following operation (starting from you):\n\nChoose one or more apples from the tree and eat them. Here, the apples chosen at the same time must all have different colors.\n\nThe one who eats the last apple from the tree will be declared winner. If both you and Lunlun play optimally, which will win?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_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\na_1\na_2\n:\na_N\n\nOutput\n\nIf you will win, print first; if Lunlun will win, print second.\n\nSample Input 1\n\n2\n1\n2\n\nSample Output 1\n\nfirst\n\nLet Color 1 be red, and Color 2 be blue. In this case, the tree bears one red apple and two blue apples.\n\nYou should eat the red apple in your first turn. Lunlun is then forced to eat one of the blue apples, and you can win by eating the other in your next turn.\n\nNote that you are also allowed to eat two apples in your first turn, one red and one blue (not a winning move, though).\n\nSample Input 2\n\n3\n100000\n30000\n20000\n\nSample Output 2\n\nsecond", "sample_input": "2\n1\n2\n"}, "reference_outputs": ["first\n"], "source_document_id": "p03195", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.\n\nYou and Lunlun the dachshund alternately perform the following operation (starting from you):\n\nChoose one or more apples from the tree and eat them. Here, the apples chosen at the same time must all have different colors.\n\nThe one who eats the last apple from the tree will be declared winner. If both you and Lunlun play optimally, which will win?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_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\na_1\na_2\n:\na_N\n\nOutput\n\nIf you will win, print first; if Lunlun will win, print second.\n\nSample Input 1\n\n2\n1\n2\n\nSample Output 1\n\nfirst\n\nLet Color 1 be red, and Color 2 be blue. In this case, the tree bears one red apple and two blue apples.\n\nYou should eat the red apple in your first turn. Lunlun is then forced to eat one of the blue apples, and you can win by eating the other in your next turn.\n\nNote that you are also allowed to eat two apples in your first turn, one red and one blue (not a winning move, though).\n\nSample Input 2\n\n3\n100000\n30000\n20000\n\nSample Output 2\n\nsecond", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 632, "cpu_time_ms": 51, "memory_kb": 10496}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s748559368", "group_id": "codeNet:p03200", "input_text": "use v5.18;\nchomp(my $S = );\nmy $sum = 0;\nwhile ( my $match_num = (() = ($S =~ /BW/g)) ) {\n say $match_num;\n $sum += $match_num;\n $S =~ s/BW/WB/g;\n}\nsay $sum;\n", "language": "Perl", "metadata": {"date": 1544927320, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03200.html", "problem_id": "p03200", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03200/input.txt", "sample_output_relpath": "derived/input_output/data/p03200/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03200/Perl/s748559368.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s748559368", "user_id": "u376692089"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v5.18;\nchomp(my $S = );\nmy $sum = 0;\nwhile ( my $match_num = (() = ($S =~ /BW/g)) ) {\n say $match_num;\n $sum += $match_num;\n $S =~ s/BW/WB/g;\n}\nsay $sum;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N Reversi pieces arranged in a row. (A Reversi piece is a disc with a black side and a white side.)\nThe state of each piece is represented by a string S of length N.\nIf S_i=B, the i-th piece from the left is showing black;\nIf S_i=W, the i-th piece from the left is showing white.\n\nConsider performing the following operation:\n\nChoose i (1 \\leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black.\n\nFind the maximum possible number of times this operation can be performed.\n\nConstraints\n\n1 \\leq |S| \\leq 2\\times 10^5\n\nS_i=B or W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum possible number of times the operation can be performed.\n\nSample Input 1\n\nBBW\n\nSample Output 1\n\n2\n\nThe operation can be performed twice, as follows:\n\nFlip the second and third pieces from the left.\n\nFlip the first and second pieces from the left.\n\nSample Input 2\n\nBWBWBW\n\nSample Output 2\n\n6", "sample_input": "BBW\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03200", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N Reversi pieces arranged in a row. (A Reversi piece is a disc with a black side and a white side.)\nThe state of each piece is represented by a string S of length N.\nIf S_i=B, the i-th piece from the left is showing black;\nIf S_i=W, the i-th piece from the left is showing white.\n\nConsider performing the following operation:\n\nChoose i (1 \\leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black.\n\nFind the maximum possible number of times this operation can be performed.\n\nConstraints\n\n1 \\leq |S| \\leq 2\\times 10^5\n\nS_i=B or W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum possible number of times the operation can be performed.\n\nSample Input 1\n\nBBW\n\nSample Output 1\n\n2\n\nThe operation can be performed twice, as follows:\n\nFlip the second and third pieces from the left.\n\nFlip the first and second pieces from the left.\n\nSample Input 2\n\nBWBWBW\n\nSample Output 2\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2104, "memory_kb": 17484}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s062478969", "group_id": "codeNet:p03201", "input_text": "print!<>+grep${-$_}--||!++${$_-=2<", "language": "Perl", "metadata": {"date": 1580788766, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03201.html", "problem_id": "p03201", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03201/input.txt", "sample_output_relpath": "derived/input_output/data/p03201/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03201/Perl/s062478969.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s062478969", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "print!<>+grep${-$_}--||!++${$_-=2<", "problem_context": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i.\nHe would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\nNote that a ball cannot belong to multiple pairs.\nFind the maximum possible number of pairs that can be formed.\n\nHere, a positive integer is said to be a power of 2 when it can be written as 2^t using some non-negative integer t.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 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 number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n1\n\nWe can form one pair whose sum of the written numbers is 4 by pairing the first and third balls.\nNote that we cannot pair the second ball with itself.\n\nSample Input 2\n\n5\n3 11 14 5 13\n\nSample Output 2\n\n2", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03201", "source_text": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i.\nHe would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\nNote that a ball cannot belong to multiple pairs.\nFind the maximum possible number of pairs that can be formed.\n\nHere, a positive integer is said to be a power of 2 when it can be written as 2^t using some non-negative integer t.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 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 number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n1\n\nWe can form one pair whose sum of the written numbers is 4 by pairing the first and third balls.\nNote that we cannot pair the second ball with itself.\n\nSample Input 2\n\n5\n3 11 14 5 13\n\nSample Output 2\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1146, "memory_kb": 169744}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s380385990", "group_id": "codeNet:p03207", "input_text": "get;$_=+<=~$\"..$`-1];print", "language": "Perl", "metadata": {"date": 1544323432, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03208.html", "problem_id": "p03208", "resource_group": "low_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/Perl/s695961322.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s695961322", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$\\=9e9;$\\-=$-=$\\-$_+shift@@for(@@=`sort -n`)[$'-<>=~$\"..$`-1];print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 177, "memory_kb": 25656}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s473009579", "group_id": "codeNet:p03209", "input_text": "($n,$x)=glob<>;\nfor(sort{1}0..$n){\n\t$x-=$x<($t=2**(1+$_)-1)?1:($%+=2**$_,$t)\n}\nprint$%\n", "language": "Perl", "metadata": {"date": 1544330185, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03209.html", "problem_id": "p03209", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03209/input.txt", "sample_output_relpath": "derived/input_output/data/p03209/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03209/Perl/s473009579.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s473009579", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "($n,$x)=glob<>;\nfor(sort{1}0..$n){\n\t$x-=$x<($t=2**(1+$_)-1)?1:($%+=2**$_,$t)\n}\nprint$%\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "sample_input": "2 7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03209", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s703045008", "group_id": "codeNet:p03210", "input_text": "#!/usr/bin/perl\n\n$x = <>;\nif ($x == 3 || $x == 5 || $x == 7) {\n print \"YES\\n\";\n} else {\n print \"NO\\n\";\n}", "language": "Perl", "metadata": {"date": 1543802492, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03210.html", "problem_id": "p03210", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03210/input.txt", "sample_output_relpath": "derived/input_output/data/p03210/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03210/Perl/s703045008.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s703045008", "user_id": "u504322356"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "#!/usr/bin/perl\n\n$x = <>;\nif ($x == 3 || $x == 5 || $x == 7) {\n print \"YES\\n\";\n} else {\n print \"NO\\n\";\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s522458646", "group_id": "codeNet:p03211", "input_text": "use List::Util 'min';\n\nchomp($s = <>);\n@a = (7,8,6,9,5,4,3,2,1);\n\n$r = 753;\nfor $i (@a){\n\t$pos = index($s, $i);\n\tnext if($pos == -1);\n\t$t = substr($s, $pos, 3);\n\twhile(1){\n\t\tlast if(length($t) < 3);\n\t\t$r = min($r, abs(753 - $t));\n\t\t$pos = index($s, $i, $pos + 1);\n\t\tlast if($pos == -1);\n\t\t$t = substr($s, $pos, 3);\n\t}\n\tlast if($r != 753);\n}\n\nprint \"$r\\n\";\n", "language": "Perl", "metadata": {"date": 1569296066, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03211.html", "problem_id": "p03211", "resource_group": "low_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/Perl/s522458646.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s522458646", "user_id": "u609426052"}, "prompt_components": {"gold_output": "34\n", "input_to_evaluate": "use List::Util 'min';\n\nchomp($s = <>);\n@a = (7,8,6,9,5,4,3,2,1);\n\n$r = 753;\nfor $i (@a){\n\t$pos = index($s, $i);\n\tnext if($pos == -1);\n\t$t = substr($s, $pos, 3);\n\twhile(1){\n\t\tlast if(length($t) < 3);\n\t\t$r = min($r, abs(753 - $t));\n\t\t$pos = index($s, $i, $pos + 1);\n\t\tlast if($pos == -1);\n\t\t$t = substr($s, $pos, 3);\n\t}\n\tlast if($r != 753);\n}\n\nprint \"$r\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s138903449", "group_id": "codeNet:p03212", "input_text": "#!/usr/bin/perl -w\n\nchomp($line = <>);\n$count=0;\nfor($i=357;$i<$line;$i++){\n if($i =~ /\\b(7|5|3)+\\b/ && $i =~ /3+/ && $i =~ /5+/ && $i =~ /7+/){\n $count++;\n }\n}\nprint $count;", "language": "Perl", "metadata": {"date": 1543806034, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03212.html", "problem_id": "p03212", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03212/input.txt", "sample_output_relpath": "derived/input_output/data/p03212/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03212/Perl/s138903449.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s138903449", "user_id": "u356080730"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "#!/usr/bin/perl -w\n\nchomp($line = <>);\n$count=0;\nfor($i=357;$i<$line;$i++){\n if($i =~ /\\b(7|5|3)+\\b/ && $i =~ /3+/ && $i =~ /5+/ && $i =~ /7+/){\n $count++;\n }\n}\nprint $count;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\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 number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "sample_input": "575\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03212", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\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 number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 187, "cpu_time_ms": 2103, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s257576611", "group_id": "codeNet:p03213", "input_text": "$n=<>;\nchomp($n);\nfor (my$i=2;$i<=$n;$i++){\n my$p=$i;\n for(my$d=2;$d<=$p;$d++){\n while($p%$d==0){\n $l{$d}++;\n $p/=$d;\n }\n }\n}\n@m = sort {$l{$b}<=>$l{$a}} keys %l;\nforeach my$i (@m){\n $o++ if ($l{$i}>=74); \n $n24++ if ($l{$i}>=24); \n $n14++ if ($l{$i}>=14); \n $n4++ if ($l{$i}>= 4); \n $n2++ if ($l{$i}>= 2); \n}\n$o+=$n24*($n2-1);\n$o+=$n14*($n4-1);\n$o+=$n4*($n4-1)*($n2-2)/2;\n$o//=0;\nprint (\"$o\");", "language": "Perl", "metadata": {"date": 1558451085, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03213.html", "problem_id": "p03213", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03213/input.txt", "sample_output_relpath": "derived/input_output/data/p03213/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03213/Perl/s257576611.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s257576611", "user_id": "u573154728"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "$n=<>;\nchomp($n);\nfor (my$i=2;$i<=$n;$i++){\n my$p=$i;\n for(my$d=2;$d<=$p;$d++){\n while($p%$d==0){\n $l{$d}++;\n $p/=$d;\n }\n }\n}\n@m = sort {$l{$b}<=>$l{$a}} keys %l;\nforeach my$i (@m){\n $o++ if ($l{$i}>=74); \n $n24++ if ($l{$i}>=24); \n $n14++ if ($l{$i}>=14); \n $n4++ if ($l{$i}>= 4); \n $n2++ if ($l{$i}>= 2); \n}\n$o+=$n24*($n2-1);\n$o+=$n14*($n4-1);\n$o+=$n4*($n4-1)*($n2-2)/2;\n$o//=0;\nprint (\"$o\");", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\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\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "sample_input": "9\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03213", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\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\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 456, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s872163829", "group_id": "codeNet:p03213", "input_text": "$n=<>;\n$d[1]=1;\nfor$i(@n=2..$n){\n\t$p[$i]&&next;\n\t@p[map$i*$_,@n]=@n;\n\t$c=map{grep$'%$i**$_<1,//..9}@n;\n\tmap$d[-$'*++$_]+=$d[-$'],//..$c for-75..-1\n}\nprint$d[75]||0", "language": "Perl", "metadata": {"date": 1543806808, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03213.html", "problem_id": "p03213", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03213/input.txt", "sample_output_relpath": "derived/input_output/data/p03213/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03213/Perl/s872163829.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s872163829", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "$n=<>;\n$d[1]=1;\nfor$i(@n=2..$n){\n\t$p[$i]&&next;\n\t@p[map$i*$_,@n]=@n;\n\t$c=map{grep$'%$i**$_<1,//..9}@n;\n\tmap$d[-$'*++$_]+=$d[-$'],//..$c for-75..-1\n}\nprint$d[75]||0", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\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\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "sample_input": "9\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03213", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\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\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 18, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s230120475", "group_id": "codeNet:p03214", "input_text": "get;\nmy@A=+<=~$\";@_=map{$s=0;map$s+=$_,shift@A,@A}@A=glob<>;$'>(@g=grep$_>>$=&1,@_)or@_=@g,$\\|=1<<$=while$=--;print", "language": "Perl", "metadata": {"date": 1543375190, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03215.html", "problem_id": "p03215", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03215/input.txt", "sample_output_relpath": "derived/input_output/data/p03215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03215/Perl/s925398471.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s925398471", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "<>=~$\";@_=map{$s=0;map$s+=$_,shift@A,@A}@A=glob<>;$'>(@g=grep$_>>$=&1,@_)or@_=@g,$\\|=1<<$=while$=--;print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input 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\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "sample_input": "4 2\n2 5 2 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03215", "source_text": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input 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\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 105, "cpu_time_ms": 1445, "memory_kb": 37300}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s671398978", "group_id": "codeNet:p03215", "input_text": "<>=~$\";@A=glob<>;@_=map{$s=0;map$s+=$A[$_],$_..-1}-$`..-1;$'>(@g=grep$_>>$=&1,@_)or@_=@g,$\\|=1<<$=while$=--;print", "language": "Perl", "metadata": {"date": 1543131030, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03215.html", "problem_id": "p03215", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03215/input.txt", "sample_output_relpath": "derived/input_output/data/p03215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03215/Perl/s671398978.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s671398978", "user_id": "u283869437"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "<>=~$\";@A=glob<>;@_=map{$s=0;map$s+=$A[$_],$_..-1}-$`..-1;$'>(@g=grep$_>>$=&1,@_)or@_=@g,$\\|=1<<$=while$=--;print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input 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\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "sample_input": "4 2\n2 5 2 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03215", "source_text": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input 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\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 113, "cpu_time_ms": 1444, "memory_kb": 37340}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s281276377", "group_id": "codeNet:p03219", "input_text": "get.words.reduce({$^a+$^b/2}).say", "language": "Perl", "metadata": {"date": 1567735709, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03219.html", "problem_id": "p03219", "resource_group": "low_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/Perl/s281276377.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s281276377", "user_id": "u760868074"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "get.words.reduce({$^a+$^b/2}).say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 299, "memory_kb": 62208}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s368778636", "group_id": "codeNet:p03219", "input_text": "print<>!~$\"+$`+$'/2", "language": "Perl", "metadata": {"date": 1541402947, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03219.html", "problem_id": "p03219", "resource_group": "low_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/Perl/s368778636.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s368778636", "user_id": "u657913472"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "print<>!~$\"+$`+$'/2", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 19, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s973420822", "group_id": "codeNet:p03220", "input_text": "$N=<>;$m=1e9;$m<($;=abs$`-.006*<>-$')or$\\=$_,$m=$;for<>=~($/=$\")..$N;print", "language": "Perl", "metadata": {"date": 1541399791, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03220.html", "problem_id": "p03220", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03220/input.txt", "sample_output_relpath": "derived/input_output/data/p03220/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03220/Perl/s973420822.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s973420822", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$N=<>;$m=1e9;$m<($;=abs$`-.006*<>-$')or$\\=$_,$m=$;for<>=~($/=$\")..$N;print", "problem_context": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "sample_input": "2\n12 5\n1000 2000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03220", "source_text": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s150076952", "group_id": "codeNet:p03220", "input_text": "#!/usr/bin/perl -w\n$n=<>;\n($t,$a)=split(/ /,<>);\n@line = split(/ /,<>);\nmy $s=1;\n$mini=abs($a-$t-$line[0]*0.006);\n\nif($a>0){\n $mini=abs($a-$t-$line[0]*0.006);\n for($i=0;$i<$n;$i++){\n \n if($mini >= abs($a-$t-$line[$i]*0.006)){\n $mini=abs($a-$t-$line[$i]*0.006);\n $s=$i+1;\n }\n }\n}else{\n $mini=-abs($a-$t-$line[0]*0.006);\n for($i=0;$i<$n;$i++){\n \n if($mini <= abs($a-$t-$line[$i]*0.006)){\n $mini=-abs($a-$t-$line[$i]*0.006);\n $s=$i+1;\n} \n}\n}\nprint $s;", "language": "Perl", "metadata": {"date": 1541387821, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03220.html", "problem_id": "p03220", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03220/input.txt", "sample_output_relpath": "derived/input_output/data/p03220/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03220/Perl/s150076952.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s150076952", "user_id": "u356080730"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl -w\n$n=<>;\n($t,$a)=split(/ /,<>);\n@line = split(/ /,<>);\nmy $s=1;\n$mini=abs($a-$t-$line[0]*0.006);\n\nif($a>0){\n $mini=abs($a-$t-$line[0]*0.006);\n for($i=0;$i<$n;$i++){\n \n if($mini >= abs($a-$t-$line[$i]*0.006)){\n $mini=abs($a-$t-$line[$i]*0.006);\n $s=$i+1;\n }\n }\n}else{\n $mini=-abs($a-$t-$line[0]*0.006);\n for($i=0;$i<$n;$i++){\n \n if($mini <= abs($a-$t-$line[$i]*0.006)){\n $mini=-abs($a-$t-$line[$i]*0.006);\n $s=$i+1;\n} \n}\n}\nprint $s;", "problem_context": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "sample_input": "2\n12 5\n1000 2000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03220", "source_text": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 528, "cpu_time_ms": 31, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s050774880", "group_id": "codeNet:p03221", "input_text": "<>;/ .* /,$_[$']=sprintf'%06d'x2,$&,++$\n$&for sort{$a-$b}map\"@{[(glob)[1,0],$%++]}\",<>;print\"@_\"", "language": "Perl", "metadata": {"date": 1541404973, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "low_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/Perl/s050774880.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s050774880", "user_id": "u283869437"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "<>;/ .* /,$_[$']=sprintf'%06d'x2,$&,++$\n$&for sort{$a-$b}map\"@{[(glob)[1,0],$%++]}\",<>;print\"@_\"", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1379, "memory_kb": 60788}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s494974001", "group_id": "codeNet:p03224", "input_text": "$s.=\"\n@{[$k-1,$t+1..$s!~s/$/v9.++$t/mge+$t]}\"for 2..($k=$_=(1+sqrt<>*8+1)/2);print/\\./?No:\"Yes\n$_\n\".~-$k.$s", "language": "Perl", "metadata": {"date": 1540706648, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03224.html", "problem_id": "p03224", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03224/input.txt", "sample_output_relpath": "derived/input_output/data/p03224/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03224/Perl/s494974001.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s494974001", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n3\n2 1 2\n2 3 1\n2 2 3\n", "input_to_evaluate": "$s.=\"\n@{[$k-1,$t+1..$s!~s/$/v9.++$t/mge+$t]}\"for 2..($k=$_=(1+sqrt<>*8+1)/2);print/\\./?No:\"Yes\n$_\n\".~-$k.$s", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given an integer N. Determine if there exists a tuple of subsets of \\{1,2,...N\\}, (S_1,S_2,...,S_k), that satisfies the following conditions:\n\nEach of the integers 1,2,...,N is contained in exactly two of the sets S_1,S_2,...,S_k.\n\nAny two of the sets S_1,S_2,...,S_k have exactly one element in common.\n\nIf such a tuple exists, construct one such tuple.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf a tuple of subsets of \\{1,2,...N\\} that satisfies the conditions does not exist, print No.\nIf such a tuple exists, print Yes first, then print such subsets in the following format:\n\nk\n|S_1| S_{1,1} S_{1,2} ... S_{1,|S_1|}\n:\n|S_k| S_{k,1} S_{k,2} ... S_{k,|S_k|}\n\nwhere S_i={S_{i,1},S_{i,2},...,S_{i,|S_i|}}.\n\nIf there are multiple such tuples, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nYes\n3\n2 1 2\n2 3 1\n2 2 3\n\nIt can be seen that (S_1,S_2,S_3)=(\\{1,2\\},\\{3,1\\},\\{2,3\\}) satisfies the conditions.\n\nSample Input 2\n\n4\n\nSample Output 2\n\nNo", "sample_input": "3\n"}, "reference_outputs": ["Yes\n3\n2 1 2\n2 3 1\n2 2 3\n"], "source_document_id": "p03224", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given an integer N. Determine if there exists a tuple of subsets of \\{1,2,...N\\}, (S_1,S_2,...,S_k), that satisfies the following conditions:\n\nEach of the integers 1,2,...,N is contained in exactly two of the sets S_1,S_2,...,S_k.\n\nAny two of the sets S_1,S_2,...,S_k have exactly one element in common.\n\nIf such a tuple exists, construct one such tuple.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf a tuple of subsets of \\{1,2,...N\\} that satisfies the conditions does not exist, print No.\nIf such a tuple exists, print Yes first, then print such subsets in the following format:\n\nk\n|S_1| S_{1,1} S_{1,2} ... S_{1,|S_1|}\n:\n|S_k| S_{k,1} S_{k,2} ... S_{k,|S_k|}\n\nwhere S_i={S_{i,1},S_{i,2},...,S_{i,|S_i|}}.\n\nIf there are multiple such tuples, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nYes\n3\n2 1 2\n2 3 1\n2 2 3\n\nIt can be seen that (S_1,S_2,S_3)=(\\{1,2\\},\\{3,1\\},\\{2,3\\}) satisfies the conditions.\n\nSample Input 2\n\n4\n\nSample Output 2\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 240, "memory_kb": 4668}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s879632281", "group_id": "codeNet:p03227", "input_text": "(get,.flip)[?/.../].say", "language": "Perl", "metadata": {"date": 1540696430, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03227.html", "problem_id": "p03227", "resource_group": "low_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/Perl/s879632281.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s879632281", "user_id": "u657913472"}, "prompt_components": {"gold_output": "cba\n", "input_to_evaluate": "(get,.flip)[?/.../].say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 23, "cpu_time_ms": 320, "memory_kb": 66424}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s089456764", "group_id": "codeNet:p03232", "input_text": "sub p{my($a,$b)=@_;$b?p($a**2%$=,$b>>1)*($b%2?$a:1)%$=:1}@s=map$%=($%+p$_,($==1e9+7)-2)%$=,1..<>;$\\+=$_*($s[$i++]+$s[-$i]-1)%$=for glob<>;$\\=$\\*++$j%$=for@s;print", "language": "Perl", "metadata": {"date": 1539492988, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03232.html", "problem_id": "p03232", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03232/input.txt", "sample_output_relpath": "derived/input_output/data/p03232/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03232/Perl/s089456764.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s089456764", "user_id": "u657913472"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "sub p{my($a,$b)=@_;$b?p($a**2%$=,$b>>1)*($b%2?$a:1)%$=:1}@s=map$%=($%+p$_,($==1e9+7)-2)%$=,1..<>;$\\+=$_*($s[$i++]+$s[-$i]-1)%$=for glob<>;$\\=$\\*++$j%$=for@s;print", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere are N blocks arranged in a row, numbered 1 to N from left to right.\nEach block has a weight, and the weight of Block i is A_i.\nSnuke will perform the following operation on these blocks N times:\n\nChoose one block that is still not removed, and remove it.\nThe cost of this operation is the sum of the weights of the blocks that are connected to the block being removed (including itself).\nHere, two blocks x and y ( x \\leq y ) are connected when, for all z ( x \\leq z \\leq y ), Block z is still not removed.\n\nThere are N! possible orders in which Snuke removes the blocks.\nFor all of those N! orders, find the total cost of the N operations, and calculate the sum of those N! total costs.\nAs the answer can be extremely large, compute the sum modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nFor all of the N! orders, find the total cost of the N operations, and print the sum of those N! total costs, modulo 10^9+7.\n\nSample Input 1\n\n2\n1 2\n\nSample Output 1\n\n9\n\nFirst, we will consider the order \"Block 1 -> Block 2\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 2, as only Block 2 remains.\nThus, the total cost of the two operations for this order is 3+2=5.\n\nThen, we will consider the order \"Block 2 -> Block 1\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 1, as only Block 1 remains.\nThus, the total cost of the two operations for this order is 3+1=4.\n\nTherefore, the answer is 5+4=9.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n212\n\nSample Input 3\n\n10\n1 2 4 8 16 32 64 128 256 512\n\nSample Output 3\n\n880971923", "sample_input": "2\n1 2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03232", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N blocks arranged in a row, numbered 1 to N from left to right.\nEach block has a weight, and the weight of Block i is A_i.\nSnuke will perform the following operation on these blocks N times:\n\nChoose one block that is still not removed, and remove it.\nThe cost of this operation is the sum of the weights of the blocks that are connected to the block being removed (including itself).\nHere, two blocks x and y ( x \\leq y ) are connected when, for all z ( x \\leq z \\leq y ), Block z is still not removed.\n\nThere are N! possible orders in which Snuke removes the blocks.\nFor all of those N! orders, find the total cost of the N operations, and calculate the sum of those N! total costs.\nAs the answer can be extremely large, compute the sum modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nFor all of the N! orders, find the total cost of the N operations, and print the sum of those N! total costs, modulo 10^9+7.\n\nSample Input 1\n\n2\n1 2\n\nSample Output 1\n\n9\n\nFirst, we will consider the order \"Block 1 -> Block 2\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 2, as only Block 2 remains.\nThus, the total cost of the two operations for this order is 3+2=5.\n\nThen, we will consider the order \"Block 2 -> Block 1\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 1, as only Block 1 remains.\nThus, the total cost of the two operations for this order is 3+1=4.\n\nTherefore, the answer is 5+4=9.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n212\n\nSample Input 3\n\n10\n1 2 4 8 16 32 64 128 256 512\n\nSample Output 3\n\n880971923", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 162, "cpu_time_ms": 1993, "memory_kb": 34892}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s505147528", "group_id": "codeNet:p03232", "input_text": "sub p{my($a,$b)=@_;$b?p($a**2%$=,$b>>1)*($b%2?$a:1)%$=:1}$==1e9+7;@s=map$%=($%+p$_,$=-2)%$=,++$f..<>;$s+=$_*($s[$i++]+$s[-$i]-1)%$=,$f=$f*$i%$=for glob<>;print$s*$f%$m", "language": "Perl", "metadata": {"date": 1539492472, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03232.html", "problem_id": "p03232", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03232/input.txt", "sample_output_relpath": "derived/input_output/data/p03232/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03232/Perl/s505147528.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s505147528", "user_id": "u657913472"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "sub p{my($a,$b)=@_;$b?p($a**2%$=,$b>>1)*($b%2?$a:1)%$=:1}$==1e9+7;@s=map$%=($%+p$_,$=-2)%$=,++$f..<>;$s+=$_*($s[$i++]+$s[-$i]-1)%$=,$f=$f*$i%$=for glob<>;print$s*$f%$m", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere are N blocks arranged in a row, numbered 1 to N from left to right.\nEach block has a weight, and the weight of Block i is A_i.\nSnuke will perform the following operation on these blocks N times:\n\nChoose one block that is still not removed, and remove it.\nThe cost of this operation is the sum of the weights of the blocks that are connected to the block being removed (including itself).\nHere, two blocks x and y ( x \\leq y ) are connected when, for all z ( x \\leq z \\leq y ), Block z is still not removed.\n\nThere are N! possible orders in which Snuke removes the blocks.\nFor all of those N! orders, find the total cost of the N operations, and calculate the sum of those N! total costs.\nAs the answer can be extremely large, compute the sum modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nFor all of the N! orders, find the total cost of the N operations, and print the sum of those N! total costs, modulo 10^9+7.\n\nSample Input 1\n\n2\n1 2\n\nSample Output 1\n\n9\n\nFirst, we will consider the order \"Block 1 -> Block 2\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 2, as only Block 2 remains.\nThus, the total cost of the two operations for this order is 3+2=5.\n\nThen, we will consider the order \"Block 2 -> Block 1\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 1, as only Block 1 remains.\nThus, the total cost of the two operations for this order is 3+1=4.\n\nTherefore, the answer is 5+4=9.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n212\n\nSample Input 3\n\n10\n1 2 4 8 16 32 64 128 256 512\n\nSample Output 3\n\n880971923", "sample_input": "2\n1 2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03232", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N blocks arranged in a row, numbered 1 to N from left to right.\nEach block has a weight, and the weight of Block i is A_i.\nSnuke will perform the following operation on these blocks N times:\n\nChoose one block that is still not removed, and remove it.\nThe cost of this operation is the sum of the weights of the blocks that are connected to the block being removed (including itself).\nHere, two blocks x and y ( x \\leq y ) are connected when, for all z ( x \\leq z \\leq y ), Block z is still not removed.\n\nThere are N! possible orders in which Snuke removes the blocks.\nFor all of those N! orders, find the total cost of the N operations, and calculate the sum of those N! total costs.\nAs the answer can be extremely large, compute the sum modulo 10^9+7.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nFor all of the N! orders, find the total cost of the N operations, and print the sum of those N! total costs, modulo 10^9+7.\n\nSample Input 1\n\n2\n1 2\n\nSample Output 1\n\n9\n\nFirst, we will consider the order \"Block 1 -> Block 2\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 2, as only Block 2 remains.\nThus, the total cost of the two operations for this order is 3+2=5.\n\nThen, we will consider the order \"Block 2 -> Block 1\".\nIn the first operation, the cost of the operation is 1+2=3, as Block 1 and 2 are connected.\nIn the second operation, the cost of the operation is 1, as only Block 1 remains.\nThus, the total cost of the two operations for this order is 3+1=4.\n\nTherefore, the answer is 5+4=9.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n212\n\nSample Input 3\n\n10\n1 2 4 8 16 32 64 128 256 512\n\nSample Output 3\n\n880971923", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 167, "cpu_time_ms": 1909, "memory_kb": 34892}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s574717589", "group_id": "codeNet:p03238", "input_text": "<>;print<>+<>||\"Hello World\"", "language": "Perl", "metadata": {"date": 1550792843, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03238.html", "problem_id": "p03238", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03238/input.txt", "sample_output_relpath": "derived/input_output/data/p03238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03238/Perl/s574717589.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s574717589", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Hello World\n", "input_to_evaluate": "<>;print<>+<>||\"Hello World\"", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "sample_input": "1\n"}, "reference_outputs": ["Hello World\n"], "source_document_id": "p03238", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 28, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s032589880", "group_id": "codeNet:p03238", "input_text": "print<>-1?\"Hello World\":<>+<>", "language": "Perl", "metadata": {"date": 1543817671, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03238.html", "problem_id": "p03238", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03238/input.txt", "sample_output_relpath": "derived/input_output/data/p03238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03238/Perl/s032589880.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s032589880", "user_id": "u601082779"}, "prompt_components": {"gold_output": "Hello World\n", "input_to_evaluate": "print<>-1?\"Hello World\":<>+<>", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "sample_input": "1\n"}, "reference_outputs": ["Hello World\n"], "source_document_id": "p03238", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 29, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s896945916", "group_id": "codeNet:p03239", "input_text": "<>=~$\";print`sort -n|awk '\\$2<=$''` =~/\\d+/?$&:TLE", "language": "Perl", "metadata": {"date": 1538888065, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03239.html", "problem_id": "p03239", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03239/input.txt", "sample_output_relpath": "derived/input_output/data/p03239/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03239/Perl/s896945916.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s896945916", "user_id": "u019489252"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "<>=~$\";print`sort -n|awk '\\$2<=$''` =~/\\d+/?$&:TLE", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWhen Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.\n\nYou, the smartwatch, has found N routes to his home.\n\nIf Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i.\n\nFind the smallest cost of a route that takes not longer than time T.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq T \\leq 1000\n\n1 \\leq c_i \\leq 1000\n\n1 \\leq t_i \\leq 1000\n\nThe pairs (c_i, t_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nc_1 t_1\nc_2 t_2\n:\nc_N t_N\n\nOutput\n\nPrint the smallest cost of a route that takes not longer than time T.\n\nIf there is no route that takes not longer than time T, print TLE instead.\n\nSample Input 1\n\n3 70\n7 60\n1 80\n4 50\n\nSample Output 1\n\n4\n\nThe first route gets him home at cost 7.\n\nThe second route takes longer than time T = 70.\n\nThe third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\nSample Input 2\n\n4 3\n1 1000\n2 4\n3 1000\n4 500\n\nSample Output 2\n\nTLE\n\nThere is no route that takes not longer than time T = 3.\n\nSample Input 3\n\n5 9\n25 8\n5 9\n4 10\n1000 1000\n6 1\n\nSample Output 3\n\n5", "sample_input": "3 70\n7 60\n1 80\n4 50\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03239", "source_text": "Score : 200 points\n\nProblem Statement\n\nWhen Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.\n\nYou, the smartwatch, has found N routes to his home.\n\nIf Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i.\n\nFind the smallest cost of a route that takes not longer than time T.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq T \\leq 1000\n\n1 \\leq c_i \\leq 1000\n\n1 \\leq t_i \\leq 1000\n\nThe pairs (c_i, t_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nc_1 t_1\nc_2 t_2\n:\nc_N t_N\n\nOutput\n\nPrint the smallest cost of a route that takes not longer than time T.\n\nIf there is no route that takes not longer than time T, print TLE instead.\n\nSample Input 1\n\n3 70\n7 60\n1 80\n4 50\n\nSample Output 1\n\n4\n\nThe first route gets him home at cost 7.\n\nThe second route takes longer than time T = 70.\n\nThe third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\nSample Input 2\n\n4 3\n1 1000\n2 4\n3 1000\n4 500\n\nSample Output 2\n\nTLE\n\nThere is no route that takes not longer than time T = 3.\n\nSample Input 3\n\n5 9\n25 8\n5 9\n4 10\n1000 1000\n6 1\n\nSample Output 3\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 50, "cpu_time_ms": 4, "memory_kb": 796}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s490747005", "group_id": "codeNet:p03239", "input_text": "<>=~$\";$'<(glob)[1]or($c||=1e3)-=$-=$c-$_ for<>;print$c||TLE", "language": "Perl", "metadata": {"date": 1538877468, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03239.html", "problem_id": "p03239", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03239/input.txt", "sample_output_relpath": "derived/input_output/data/p03239/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03239/Perl/s490747005.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s490747005", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "<>=~$\";$'<(glob)[1]or($c||=1e3)-=$-=$c-$_ for<>;print$c||TLE", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWhen Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.\n\nYou, the smartwatch, has found N routes to his home.\n\nIf Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i.\n\nFind the smallest cost of a route that takes not longer than time T.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq T \\leq 1000\n\n1 \\leq c_i \\leq 1000\n\n1 \\leq t_i \\leq 1000\n\nThe pairs (c_i, t_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nc_1 t_1\nc_2 t_2\n:\nc_N t_N\n\nOutput\n\nPrint the smallest cost of a route that takes not longer than time T.\n\nIf there is no route that takes not longer than time T, print TLE instead.\n\nSample Input 1\n\n3 70\n7 60\n1 80\n4 50\n\nSample Output 1\n\n4\n\nThe first route gets him home at cost 7.\n\nThe second route takes longer than time T = 70.\n\nThe third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\nSample Input 2\n\n4 3\n1 1000\n2 4\n3 1000\n4 500\n\nSample Output 2\n\nTLE\n\nThere is no route that takes not longer than time T = 3.\n\nSample Input 3\n\n5 9\n25 8\n5 9\n4 10\n1000 1000\n6 1\n\nSample Output 3\n\n5", "sample_input": "3 70\n7 60\n1 80\n4 50\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03239", "source_text": "Score : 200 points\n\nProblem Statement\n\nWhen Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.\n\nYou, the smartwatch, has found N routes to his home.\n\nIf Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i.\n\nFind the smallest cost of a route that takes not longer than time T.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq T \\leq 1000\n\n1 \\leq c_i \\leq 1000\n\n1 \\leq t_i \\leq 1000\n\nThe pairs (c_i, t_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nc_1 t_1\nc_2 t_2\n:\nc_N t_N\n\nOutput\n\nPrint the smallest cost of a route that takes not longer than time T.\n\nIf there is no route that takes not longer than time T, print TLE instead.\n\nSample Input 1\n\n3 70\n7 60\n1 80\n4 50\n\nSample Output 1\n\n4\n\nThe first route gets him home at cost 7.\n\nThe second route takes longer than time T = 70.\n\nThe third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\nSample Input 2\n\n4 3\n1 1000\n2 4\n3 1000\n4 500\n\nSample Output 2\n\nTLE\n\nThere is no route that takes not longer than time T = 3.\n\nSample Input 3\n\n5 9\n25 8\n5 9\n4 10\n1000 1000\n6 1\n\nSample Output 3\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 60, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s431000188", "group_id": "codeNet:p03241", "input_text": "<>=~$\";$'%$_||push@_,$_,$'/$_ for 1..sqrt$';$\\+=$-=$_*$`<=$'&&$_-$\\for@_;print", "language": "Perl", "metadata": {"date": 1538876482, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03241.html", "problem_id": "p03241", "resource_group": "low_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/Perl/s431000188.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s431000188", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>=~$\";$'%$_||push@_,$_,$'/$_ for 1..sqrt$';$\\+=$-=$_*$`<=$'&&$_-$\\for@_;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s307759202", "group_id": "codeNet:p03242", "input_text": "say 1110-get", "language": "Perl", "metadata": {"date": 1538282381, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03242.html", "problem_id": "p03242", "resource_group": "low_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/Perl/s307759202.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s307759202", "user_id": "u657913472"}, "prompt_components": {"gold_output": "991\n", "input_to_evaluate": "say 1110-get", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 12, "cpu_time_ms": 122, "memory_kb": 48384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s712227399", "group_id": "codeNet:p03243", "input_text": "@s = split(//, <>);\n\nif(($s[0] == $s[1]) and ($s[1] == $s[2])){\n}else{\n\t@cmp = ($s[0] , $s[0] , $s[0]);\n\tif(int(join(\"\", @cmp)) < int(join(\"\", @s))){\n\t\t@s = ($s[0] + 1, $s[0] + 1, $s[0] + 1);\n\t}else{\n\t\t@s = @cmp;\n\t}\n}\n\nprintf join(\"\", @s) . \"\\n\";\n", "language": "Perl", "metadata": {"date": 1569271939, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03243.html", "problem_id": "p03243", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03243/input.txt", "sample_output_relpath": "derived/input_output/data/p03243/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03243/Perl/s712227399.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s712227399", "user_id": "u609426052"}, "prompt_components": {"gold_output": "111\n", "input_to_evaluate": "@s = split(//, <>);\n\nif(($s[0] == $s[1]) and ($s[1] == $s[2])){\n}else{\n\t@cmp = ($s[0] , $s[0] , $s[0]);\n\tif(int(join(\"\", @cmp)) < int(join(\"\", @s))){\n\t\t@s = ($s[0] + 1, $s[0] + 1, $s[0] + 1);\n\t}else{\n\t\t@s = @cmp;\n\t}\n}\n\nprintf join(\"\", @s) . \"\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKurohashi has never participated in AtCoder Beginner Contest (ABC).\n\nThe next ABC to be held is ABC N (the N-th ABC ever held).\nKurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.\n\nWhat is the earliest ABC where Kurohashi can make his debut?\n\nConstraints\n\n100 \\leq N \\leq 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 the earliest ABC where Kurohashi can make his debut is ABC n, print n.\n\nSample Input 1\n\n111\n\nSample Output 1\n\n111\n\nThe next ABC to be held is ABC 111, where Kurohashi can make his debut.\n\nSample Input 2\n\n112\n\nSample Output 2\n\n222\n\nThe next ABC to be held is ABC 112, which means Kurohashi can no longer participate in ABC 111.\nAmong the ABCs where Kurohashi can make his debut, the earliest one is ABC 222.\n\nSample Input 3\n\n750\n\nSample Output 3\n\n777", "sample_input": "111\n"}, "reference_outputs": ["111\n"], "source_document_id": "p03243", "source_text": "Score : 200 points\n\nProblem Statement\n\nKurohashi has never participated in AtCoder Beginner Contest (ABC).\n\nThe next ABC to be held is ABC N (the N-th ABC ever held).\nKurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.\n\nWhat is the earliest ABC where Kurohashi can make his debut?\n\nConstraints\n\n100 \\leq N \\leq 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 the earliest ABC where Kurohashi can make his debut is ABC n, print n.\n\nSample Input 1\n\n111\n\nSample Output 1\n\n111\n\nThe next ABC to be held is ABC 111, where Kurohashi can make his debut.\n\nSample Input 2\n\n112\n\nSample Output 2\n\n222\n\nThe next ABC to be held is ABC 112, which means Kurohashi can no longer participate in ABC 111.\nAmong the ABCs where Kurohashi can make his debut, the earliest one is ABC 222.\n\nSample Input 3\n\n750\n\nSample Output 3\n\n777", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s923570378", "group_id": "codeNet:p03243", "input_text": "#!/usr/bin/perl\n#B - AtCoder Beginner Contest 111\n\nuse strict;\nuse warnings;\n\n# データ取得\nour ($data);\n\n\n {\n $data = ;\n chomp($data);\n }\n\n {\n my ($lsb) = 111;\n $data = int(int(($data / $lsb) + 0.9) * $lsb);\n }\n\nprint(\"$data\\n\");\n\nexit(0);\n", "language": "Perl", "metadata": {"date": 1538270758, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03243.html", "problem_id": "p03243", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03243/input.txt", "sample_output_relpath": "derived/input_output/data/p03243/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03243/Perl/s923570378.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s923570378", "user_id": "u942748670"}, "prompt_components": {"gold_output": "111\n", "input_to_evaluate": "#!/usr/bin/perl\n#B - AtCoder Beginner Contest 111\n\nuse strict;\nuse warnings;\n\n# データ取得\nour ($data);\n\n\n {\n $data = ;\n chomp($data);\n }\n\n {\n my ($lsb) = 111;\n $data = int(int(($data / $lsb) + 0.9) * $lsb);\n }\n\nprint(\"$data\\n\");\n\nexit(0);\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKurohashi has never participated in AtCoder Beginner Contest (ABC).\n\nThe next ABC to be held is ABC N (the N-th ABC ever held).\nKurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.\n\nWhat is the earliest ABC where Kurohashi can make his debut?\n\nConstraints\n\n100 \\leq N \\leq 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 the earliest ABC where Kurohashi can make his debut is ABC n, print n.\n\nSample Input 1\n\n111\n\nSample Output 1\n\n111\n\nThe next ABC to be held is ABC 111, where Kurohashi can make his debut.\n\nSample Input 2\n\n112\n\nSample Output 2\n\n222\n\nThe next ABC to be held is ABC 112, which means Kurohashi can no longer participate in ABC 111.\nAmong the ABCs where Kurohashi can make his debut, the earliest one is ABC 222.\n\nSample Input 3\n\n750\n\nSample Output 3\n\n777", "sample_input": "111\n"}, "reference_outputs": ["111\n"], "source_document_id": "p03243", "source_text": "Score : 200 points\n\nProblem Statement\n\nKurohashi has never participated in AtCoder Beginner Contest (ABC).\n\nThe next ABC to be held is ABC N (the N-th ABC ever held).\nKurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.\n\nWhat is the earliest ABC where Kurohashi can make his debut?\n\nConstraints\n\n100 \\leq N \\leq 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 the earliest ABC where Kurohashi can make his debut is ABC n, print n.\n\nSample Input 1\n\n111\n\nSample Output 1\n\n111\n\nThe next ABC to be held is ABC 111, where Kurohashi can make his debut.\n\nSample Input 2\n\n112\n\nSample Output 2\n\n222\n\nThe next ABC to be held is ABC 112, which means Kurohashi can no longer participate in ABC 111.\nAmong the ABCs where Kurohashi can make his debut, the earliest one is ABC 222.\n\nSample Input 3\n\n750\n\nSample Output 3\n\n777", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s036349593", "group_id": "codeNet:p03246", "input_text": "<>;$h[$|--]{$_}--for@n=glob<>;($u,$x,$v,$y)=map$h[$i++/2]{$_},@a=map{(sort{$$_{$a}-$$_{$b}}keys%$_)[0,1]}@h;print@n+$u+(\"@a\"-$a[2]?$v:$y-($-=$u+$y-$v-$x))", "language": "Perl", "metadata": {"date": 1538285307, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03246.html", "problem_id": "p03246", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03246/input.txt", "sample_output_relpath": "derived/input_output/data/p03246/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03246/Perl/s036349593.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s036349593", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>;$h[$|--]{$_}--for@n=glob<>;($u,$x,$v,$y)=map$h[$i++/2]{$_},@a=map{(sort{$$_{$a}-$$_{$b}}keys%$_)[0,1]}@h;print@n+$u+(\"@a\"-$a[2]?$v:$y-($-=$u+$y-$v-$x))", "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": "p03246", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 370, "memory_kb": 38016}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s133700671", "group_id": "codeNet:p03248", "input_text": "#!perl -pl\n/^0/|chop|reverse!~$_?$_=-1:s/./$. @{[$&?$.:$_=$\u0006++]}\n/g", "language": "Perl", "metadata": {"date": 1546373032, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03248.html", "problem_id": "p03248", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03248/input.txt", "sample_output_relpath": "derived/input_output/data/p03248/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03248/Perl/s133700671.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s133700671", "user_id": "u700849772"}, "prompt_components": {"gold_output": "-1\n", "input_to_evaluate": "#!perl -pl\n/^0/|chop|reverse!~$_?$_=-1:s/./$. @{[$&?$.:$_=$\u0006++]}\n/g", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given a string s of length n.\nDoes a tree with n vertices that satisfies the following conditions exist?\n\nThe vertices are numbered 1,2,..., n.\n\nThe edges are numbered 1,2,..., n-1, and Edge i connects Vertex u_i and v_i.\n\nIf the i-th character in s is 1, we can have a connected component of size i by removing one edge from the tree.\n\nIf the i-th character in s is 0, we cannot have a connected component of size i by removing any one edge from the tree.\n\nIf such a tree exists, construct one such tree.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\ns is a string of length n consisting of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf a tree with n vertices that satisfies the conditions does not exist, print -1.\n\nIf a tree with n vertices that satisfies the conditions exist, print n-1 lines.\nThe i-th line should contain u_i and v_i with a space in between.\nIf there are multiple trees that satisfy the conditions, any such tree will be accepted.\n\nSample Input 1\n\n1111\n\nSample Output 1\n\n-1\n\nIt is impossible to have a connected component of size n after removing one edge from a tree with n vertices.\n\nSample Input 2\n\n1110\n\nSample Output 2\n\n1 2\n2 3\n3 4\n\nIf Edge 1 or Edge 3 is removed, we will have a connected component of size 1 and another of size 3. If Edge 2 is removed, we will have two connected components, each of size 2.\n\nSample Input 3\n\n1010\n\nSample Output 3\n\n1 2\n1 3\n1 4\n\nRemoving any edge will result in a connected component of size 1 and another of size 3.", "sample_input": "1111\n"}, "reference_outputs": ["-1\n"], "source_document_id": "p03248", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given a string s of length n.\nDoes a tree with n vertices that satisfies the following conditions exist?\n\nThe vertices are numbered 1,2,..., n.\n\nThe edges are numbered 1,2,..., n-1, and Edge i connects Vertex u_i and v_i.\n\nIf the i-th character in s is 1, we can have a connected component of size i by removing one edge from the tree.\n\nIf the i-th character in s is 0, we cannot have a connected component of size i by removing any one edge from the tree.\n\nIf such a tree exists, construct one such tree.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\ns is a string of length n consisting of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf a tree with n vertices that satisfies the conditions does not exist, print -1.\n\nIf a tree with n vertices that satisfies the conditions exist, print n-1 lines.\nThe i-th line should contain u_i and v_i with a space in between.\nIf there are multiple trees that satisfy the conditions, any such tree will be accepted.\n\nSample Input 1\n\n1111\n\nSample Output 1\n\n-1\n\nIt is impossible to have a connected component of size n after removing one edge from a tree with n vertices.\n\nSample Input 2\n\n1110\n\nSample Output 2\n\n1 2\n2 3\n3 4\n\nIf Edge 1 or Edge 3 is removed, we will have a connected component of size 1 and another of size 3. If Edge 2 is removed, we will have two connected components, each of size 2.\n\nSample Input 3\n\n1010\n\nSample Output 3\n\n1 2\n1 3\n1 4\n\nRemoving any edge will result in a connected component of size 1 and another of size 3.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 151, "memory_kb": 26240}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s050990611", "group_id": "codeNet:p03248", "input_text": "#!perl -pl\n/^0/|chop|reverse!~$_?$_=-1:s/./$. @{[$&?$.=$\u0006++:$\u0006++]}\n/g", "language": "Perl", "metadata": {"date": 1546361196, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03248.html", "problem_id": "p03248", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03248/input.txt", "sample_output_relpath": "derived/input_output/data/p03248/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03248/Perl/s050990611.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s050990611", "user_id": "u283869437"}, "prompt_components": {"gold_output": "-1\n", "input_to_evaluate": "#!perl -pl\n/^0/|chop|reverse!~$_?$_=-1:s/./$. @{[$&?$.=$\u0006++:$\u0006++]}\n/g", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given a string s of length n.\nDoes a tree with n vertices that satisfies the following conditions exist?\n\nThe vertices are numbered 1,2,..., n.\n\nThe edges are numbered 1,2,..., n-1, and Edge i connects Vertex u_i and v_i.\n\nIf the i-th character in s is 1, we can have a connected component of size i by removing one edge from the tree.\n\nIf the i-th character in s is 0, we cannot have a connected component of size i by removing any one edge from the tree.\n\nIf such a tree exists, construct one such tree.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\ns is a string of length n consisting of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf a tree with n vertices that satisfies the conditions does not exist, print -1.\n\nIf a tree with n vertices that satisfies the conditions exist, print n-1 lines.\nThe i-th line should contain u_i and v_i with a space in between.\nIf there are multiple trees that satisfy the conditions, any such tree will be accepted.\n\nSample Input 1\n\n1111\n\nSample Output 1\n\n-1\n\nIt is impossible to have a connected component of size n after removing one edge from a tree with n vertices.\n\nSample Input 2\n\n1110\n\nSample Output 2\n\n1 2\n2 3\n3 4\n\nIf Edge 1 or Edge 3 is removed, we will have a connected component of size 1 and another of size 3. If Edge 2 is removed, we will have two connected components, each of size 2.\n\nSample Input 3\n\n1010\n\nSample Output 3\n\n1 2\n1 3\n1 4\n\nRemoving any edge will result in a connected component of size 1 and another of size 3.", "sample_input": "1111\n"}, "reference_outputs": ["-1\n"], "source_document_id": "p03248", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given a string s of length n.\nDoes a tree with n vertices that satisfies the following conditions exist?\n\nThe vertices are numbered 1,2,..., n.\n\nThe edges are numbered 1,2,..., n-1, and Edge i connects Vertex u_i and v_i.\n\nIf the i-th character in s is 1, we can have a connected component of size i by removing one edge from the tree.\n\nIf the i-th character in s is 0, we cannot have a connected component of size i by removing any one edge from the tree.\n\nIf such a tree exists, construct one such tree.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\ns is a string of length n consisting of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf a tree with n vertices that satisfies the conditions does not exist, print -1.\n\nIf a tree with n vertices that satisfies the conditions exist, print n-1 lines.\nThe i-th line should contain u_i and v_i with a space in between.\nIf there are multiple trees that satisfy the conditions, any such tree will be accepted.\n\nSample Input 1\n\n1111\n\nSample Output 1\n\n-1\n\nIt is impossible to have a connected component of size n after removing one edge from a tree with n vertices.\n\nSample Input 2\n\n1110\n\nSample Output 2\n\n1 2\n2 3\n3 4\n\nIf Edge 1 or Edge 3 is removed, we will have a connected component of size 1 and another of size 3. If Edge 2 is removed, we will have two connected components, each of size 2.\n\nSample Input 3\n\n1010\n\nSample Output 3\n\n1 2\n1 3\n1 4\n\nRemoving any edge will result in a connected component of size 1 and another of size 3.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 153, "memory_kb": 26240}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s676275196", "group_id": "codeNet:p03248", "input_text": "$_=<>;chop;print/^0/|chop|reverse!~$_?-1:s/./ $. @{[$&?$.=$\u0006++:$\u0006++]}/gr", "language": "Perl", "metadata": {"date": 1546360620, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03248.html", "problem_id": "p03248", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03248/input.txt", "sample_output_relpath": "derived/input_output/data/p03248/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03248/Perl/s676275196.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s676275196", "user_id": "u283869437"}, "prompt_components": {"gold_output": "-1\n", "input_to_evaluate": "$_=<>;chop;print/^0/|chop|reverse!~$_?-1:s/./ $. @{[$&?$.=$\u0006++:$\u0006++]}/gr", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given a string s of length n.\nDoes a tree with n vertices that satisfies the following conditions exist?\n\nThe vertices are numbered 1,2,..., n.\n\nThe edges are numbered 1,2,..., n-1, and Edge i connects Vertex u_i and v_i.\n\nIf the i-th character in s is 1, we can have a connected component of size i by removing one edge from the tree.\n\nIf the i-th character in s is 0, we cannot have a connected component of size i by removing any one edge from the tree.\n\nIf such a tree exists, construct one such tree.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\ns is a string of length n consisting of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf a tree with n vertices that satisfies the conditions does not exist, print -1.\n\nIf a tree with n vertices that satisfies the conditions exist, print n-1 lines.\nThe i-th line should contain u_i and v_i with a space in between.\nIf there are multiple trees that satisfy the conditions, any such tree will be accepted.\n\nSample Input 1\n\n1111\n\nSample Output 1\n\n-1\n\nIt is impossible to have a connected component of size n after removing one edge from a tree with n vertices.\n\nSample Input 2\n\n1110\n\nSample Output 2\n\n1 2\n2 3\n3 4\n\nIf Edge 1 or Edge 3 is removed, we will have a connected component of size 1 and another of size 3. If Edge 2 is removed, we will have two connected components, each of size 2.\n\nSample Input 3\n\n1010\n\nSample Output 3\n\n1 2\n1 3\n1 4\n\nRemoving any edge will result in a connected component of size 1 and another of size 3.", "sample_input": "1111\n"}, "reference_outputs": ["-1\n"], "source_document_id": "p03248", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given a string s of length n.\nDoes a tree with n vertices that satisfies the following conditions exist?\n\nThe vertices are numbered 1,2,..., n.\n\nThe edges are numbered 1,2,..., n-1, and Edge i connects Vertex u_i and v_i.\n\nIf the i-th character in s is 1, we can have a connected component of size i by removing one edge from the tree.\n\nIf the i-th character in s is 0, we cannot have a connected component of size i by removing any one edge from the tree.\n\nIf such a tree exists, construct one such tree.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\ns is a string of length n consisting of 0 and 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf a tree with n vertices that satisfies the conditions does not exist, print -1.\n\nIf a tree with n vertices that satisfies the conditions exist, print n-1 lines.\nThe i-th line should contain u_i and v_i with a space in between.\nIf there are multiple trees that satisfy the conditions, any such tree will be accepted.\n\nSample Input 1\n\n1111\n\nSample Output 1\n\n-1\n\nIt is impossible to have a connected component of size n after removing one edge from a tree with n vertices.\n\nSample Input 2\n\n1110\n\nSample Output 2\n\n1 2\n2 3\n3 4\n\nIf Edge 1 or Edge 3 is removed, we will have a connected component of size 1 and another of size 3. If Edge 2 is removed, we will have two connected components, each of size 2.\n\nSample Input 3\n\n1010\n\nSample Output 3\n\n1 2\n1 3\n1 4\n\nRemoving any edge will result in a connected component of size 1 and another of size 3.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 153, "memory_kb": 26240}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s036409190", "group_id": "codeNet:p03252", "input_text": "#!/usr/bin/perl\nuse strict;\nuse warnings;\nuse Data::Dumper;\nuse 5.010;\nmy @args;\nfor (<>) {\n chomp $_;\n push @args, $_;\n}\n\nmy @S = split \"\", shift @args;\nmy @T = split \"\", shift @args;\n\nmy %map;\nmy $ret;\nfor my $i (0 .. $#S) {\n if ($map{$T[$i]} and $map{$T[$i]} ne $S[$i]) {\n $ret = \"No\";\n last;\n }\n $map{$T[$i]} = $S[$i];\n}\n$ret ||= \"Yes\";\n\nsay \"Yes\";\n\n__END__\n\n", "language": "Perl", "metadata": {"date": 1537755112, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03252.html", "problem_id": "p03252", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03252/input.txt", "sample_output_relpath": "derived/input_output/data/p03252/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03252/Perl/s036409190.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s036409190", "user_id": "u243453868"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "#!/usr/bin/perl\nuse strict;\nuse warnings;\nuse Data::Dumper;\nuse 5.010;\nmy @args;\nfor (<>) {\n chomp $_;\n push @args, $_;\n}\n\nmy @S = split \"\", shift @args;\nmy @T = split \"\", shift @args;\n\nmy %map;\nmy $ret;\nfor my $i (0 .. $#S) {\n if ($map{$T[$i]} and $map{$T[$i]} ne $S[$i]) {\n $ret = \"No\";\n last;\n }\n $map{$T[$i]} = $S[$i];\n}\n$ret ||= \"Yes\";\n\nsay \"Yes\";\n\n__END__\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\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 S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "sample_input": "azzel\napple\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03252", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\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 S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 192, "memory_kb": 44448}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s534843987", "group_id": "codeNet:p03253", "input_text": "#!/usr/bin/env perl\n\nuse Math::BigInt;\n\n$mod = 1_000_000_007;\n\nchomp($_ = );\n($n, $m) = split(/ /);\n\n$res = 1;\nfor($p = 2;$p <= $m; $p++) {\n $b = 0;\n $v = Math::BigInt->new(1);\n while ($m % $p == 0) {\n $b++;\n $m /= $p;\n\n $v *= $n - 1 + $b;\n $v /= $b;\n }\n $res = $res * $v % $mod;\n}\n\nprint $res;\n", "language": "Perl", "metadata": {"date": 1553327997, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03253.html", "problem_id": "p03253", "resource_group": "low_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/Perl/s534843987.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s534843987", "user_id": "u803102116"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "#!/usr/bin/env perl\n\nuse Math::BigInt;\n\n$mod = 1_000_000_007;\n\nchomp($_ = );\n($n, $m) = split(/ /);\n\n$res = 1;\nfor($p = 2;$p <= $m; $p++) {\n $b = 0;\n $v = Math::BigInt->new(1);\n while ($m % $p == 0) {\n $b++;\n $m /= $p;\n\n $v *= $n - 1 + $b;\n $v /= $b;\n }\n $res = $res * $v % $mod;\n}\n\nprint $res;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 319, "cpu_time_ms": 2104, "memory_kb": 4608}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s261128189", "group_id": "codeNet:p03254", "input_text": "$-=$'+<>=~$\";print grep($--=$_,sort{$a-$b}glob<>)-!--$-", "language": "Perl", "metadata": {"date": 1579682045, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "low_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/Perl/s261128189.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s261128189", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$-=$'+<>=~$\";print grep($--=$_,sort{$a-$b}glob<>)-!--$-", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 55, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s310110017", "group_id": "codeNet:p03263", "input_text": "<>=~$\";@a=glob`dd`;$a[$_-1]%2&&($%=$_%$'?$_:$_<$`*$'&&$_-1+$')&&++$a[$%]+push@_,\"@{[map{$_/$'+1|0,$_%$'+1}$_-1,$%]}\n\"for 1..$`*$';print@_.$/,@_", "language": "Perl", "metadata": {"date": 1536460226, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03263.html", "problem_id": "p03263", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03263/input.txt", "sample_output_relpath": "derived/input_output/data/p03263/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03263/Perl/s310110017.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s310110017", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n", "input_to_evaluate": "<>=~$\";@a=glob`dd`;$a[$_-1]%2&&($%=$_%$'?$_:$_<$`*$'&&$_-1+$')&&++$a[$%]+push@_,\"@{[map{$_/$'+1|0,$_%$'+1}$_-1,$%]}\n\"for 1..$`*$';print@_.$/,@_", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a grid of square cells with H horizontal rows and W vertical columns. The cell at the i-th row and the j-th column will be denoted as Cell (i, j).\n\nIn Cell (i, j), a_{ij} coins are placed.\n\nYou can perform the following operation any number of times:\n\nOperation: Choose a cell that was not chosen before and contains one or more coins, then move one of those coins to a vertically or horizontally adjacent cell.\n\nMaximize the number of cells containing an even number of coins.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 500\n\n0 \\leq a_{ij} \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11} a_{12} ... a_{1W}\na_{21} a_{22} ... a_{2W}\n:\na_{H1} a_{H2} ... a_{HW}\n\nOutput\n\nPrint a sequence of operations that maximizes the number of cells containing an even number of coins, in the following format:\n\nN\ny_1 x_1 y_1' x_1'\ny_2 x_2 y_2' x_2'\n:\ny_N x_N y_N' x_N'\n\nThat is, in the first line, print an integer N between 0 and H \\times W (inclusive), representing the number of operations.\n\nIn the (i+1)-th line (1 \\leq i \\leq N), print four integers y_i, x_i, y_i' and x_i' (1 \\leq y_i, y_i' \\leq H and 1 \\leq x_i, x_i' \\leq W), representing the i-th operation. These four integers represents the operation of moving one of the coins placed in Cell (y_i, x_i) to a vertically or horizontally adjacent cell, (y_i', x_i').\n\nNote that if the specified operation violates the specification in the problem statement or the output format is invalid, it will result in Wrong Answer.\n\nSample Input 1\n\n2 3\n1 2 3\n0 1 1\n\nSample Output 1\n\n3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n\nEvery cell contains an even number of coins after the following sequence of operations:\n\nMove the coin in Cell (2, 2) to Cell (2, 3).\n\nMove the coin in Cell (1, 1) to Cell (1, 2).\n\nMove one of the coins in Cell (1, 3) to Cell (1, 2).\n\nSample Input 2\n\n3 2\n1 0\n2 1\n1 0\n\nSample Output 2\n\n3\n1 1 1 2\n1 2 2 2\n3 1 3 2\n\nSample Input 3\n\n1 5\n9 9 9 9 9\n\nSample Output 3\n\n2\n1 1 1 2\n1 3 1 4", "sample_input": "2 3\n1 2 3\n0 1 1\n"}, "reference_outputs": ["3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n"], "source_document_id": "p03263", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a grid of square cells with H horizontal rows and W vertical columns. The cell at the i-th row and the j-th column will be denoted as Cell (i, j).\n\nIn Cell (i, j), a_{ij} coins are placed.\n\nYou can perform the following operation any number of times:\n\nOperation: Choose a cell that was not chosen before and contains one or more coins, then move one of those coins to a vertically or horizontally adjacent cell.\n\nMaximize the number of cells containing an even number of coins.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 500\n\n0 \\leq a_{ij} \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11} a_{12} ... a_{1W}\na_{21} a_{22} ... a_{2W}\n:\na_{H1} a_{H2} ... a_{HW}\n\nOutput\n\nPrint a sequence of operations that maximizes the number of cells containing an even number of coins, in the following format:\n\nN\ny_1 x_1 y_1' x_1'\ny_2 x_2 y_2' x_2'\n:\ny_N x_N y_N' x_N'\n\nThat is, in the first line, print an integer N between 0 and H \\times W (inclusive), representing the number of operations.\n\nIn the (i+1)-th line (1 \\leq i \\leq N), print four integers y_i, x_i, y_i' and x_i' (1 \\leq y_i, y_i' \\leq H and 1 \\leq x_i, x_i' \\leq W), representing the i-th operation. These four integers represents the operation of moving one of the coins placed in Cell (y_i, x_i) to a vertically or horizontally adjacent cell, (y_i', x_i').\n\nNote that if the specified operation violates the specification in the problem statement or the output format is invalid, it will result in Wrong Answer.\n\nSample Input 1\n\n2 3\n1 2 3\n0 1 1\n\nSample Output 1\n\n3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n\nEvery cell contains an even number of coins after the following sequence of operations:\n\nMove the coin in Cell (2, 2) to Cell (2, 3).\n\nMove the coin in Cell (1, 1) to Cell (1, 2).\n\nMove one of the coins in Cell (1, 3) to Cell (1, 2).\n\nSample Input 2\n\n3 2\n1 0\n2 1\n1 0\n\nSample Output 2\n\n3\n1 1 1 2\n1 2 2 2\n3 1 3 2\n\nSample Input 3\n\n1 5\n9 9 9 9 9\n\nSample Output 3\n\n2\n1 1 1 2\n1 3 1 4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 143, "cpu_time_ms": 767, "memory_kb": 64328}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s800996993", "group_id": "codeNet:p03265", "input_text": "$/=get.words;($2+$1-$3,$3+$2-$0,$0+$1-$3,$1+$2-$0).say", "language": "Perl", "metadata": {"date": 1572219841, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03265.html", "problem_id": "p03265", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03265/input.txt", "sample_output_relpath": "derived/input_output/data/p03265/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03265/Perl/s800996993.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s800996993", "user_id": "u032223772"}, "prompt_components": {"gold_output": "-1 1 -1 0\n", "input_to_evaluate": "$/=get.words;($2+$1-$3,$3+$2-$0,$0+$1-$3,$1+$2-$0).say", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order.\n(Assume that the positive x-axis points right, and the positive y-axis points up.)\n\nTakahashi remembers (x_1,y_1) and (x_2,y_2), but he has forgot (x_3,y_3) and (x_4,y_4).\n\nGiven x_1,x_2,y_1,y_2, restore x_3,y_3,x_4,y_4. It can be shown that x_3,y_3,x_4 and y_4 uniquely exist and have integer values.\n\nConstraints\n\n|x_1|,|y_1|,|x_2|,|y_2| \\leq 100\n\n(x_1,y_1) ≠ (x_2,y_2)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 y_1 x_2 y_2\n\nOutput\n\nPrint x_3,y_3,x_4 and y_4 as integers, in this order.\n\nSample Input 1\n\n0 0 0 1\n\nSample Output 1\n\n-1 1 -1 0\n\n(0,0),(0,1),(-1,1),(-1,0) is the four vertices of a square in counter-clockwise order.\nNote that (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) is not accepted, as the vertices are in clockwise order.\n\nSample Input 2\n\n2 3 6 6\n\nSample Output 2\n\n3 10 -1 7\n\nSample Input 3\n\n31 -41 -59 26\n\nSample Output 3\n\n-126 -64 -36 -131", "sample_input": "0 0 0 1\n"}, "reference_outputs": ["-1 1 -1 0\n"], "source_document_id": "p03265", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order.\n(Assume that the positive x-axis points right, and the positive y-axis points up.)\n\nTakahashi remembers (x_1,y_1) and (x_2,y_2), but he has forgot (x_3,y_3) and (x_4,y_4).\n\nGiven x_1,x_2,y_1,y_2, restore x_3,y_3,x_4,y_4. It can be shown that x_3,y_3,x_4 and y_4 uniquely exist and have integer values.\n\nConstraints\n\n|x_1|,|y_1|,|x_2|,|y_2| \\leq 100\n\n(x_1,y_1) ≠ (x_2,y_2)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 y_1 x_2 y_2\n\nOutput\n\nPrint x_3,y_3,x_4 and y_4 as integers, in this order.\n\nSample Input 1\n\n0 0 0 1\n\nSample Output 1\n\n-1 1 -1 0\n\n(0,0),(0,1),(-1,1),(-1,0) is the four vertices of a square in counter-clockwise order.\nNote that (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) is not accepted, as the vertices are in clockwise order.\n\nSample Input 2\n\n2 3 6 6\n\nSample Output 2\n\n3 10 -1 7\n\nSample Input 3\n\n31 -41 -59 26\n\nSample Output 3\n\n-126 -64 -36 -131", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 156, "memory_kb": 50804}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s654266068", "group_id": "codeNet:p03265", "input_text": "get~~m:g/\\S+/;($1+$2-$3,$2+$3-$0,$0+$1-$3,$1+$2-$0)>>.say", "language": "Perl", "metadata": {"date": 1535873861, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03265.html", "problem_id": "p03265", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03265/input.txt", "sample_output_relpath": "derived/input_output/data/p03265/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03265/Perl/s654266068.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s654266068", "user_id": "u657913472"}, "prompt_components": {"gold_output": "-1 1 -1 0\n", "input_to_evaluate": "get~~m:g/\\S+/;($1+$2-$3,$2+$3-$0,$0+$1-$3,$1+$2-$0)>>.say", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order.\n(Assume that the positive x-axis points right, and the positive y-axis points up.)\n\nTakahashi remembers (x_1,y_1) and (x_2,y_2), but he has forgot (x_3,y_3) and (x_4,y_4).\n\nGiven x_1,x_2,y_1,y_2, restore x_3,y_3,x_4,y_4. It can be shown that x_3,y_3,x_4 and y_4 uniquely exist and have integer values.\n\nConstraints\n\n|x_1|,|y_1|,|x_2|,|y_2| \\leq 100\n\n(x_1,y_1) ≠ (x_2,y_2)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 y_1 x_2 y_2\n\nOutput\n\nPrint x_3,y_3,x_4 and y_4 as integers, in this order.\n\nSample Input 1\n\n0 0 0 1\n\nSample Output 1\n\n-1 1 -1 0\n\n(0,0),(0,1),(-1,1),(-1,0) is the four vertices of a square in counter-clockwise order.\nNote that (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) is not accepted, as the vertices are in clockwise order.\n\nSample Input 2\n\n2 3 6 6\n\nSample Output 2\n\n3 10 -1 7\n\nSample Input 3\n\n31 -41 -59 26\n\nSample Output 3\n\n-126 -64 -36 -131", "sample_input": "0 0 0 1\n"}, "reference_outputs": ["-1 1 -1 0\n"], "source_document_id": "p03265", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order.\n(Assume that the positive x-axis points right, and the positive y-axis points up.)\n\nTakahashi remembers (x_1,y_1) and (x_2,y_2), but he has forgot (x_3,y_3) and (x_4,y_4).\n\nGiven x_1,x_2,y_1,y_2, restore x_3,y_3,x_4,y_4. It can be shown that x_3,y_3,x_4 and y_4 uniquely exist and have integer values.\n\nConstraints\n\n|x_1|,|y_1|,|x_2|,|y_2| \\leq 100\n\n(x_1,y_1) ≠ (x_2,y_2)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 y_1 x_2 y_2\n\nOutput\n\nPrint x_3,y_3,x_4 and y_4 as integers, in this order.\n\nSample Input 1\n\n0 0 0 1\n\nSample Output 1\n\n-1 1 -1 0\n\n(0,0),(0,1),(-1,1),(-1,0) is the four vertices of a square in counter-clockwise order.\nNote that (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) is not accepted, as the vertices are in clockwise order.\n\nSample Input 2\n\n2 3 6 6\n\nSample Output 2\n\n3 10 -1 7\n\nSample Input 3\n\n31 -41 -59 26\n\nSample Output 3\n\n-126 -64 -36 -131", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 318, "memory_kb": 67696}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s729589674", "group_id": "codeNet:p03268", "input_text": "get~~m:g/\\d+/;say ($0/$1+|0)³+$1%%2*(($0-$1+>2)div+$1+1)³", "language": "Perl", "metadata": {"date": 1535859709, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03268.html", "problem_id": "p03268", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03268/input.txt", "sample_output_relpath": "derived/input_output/data/p03268/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03268/Perl/s729589674.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s729589674", "user_id": "u657913472"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "get~~m:g/\\d+/;say ($0/$1+|0)³+$1%%2*(($0-$1+>2)div+$1+1)³", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\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\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "sample_input": "3 2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03268", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\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\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 59, "cpu_time_ms": 326, "memory_kb": 67348}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s614851020", "group_id": "codeNet:p03273", "input_text": "$_={[Z~] $/=.grep(/\\#/)>>.comb};.(.(lines)).put", "language": "Perl", "metadata": {"date": 1535260552, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03273.html", "problem_id": "p03273", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03273/input.txt", "sample_output_relpath": "derived/input_output/data/p03273/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03273/Perl/s614851020.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s614851020", "user_id": "u657913472"}, "prompt_components": {"gold_output": "###\n###\n.##\n", "input_to_evaluate": "$_={[Z~] $/=.grep(/\\#/)>>.comb};.(.(lines)).put", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "sample_input": "4 4\n##.#\n....\n##.#\n.#.#\n"}, "reference_outputs": ["###\n###\n.##\n"], "source_document_id": "p03273", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 698, "memory_kb": 81652}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s639480570", "group_id": "codeNet:p03276", "input_text": "$K=$'-<>=~$\";$\u0014-=$-=$K<$`&&$\u0014-($r=$_[$K++])+$_-abs${-$_>$r?r:_}for@_=glob<>;print$\u0014", "language": "Perl", "metadata": {"date": 1579520283, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03276.html", "problem_id": "p03276", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03276/input.txt", "sample_output_relpath": "derived/input_output/data/p03276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03276/Perl/s639480570.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s639480570", "user_id": "u657913472"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "$K=$'-<>=~$\";$\u0014-=$-=$K<$`&&$\u0014-($r=$_[$K++])+$_-abs${-$_>$r?r:_}for@_=glob<>;print$\u0014", "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": "p03276", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 312, "memory_kb": 28160}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s033933964", "group_id": "codeNet:p03276", "input_text": "$K=$'-<>=~$\";$\\=1e9;$\\-=$-=$K<$`&&$\\-($r=$_[$K++])+$_-abs(abs>abs$r?$r:$_)for@_=glob<>;print", "language": "Perl", "metadata": {"date": 1535263647, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03276.html", "problem_id": "p03276", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03276/input.txt", "sample_output_relpath": "derived/input_output/data/p03276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03276/Perl/s033933964.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s033933964", "user_id": "u283869437"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "$K=$'-<>=~$\";$\\=1e9;$\\-=$-=$K<$`&&$\\-($r=$_[$K++])+$_-abs(abs>abs$r?$r:$_)for@_=glob<>;print", "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": "p03276", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 92, "cpu_time_ms": 351, "memory_kb": 28160}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s869671189", "group_id": "codeNet:p03276", "input_text": "$\\=1e9;$\\-=$-=$\\-($r=$_[$K++])+$_-abs(abs>abs$r?$r:$_)for(@_=glob<>)[<>!~$\"..$`-($K=$')--];print", "language": "Perl", "metadata": {"date": 1535263007, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03276.html", "problem_id": "p03276", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03276/input.txt", "sample_output_relpath": "derived/input_output/data/p03276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03276/Perl/s869671189.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s869671189", "user_id": "u283869437"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "$\\=1e9;$\\-=$-=$\\-($r=$_[$K++])+$_-abs(abs>abs$r?$r:$_)for(@_=glob<>)[<>!~$\"..$`-($K=$')--];print", "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": "p03276", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 308, "memory_kb": 30060}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s125824194", "group_id": "codeNet:p03276", "input_text": "$\\=1e9;$\\-=$-=$\\-($l=$-=-shift@a)-($r=$-=$_)-${$l<$r?l:r}for(@a=sort{$a-$b}glob<>)[$'-<>=~$\"..$`-1];print", "language": "Perl", "metadata": {"date": 1535250005, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03276.html", "problem_id": "p03276", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03276/input.txt", "sample_output_relpath": "derived/input_output/data/p03276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03276/Perl/s125824194.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s125824194", "user_id": "u657913472"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "$\\=1e9;$\\-=$-=$\\-($l=$-=-shift@a)-($r=$-=$_)-${$l<$r?l:r}for(@a=sort{$a-$b}glob<>)[$'-<>=~$\"..$`-1];print", "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": "p03276", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 105, "cpu_time_ms": 318, "memory_kb": 32104}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s043170934", "group_id": "codeNet:p03277", "input_text": "<>;@a=glob<>;map{$b[$s=@a]=@b=$N=$c=0;$c+=$N+=2*$_>$l+$\u0014?-$b[++$s]:$b[$s--],$b[$s]++for@a;$c*4/@a>@a+1?$\u0014:$l=$l+$\u0014>>1}1..35;print$\u0014", "language": "Perl", "metadata": {"date": 1579495444, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03277.html", "problem_id": "p03277", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03277/input.txt", "sample_output_relpath": "derived/input_output/data/p03277/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03277/Perl/s043170934.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s043170934", "user_id": "u657913472"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "<>;@a=glob<>;map{$b[$s=@a]=@b=$N=$c=0;$c+=$N+=2*$_>$l+$\u0014?-$b[++$s]:$b[$s--],$b[$s]++for@a;$c*4/@a>@a+1?$\u0014:$l=$l+$\u0014>>1}1..35;print$\u0014", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\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 median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "sample_input": "3\n10 30 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03277", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\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 median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 131, "cpu_time_ms": 1642, "memory_kb": 28296}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s415321668", "group_id": "codeNet:p03277", "input_text": "<>;@a=glob<>;$\\=1e9;map{$b[$s=@a]=@b=$N=$c=0;$c+=$N+=2*$_>$l+$\\?-$b[++$s]:$b[$s--],$b[$s]++for@a;$c/@a>@a/4?$\\:$l=$l+$\\>>1}1..35;print", "language": "Perl", "metadata": {"date": 1574894014, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03277.html", "problem_id": "p03277", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03277/input.txt", "sample_output_relpath": "derived/input_output/data/p03277/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03277/Perl/s415321668.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s415321668", "user_id": "u657913472"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "<>;@a=glob<>;$\\=1e9;map{$b[$s=@a]=@b=$N=$c=0;$c+=$N+=2*$_>$l+$\\?-$b[++$s]:$b[$s--],$b[$s]++for@a;$c/@a>@a/4?$\\:$l=$l+$\\>>1}1..35;print", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\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 median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "sample_input": "3\n10 30 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03277", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\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 median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1739, "memory_kb": 27784}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s888560539", "group_id": "codeNet:p03280", "input_text": "say [*] get.words >>->>1", "language": "Perl", "metadata": {"date": 1544234014, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03280.html", "problem_id": "p03280", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03280/input.txt", "sample_output_relpath": "derived/input_output/data/p03280/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03280/Perl/s888560539.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s888560539", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "say [*] get.words >>->>1", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)\n\nWhat is the area of this yard excluding the roads? Find it.\n\nNote\n\nIt can be proved that the positions of the roads do not affect the area.\n\nConstraints\n\nA is an integer between 2 and 100 (inclusive).\n\nB is an integer between 2 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the area of this yard excluding the roads (in square yards).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n1\n\nIn this case, the area is 1 square yard.\n\nSample Input 2\n\n5 7\n\nSample Output 2\n\n24\n\nIn this case, the area is 24 square yards.", "sample_input": "2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03280", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)\n\nWhat is the area of this yard excluding the roads? Find it.\n\nNote\n\nIt can be proved that the positions of the roads do not affect the area.\n\nConstraints\n\nA is an integer between 2 and 100 (inclusive).\n\nB is an integer between 2 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the area of this yard excluding the roads (in square yards).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n1\n\nIn this case, the area is 1 square yard.\n\nSample Input 2\n\n5 7\n\nSample Output 2\n\n24\n\nIn this case, the area is 24 square yards.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 24, "cpu_time_ms": 284, "memory_kb": 62504}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s801179298", "group_id": "codeNet:p03281", "input_text": "say sum |^4,2.8 X<=get/30-3.5", "language": "Perl", "metadata": {"date": 1572214707, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03281.html", "problem_id": "p03281", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03281/input.txt", "sample_output_relpath": "derived/input_output/data/p03281/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03281/Perl/s801179298.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s801179298", "user_id": "u032223772"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "say sum |^4,2.8 X<=get/30-3.5", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 29, "cpu_time_ms": 304, "memory_kb": 64120}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s600285308", "group_id": "codeNet:p03281", "input_text": "say sum (|^4,2.8)X<=get/30-3.5", "language": "Perl", "metadata": {"date": 1572214020, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03281.html", "problem_id": "p03281", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03281/input.txt", "sample_output_relpath": "derived/input_output/data/p03281/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03281/Perl/s600285308.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s600285308", "user_id": "u032223772"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "say sum (|^4,2.8)X<=get/30-3.5", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 286, "memory_kb": 62588}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s827397021", "group_id": "codeNet:p03281", "input_text": "sub factor($n) {\n +(1..$n).grep({$n %% $_});\n}\n\nmy $n = +get;\nsay +(1, 3 ... $n).grep({factor($_) == 8});\n", "language": "Perl", "metadata": {"date": 1560553239, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03281.html", "problem_id": "p03281", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03281/input.txt", "sample_output_relpath": "derived/input_output/data/p03281/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03281/Perl/s827397021.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s827397021", "user_id": "u390181802"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "sub factor($n) {\n +(1..$n).grep({$n %% $_});\n}\n\nmy $n = +get;\nsay +(1, 3 ... $n).grep({factor($_) == 8});\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 343, "memory_kb": 69124}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s164422260", "group_id": "codeNet:p03282", "input_text": "$_=<>;print$_=~(1x(<>%99))||/[^1]/&&$&", "language": "Perl", "metadata": {"date": 1574420149, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03282.html", "problem_id": "p03282", "resource_group": "low_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/Perl/s164422260.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s164422260", "user_id": "u207056619"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$_=<>;print$_=~(1x(<>%99))||/[^1]/&&$&", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s914727064", "group_id": "codeNet:p03283", "input_text": "#!/usr/bin/perl\n\nmy ($n,$m,$q) = map {$_ - 0} split(/\\s+/o,);\n\nmy @d = ();\nmy @d2 = ();\nfor(my $i=0;$i<$n;$i++){\n my @dm1 = ();\n $#dm1 = $n-1;\n push(@d,\\@dm1);\n my @dm2 = ();\n $#dm2 = $n-1;\n push(@d2,\\@dm2);\n}\n\nfor(my $i=0;$i<$m;$i++){\n my ($l,$r) = map {$_ - 0} split(/\\s+/o,);\n $d[$l-1]->[$r-1] += 1;\n}\n\n$d2[$n-1]->[$n-1] = $d[$n-1]->[$n-1];\nif( $n>=2 ){\n for(my $i=$n-2;$i>=0;$i--){\n my $tot = 0;\n for(my $j=$i;$j<$n;$j++){\n $tot += ( $d[$i]->[$j] - 0 );\n $d2[$i]->[$j] = $tot + $d2[$i+1]->[$j];\n }\n }\n}\n\nfor(my $i=0;$i<$q;$i++){\n my ($p,$qq) = map {$_ - 0} split(/\\s+/o,);\n my $v = $d2[$p-1]->[$qq-1] - 0;\n print \"$v\\n\";\n}\n\nexit(0);\n", "language": "Perl", "metadata": {"date": 1535259569, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03283.html", "problem_id": "p03283", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03283/input.txt", "sample_output_relpath": "derived/input_output/data/p03283/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03283/Perl/s914727064.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s914727064", "user_id": "u750383873"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n,$m,$q) = map {$_ - 0} split(/\\s+/o,);\n\nmy @d = ();\nmy @d2 = ();\nfor(my $i=0;$i<$n;$i++){\n my @dm1 = ();\n $#dm1 = $n-1;\n push(@d,\\@dm1);\n my @dm2 = ();\n $#dm2 = $n-1;\n push(@d2,\\@dm2);\n}\n\nfor(my $i=0;$i<$m;$i++){\n my ($l,$r) = map {$_ - 0} split(/\\s+/o,);\n $d[$l-1]->[$r-1] += 1;\n}\n\n$d2[$n-1]->[$n-1] = $d[$n-1]->[$n-1];\nif( $n>=2 ){\n for(my $i=$n-2;$i>=0;$i--){\n my $tot = 0;\n for(my $j=$i;$j<$n;$j++){\n $tot += ( $d[$i]->[$j] - 0 );\n $d2[$i]->[$j] = $tot + $d2[$i+1]->[$j];\n }\n }\n}\n\nfor(my $i=0;$i<$q;$i++){\n my ($p,$qq) = map {$_ - 0} split(/\\s+/o,);\n my $v = $d2[$p-1]->[$qq-1] - 0;\n print \"$v\\n\";\n}\n\nexit(0);\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "sample_input": "2 3 1\n1 1\n1 2\n2 2\n1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03283", "source_text": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 690, "cpu_time_ms": 502, "memory_kb": 14592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s694403012", "group_id": "codeNet:p03284", "input_text": "#!/usr/bin/perl\n<>=~$\";print$`%$'?1:0", "language": "Perl", "metadata": {"date": 1562722015, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03284.html", "problem_id": "p03284", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03284/input.txt", "sample_output_relpath": "derived/input_output/data/p03284/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03284/Perl/s694403012.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s694403012", "user_id": "u557138271"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\n<>=~$\";print$`%$'?1:0", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\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 (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "sample_input": "7 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03284", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\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 (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s279920228", "group_id": "codeNet:p03284", "input_text": "print<>=~$\"-$`%$'==0", "language": "Perl", "metadata": {"date": 1550985855, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03284.html", "problem_id": "p03284", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03284/input.txt", "sample_output_relpath": "derived/input_output/data/p03284/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03284/Perl/s279920228.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s279920228", "user_id": "u832039789"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "print<>=~$\"-$`%$'==0", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\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 (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "sample_input": "7 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03284", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\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 (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s146407736", "group_id": "codeNet:p03285", "input_text": "say [20-($_=get)>+^-$_%4*8]", "language": "Perl", "metadata": {"date": 1572209883, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03285.html", "problem_id": "p03285", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03285/input.txt", "sample_output_relpath": "derived/input_output/data/p03285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03285/Perl/s146407736.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s146407736", "user_id": "u032223772"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "say [20-($_=get)>+^-$_%4*8]", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "sample_input": "11\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03285", "source_text": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 35, "cpu_time_ms": 265, "memory_kb": 63352}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s150044080", "group_id": "codeNet:p03286", "input_text": "$t=$==<>;@s=($=%2,@s),$==-($=-=$=<0)/2while$=;print$t&&@s", "language": "Perl", "metadata": {"date": 1534039132, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03286.html", "problem_id": "p03286", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03286/input.txt", "sample_output_relpath": "derived/input_output/data/p03286/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03286/Perl/s150044080.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s150044080", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1011\n", "input_to_evaluate": "$t=$==<>;@s=($=%2,@s),$==-($=-=$=<0)/2while$=;print$t&&@s", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven an integer N, find the base -2 representation of N.\n\nHere, S is the base -2 representation of N when the following are all satisfied:\n\nS is a string consisting of 0 and 1.\n\nUnless S = 0, the initial character of S is 1.\n\nLet S = S_k S_{k-1} ... S_0, then S_0 \\times (-2)^0 + S_1 \\times (-2)^1 + ... + S_k \\times (-2)^k = N.\n\nIt can be proved that, for any integer M, the base -2 representation of M is uniquely determined.\n\nConstraints\n\nEvery value in input is integer.\n\n-10^9 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the base -2 representation of N.\n\nSample Input 1\n\n-9\n\nSample Output 1\n\n1011\n\nAs (-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9, 1011 is the base -2 representation of -9.\n\nSample Input 2\n\n123456789\n\nSample Output 2\n\n11000101011001101110100010101\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "-9\n"}, "reference_outputs": ["1011\n"], "source_document_id": "p03286", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven an integer N, find the base -2 representation of N.\n\nHere, S is the base -2 representation of N when the following are all satisfied:\n\nS is a string consisting of 0 and 1.\n\nUnless S = 0, the initial character of S is 1.\n\nLet S = S_k S_{k-1} ... S_0, then S_0 \\times (-2)^0 + S_1 \\times (-2)^1 + ... + S_k \\times (-2)^k = N.\n\nIt can be proved that, for any integer M, the base -2 representation of M is uniquely determined.\n\nConstraints\n\nEvery value in input is integer.\n\n-10^9 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the base -2 representation of N.\n\nSample Input 1\n\n-9\n\nSample Output 1\n\n1011\n\nAs (-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9, 1011 is the base -2 representation of -9.\n\nSample Input 2\n\n123456789\n\nSample Output 2\n\n11000101011001101110100010101\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s142715998", "group_id": "codeNet:p03287", "input_text": "use bigint;\n($n,$m)=glob<>;\n$/=$\";\npush(@A,0);\npush(@A,($A[$#A]+$_)%$m) for<>;\n$B{$_}++ for @A;\n$o=0;\n$o+=$_*($_-1)/2 for (values %B);\nprint$o", "language": "Perl", "metadata": {"date": 1559068645, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03287.html", "problem_id": "p03287", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03287/input.txt", "sample_output_relpath": "derived/input_output/data/p03287/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03287/Perl/s142715998.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s142715998", "user_id": "u573154728"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use bigint;\n($n,$m)=glob<>;\n$/=$\";\npush(@A,0);\npush(@A,($A[$#A]+$_)%$m) for<>;\n$B{$_}++ for @A;\n$o=0;\n$o+=$_*($_-1)/2 for (values %B);\nprint$o", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies.\n\nYou will take out the candies from some consecutive boxes and distribute them evenly to M children.\n\nSuch being the case, find the number of the pairs (l, r) that satisfy the following:\n\nl and r are both integers and satisfy 1 \\leq l \\leq r \\leq N.\n\nA_l + A_{l+1} + ... + A_r is a multiple of M.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n2 \\leq M \\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 M\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of the pairs (l, r) that satisfy the conditions.\n\nNote that the number may not fit into a 32-bit integer type.\n\nSample Input 1\n\n3 2\n4 1 5\n\nSample Output 1\n\n3\n\nThe sum A_l + A_{l+1} + ... + A_r for each pair (l, r) is as follows:\n\nSum for (1, 1): 4\n\nSum for (1, 2): 5\n\nSum for (1, 3): 10\n\nSum for (2, 2): 1\n\nSum for (2, 3): 6\n\nSum for (3, 3): 5\n\nAmong these, three are multiples of 2.\n\nSample Input 2\n\n13 17\n29 7 5 7 9 51 7 13 8 55 42 9 81\n\nSample Output 2\n\n6\n\nSample Input 3\n\n10 400000000\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n25", "sample_input": "3 2\n4 1 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03287", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies.\n\nYou will take out the candies from some consecutive boxes and distribute them evenly to M children.\n\nSuch being the case, find the number of the pairs (l, r) that satisfy the following:\n\nl and r are both integers and satisfy 1 \\leq l \\leq r \\leq N.\n\nA_l + A_{l+1} + ... + A_r is a multiple of M.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n2 \\leq M \\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 M\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of the pairs (l, r) that satisfy the conditions.\n\nNote that the number may not fit into a 32-bit integer type.\n\nSample Input 1\n\n3 2\n4 1 5\n\nSample Output 1\n\n3\n\nThe sum A_l + A_{l+1} + ... + A_r for each pair (l, r) is as follows:\n\nSum for (1, 1): 4\n\nSum for (1, 2): 5\n\nSum for (1, 3): 10\n\nSum for (2, 2): 1\n\nSum for (2, 3): 6\n\nSum for (3, 3): 5\n\nAmong these, three are multiples of 2.\n\nSample Input 2\n\n13 17\n29 7 5 7 9 51 7 13 8 55 42 9 81\n\nSample Output 2\n\n6\n\nSample Input 3\n\n10 400000000\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n25", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2105, "memory_kb": 30976}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s900452946", "group_id": "codeNet:p03287", "input_text": "$h{0}=<>=~$\";$\\+=$h{$x=($x+$_)%$'}++for glob<>;print", "language": "Perl", "metadata": {"date": 1534036654, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03287.html", "problem_id": "p03287", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03287/input.txt", "sample_output_relpath": "derived/input_output/data/p03287/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03287/Perl/s900452946.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s900452946", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$h{0}=<>=~$\";$\\+=$h{$x=($x+$_)%$'}++for glob<>;print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies.\n\nYou will take out the candies from some consecutive boxes and distribute them evenly to M children.\n\nSuch being the case, find the number of the pairs (l, r) that satisfy the following:\n\nl and r are both integers and satisfy 1 \\leq l \\leq r \\leq N.\n\nA_l + A_{l+1} + ... + A_r is a multiple of M.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n2 \\leq M \\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 M\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of the pairs (l, r) that satisfy the conditions.\n\nNote that the number may not fit into a 32-bit integer type.\n\nSample Input 1\n\n3 2\n4 1 5\n\nSample Output 1\n\n3\n\nThe sum A_l + A_{l+1} + ... + A_r for each pair (l, r) is as follows:\n\nSum for (1, 1): 4\n\nSum for (1, 2): 5\n\nSum for (1, 3): 10\n\nSum for (2, 2): 1\n\nSum for (2, 3): 6\n\nSum for (3, 3): 5\n\nAmong these, three are multiples of 2.\n\nSample Input 2\n\n13 17\n29 7 5 7 9 51 7 13 8 55 42 9 81\n\nSample Output 2\n\n6\n\nSample Input 3\n\n10 400000000\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n25", "sample_input": "3 2\n4 1 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03287", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies.\n\nYou will take out the candies from some consecutive boxes and distribute them evenly to M children.\n\nSuch being the case, find the number of the pairs (l, r) that satisfy the following:\n\nl and r are both integers and satisfy 1 \\leq l \\leq r \\leq N.\n\nA_l + A_{l+1} + ... + A_r is a multiple of M.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n2 \\leq M \\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 M\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of the pairs (l, r) that satisfy the conditions.\n\nNote that the number may not fit into a 32-bit integer type.\n\nSample Input 1\n\n3 2\n4 1 5\n\nSample Output 1\n\n3\n\nThe sum A_l + A_{l+1} + ... + A_r for each pair (l, r) is as follows:\n\nSum for (1, 1): 4\n\nSum for (1, 2): 5\n\nSum for (1, 3): 10\n\nSum for (2, 2): 1\n\nSum for (2, 3): 6\n\nSum for (3, 3): 5\n\nAmong these, three are multiples of 2.\n\nSample Input 2\n\n13 17\n29 7 5 7 9 51 7 13 8 55 42 9 81\n\nSample Output 2\n\n6\n\nSample Input 3\n\n10 400000000\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n25", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 52, "cpu_time_ms": 313, "memory_kb": 28928}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s561363135", "group_id": "codeNet:p03288", "input_text": "print+A.(B,R,G)[<>/100+4>>4].C", "language": "Perl", "metadata": {"date": 1550800142, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03288.html", "problem_id": "p03288", "resource_group": "low_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/Perl/s561363135.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s561363135", "user_id": "u832039789"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "print+A.(B,R,G)[<>/100+4>>4].C", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s855027576", "group_id": "codeNet:p03289", "input_text": "@s = (\"\", split(//, <>));\n\n$r = \"AC\";\n$cnt = 0;\nfor $i (1 .. $#s){\n\n\tif($i == 1){\n\t\tif($s[$i] ne 'A'){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t}elsif(($i >= 3) and (($i <= $#s - 2))){\n\t\tif($s[$i] eq 'C'){\n\t\t\tif($cnt == 1){\n\t\t\t\t$r = \"WA\";\n\t\t\t\tlast;\n\t\t\t}else{\n\t\t\t\t$cnt = 1;\n\t\t\t}\n\t\t}\n\t\tif($s[$i] !~ /[a-z]/i){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t}else{\n\t\tif($s[$i]) eq 'C'){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t\tif($s[$i] !~ /[a-z]/i){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t}\n}\n$r = \"WA\" if($cnt == 0);\n\nprint \"$r\\n\";\n", "language": "Perl", "metadata": {"date": 1571782979, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03289.html", "problem_id": "p03289", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03289/input.txt", "sample_output_relpath": "derived/input_output/data/p03289/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03289/Perl/s855027576.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s855027576", "user_id": "u609426052"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "@s = (\"\", split(//, <>));\n\n$r = \"AC\";\n$cnt = 0;\nfor $i (1 .. $#s){\n\n\tif($i == 1){\n\t\tif($s[$i] ne 'A'){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t}elsif(($i >= 3) and (($i <= $#s - 2))){\n\t\tif($s[$i] eq 'C'){\n\t\t\tif($cnt == 1){\n\t\t\t\t$r = \"WA\";\n\t\t\t\tlast;\n\t\t\t}else{\n\t\t\t\t$cnt = 1;\n\t\t\t}\n\t\t}\n\t\tif($s[$i] !~ /[a-z]/i){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t}else{\n\t\tif($s[$i]) eq 'C'){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t\tif($s[$i] !~ /[a-z]/i){\n\t\t\t$r = \"WA\";\n\t\t\tlast;\n\t\t}\n\t}\n}\n$r = \"WA\" if($cnt == 0);\n\nprint \"$r\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "sample_input": "AtCoder\n"}, "reference_outputs": ["AC\n"], "source_document_id": "p03289", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s280716266", "group_id": "codeNet:p03290", "input_text": "$G=$'-<>=~$\";map{$i+=100;for$k(reverse@a=//..$<){$p[$k]+=$-=$_>$k?0:$p[$k-$_]+$i*$_+($_==$`&&$')-$p[$k]for 1..$`}}<>;printf grep$p[$_]>$G,@a", "language": "Perl", "metadata": {"date": 1550152007, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03290.html", "problem_id": "p03290", "resource_group": "low_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/Perl/s280716266.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s280716266", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$G=$'-<>=~$\";map{$i+=100;for$k(reverse@a=//..$<){$p[$k]+=$-=$_>$k?0:$p[$k-$_]+$i*$_+($_==$`&&$')-$p[$k]for 1..$`}}<>;printf grep$p[$_]>$G,@a", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 140, "cpu_time_ms": 604, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s173747047", "group_id": "codeNet:p03290", "input_text": "<>=~$\";$G=$';map{$i+=100;for$k(reverse@a=//..1e3){$p[$k]+=$-=$_>$k?0:$p[$k-$_]+$i*$_+($_==$`&&$')-$p[$k]for 1..$`}}<>;printf grep$p[$_]>=$G,@a", "language": "Perl", "metadata": {"date": 1544230886, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03290.html", "problem_id": "p03290", "resource_group": "low_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/Perl/s173747047.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s173747047", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>=~$\";$G=$';map{$i+=100;for$k(reverse@a=//..1e3){$p[$k]+=$-=$_>$k?0:$p[$k-$_]+$i*$_+($_==$`&&$')-$p[$k]for 1..$`}}<>;printf grep$p[$_]>=$G,@a", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 605, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s673629528", "group_id": "codeNet:p03293", "input_text": "$/=A;print+<>=~/(.+)(.*)\\n\\2\\1/?Yes:No", "language": "Perl", "metadata": {"date": 1559070752, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03293.html", "problem_id": "p03293", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03293/input.txt", "sample_output_relpath": "derived/input_output/data/p03293/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03293/Perl/s673629528.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s673629528", "user_id": "u573154728"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$/=A;print+<>=~/(.+)(.*)\\n\\2\\1/?Yes:No", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "sample_input": "kyoto\ntokyo\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03293", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 4, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s692771144", "group_id": "codeNet:p03294", "input_text": "say -get+(+<;map/ /+$`>$%&&++$x||$'<$%?$%=$':0,sort{$a-$b}<>;print$x+1", "language": "Perl", "metadata": {"date": 1532226061, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03295.html", "problem_id": "p03295", "resource_group": "low_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/Perl/s778647001.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s778647001", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$%=<>;map/ /+$`>$%&&++$x||$'<$%?$%=$':0,sort{$a-$b}<>;print$x+1", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 63, "cpu_time_ms": 231, "memory_kb": 19200}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s909249331", "group_id": "codeNet:p03296", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nfor my $i (1..($n-1)) {\n $a[$i] = 0 if $a[$i] == $a[$i-1];\n}\nsay scalar grep {$_==0} @a;", "language": "Perl", "metadata": {"date": 1586022850, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03296.html", "problem_id": "p03296", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03296/input.txt", "sample_output_relpath": "derived/input_output/data/p03296/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03296/Perl/s909249331.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909249331", "user_id": "u979552932"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nfor my $i (1..($n-1)) {\n $a[$i] = 0 if $a[$i] == $a[$i-1];\n}\nsay scalar grep {$_==0} @a;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.\n\nTakahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i.\nIf two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.\n\nTakahashi can change the color of one slime to any of the 10000 colors by one spell.\nHow many spells are required so that no slimes will start to combine themselves?\n\nConstraints\n\n2 \\leq N \\leq 100\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\nPrint the minimum number of spells required.\n\nSample Input 1\n\n5\n1 1 2 2 2\n\nSample Output 1\n\n2\n\nFor example, if we change the color of the second slime from the left to 4, and the color of the fourth slime to 5, the colors of the slimes will be 1, 4, 2, 5, 2, which satisfy the condition.\n\nSample Input 2\n\n3\n1 2 1\n\nSample Output 2\n\n0\n\nAlthough the colors of the first and third slimes are the same, they are not adjacent, so no spell is required.\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n2\n\nFor example, if we change the colors of the second and fourth slimes from the left to 2, the colors of the slimes will be 1, 2, 1, 2, 1, which satisfy the condition.\n\nSample Input 4\n\n14\n1 2 2 3 3 3 4 4 4 4 1 2 3 4\n\nSample Output 4\n\n4", "sample_input": "5\n1 1 2 2 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03296", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.\n\nTakahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i.\nIf two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.\n\nTakahashi can change the color of one slime to any of the 10000 colors by one spell.\nHow many spells are required so that no slimes will start to combine themselves?\n\nConstraints\n\n2 \\leq N \\leq 100\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\nPrint the minimum number of spells required.\n\nSample Input 1\n\n5\n1 1 2 2 2\n\nSample Output 1\n\n2\n\nFor example, if we change the color of the second slime from the left to 4, and the color of the fourth slime to 5, the colors of the slimes will be 1, 4, 2, 5, 2, which satisfy the condition.\n\nSample Input 2\n\n3\n1 2 1\n\nSample Output 2\n\n0\n\nAlthough the colors of the first and third slimes are the same, they are not adjacent, so no spell is required.\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n2\n\nFor example, if we change the colors of the second and fourth slimes from the left to 2, the colors of the slimes will be 1, 2, 1, 2, 1, which satisfy the condition.\n\nSample Input 4\n\n14\n1 2 2 3 3 3 4 4 4 4 1 2 3 4\n\nSample Output 4\n\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s168622392", "group_id": "codeNet:p03297", "input_text": "use v6;\n\nget;\n\nfor +<<(lines>>.words) -> ($a, $b, $c, $d) {\n if $b > $a || $b > $d {\n say \"No\";\n next;\n }\n if $b < $c {\n say \"Yes\";\n next;\n }\n my $g = $b gcd $d;\n say ($b - $g + $a % $g > $c) ?? \"No\" !! \"Yes\";\n}\n", "language": "Perl", "metadata": {"date": 1531627470, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03297.html", "problem_id": "p03297", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03297/input.txt", "sample_output_relpath": "derived/input_output/data/p03297/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03297/Perl/s168622392.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s168622392", "user_id": "u390181802"}, "prompt_components": {"gold_output": "No\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n", "input_to_evaluate": "use v6;\n\nget;\n\nfor +<<(lines>>.words) -> ($a, $b, $c, $d) {\n if $b > $a || $b > $d {\n say \"No\";\n next;\n }\n if $b < $c {\n say \"Yes\";\n next;\n }\n my $g = $b gcd $d;\n say ($b - $g + $a % $g > $c) ?? \"No\" !! \"Yes\";\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nRingo Mart, a convenience store, sells apple juice.\n\nOn the opening day of Ringo Mart, there were A cans of juice in stock in the morning.\nSnuke buys B cans of juice here every day in the daytime.\nThen, the manager checks the number of cans of juice remaining in stock every night.\nIf there are C or less cans, D new cans will be added to the stock by the next morning.\n\nDetermine if Snuke can buy juice indefinitely, that is, there is always B or more cans of juice in stock when he attempts to buy them.\nNobody besides Snuke buy juice at this store.\n\nNote that each test case in this problem consists of T queries.\n\nConstraints\n\n1 \\leq T \\leq 300\n\n1 \\leq A, B, C, D \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\nA_1 B_1 C_1 D_1\nA_2 B_2 C_2 D_2\n:\nA_T B_T C_T D_T\n\nIn the i-th query, A = A_i, B = B_i, C = C_i, D = D_i.\n\nOutput\n\nPrint T lines. The i-th line should contain Yes if Snuke can buy apple juice indefinitely in the i-th query; No otherwise.\n\nSample Input 1\n\n14\n9 7 5 9\n9 7 6 9\n14 10 7 12\n14 10 8 12\n14 10 9 12\n14 10 7 11\n14 10 8 11\n14 10 9 11\n9 10 5 10\n10 10 5 10\n11 10 5 10\n16 10 5 10\n1000000000000000000 17 14 999999999999999985\n1000000000000000000 17 15 999999999999999985\n\nSample Output 1\n\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n\nIn the first query, the number of cans of juice in stock changes as follows: (D represents daytime and N represents night.)\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 6\n→D x\n\nIn the second query, the number of cans of juice in stock changes as follows:\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 15\n→D 8\n→N 8\n→D 1\n→N 10\n→D 3\n→N 12\n→D 5\n→N 14\n→D 7\n→N 7\n→D 0\n→N 9\n→D 2\n→N 11\n→D …\n\nand so on, thus Snuke can buy juice indefinitely.\n\nSample Input 2\n\n24\n1 2 3 4\n1 2 4 3\n1 3 2 4\n1 3 4 2\n1 4 2 3\n1 4 3 2\n2 1 3 4\n2 1 4 3\n2 3 1 4\n2 3 4 1\n2 4 1 3\n2 4 3 1\n3 1 2 4\n3 1 4 2\n3 2 1 4\n3 2 4 1\n3 4 1 2\n3 4 2 1\n4 1 2 3\n4 1 3 2\n4 2 1 3\n4 2 3 1\n4 3 1 2\n4 3 2 1\n\nSample Output 2\n\nNo\nNo\nNo\nNo\nNo\nNo\nYes\nYes\nNo\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo", "sample_input": "14\n9 7 5 9\n9 7 6 9\n14 10 7 12\n14 10 8 12\n14 10 9 12\n14 10 7 11\n14 10 8 11\n14 10 9 11\n9 10 5 10\n10 10 5 10\n11 10 5 10\n16 10 5 10\n1000000000000000000 17 14 999999999999999985\n1000000000000000000 17 15 999999999999999985\n"}, "reference_outputs": ["No\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n"], "source_document_id": "p03297", "source_text": "Score : 600 points\n\nProblem Statement\n\nRingo Mart, a convenience store, sells apple juice.\n\nOn the opening day of Ringo Mart, there were A cans of juice in stock in the morning.\nSnuke buys B cans of juice here every day in the daytime.\nThen, the manager checks the number of cans of juice remaining in stock every night.\nIf there are C or less cans, D new cans will be added to the stock by the next morning.\n\nDetermine if Snuke can buy juice indefinitely, that is, there is always B or more cans of juice in stock when he attempts to buy them.\nNobody besides Snuke buy juice at this store.\n\nNote that each test case in this problem consists of T queries.\n\nConstraints\n\n1 \\leq T \\leq 300\n\n1 \\leq A, B, C, D \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\nA_1 B_1 C_1 D_1\nA_2 B_2 C_2 D_2\n:\nA_T B_T C_T D_T\n\nIn the i-th query, A = A_i, B = B_i, C = C_i, D = D_i.\n\nOutput\n\nPrint T lines. The i-th line should contain Yes if Snuke can buy apple juice indefinitely in the i-th query; No otherwise.\n\nSample Input 1\n\n14\n9 7 5 9\n9 7 6 9\n14 10 7 12\n14 10 8 12\n14 10 9 12\n14 10 7 11\n14 10 8 11\n14 10 9 11\n9 10 5 10\n10 10 5 10\n11 10 5 10\n16 10 5 10\n1000000000000000000 17 14 999999999999999985\n1000000000000000000 17 15 999999999999999985\n\nSample Output 1\n\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n\nIn the first query, the number of cans of juice in stock changes as follows: (D represents daytime and N represents night.)\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 6\n→D x\n\nIn the second query, the number of cans of juice in stock changes as follows:\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 15\n→D 8\n→N 8\n→D 1\n→N 10\n→D 3\n→N 12\n→D 5\n→N 14\n→D 7\n→N 7\n→D 0\n→N 9\n→D 2\n→N 11\n→D …\n\nand so on, thus Snuke can buy juice indefinitely.\n\nSample Input 2\n\n24\n1 2 3 4\n1 2 4 3\n1 3 2 4\n1 3 4 2\n1 4 2 3\n1 4 3 2\n2 1 3 4\n2 1 4 3\n2 3 1 4\n2 3 4 1\n2 4 1 3\n2 4 3 1\n3 1 2 4\n3 1 4 2\n3 2 1 4\n3 2 4 1\n3 4 1 2\n3 4 2 1\n4 1 2 3\n4 1 3 2\n4 2 1 3\n4 2 3 1\n4 3 1 2\n4 3 2 1\n\nSample Output 2\n\nNo\nNo\nNo\nNo\nNo\nNo\nYes\nYes\nNo\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 426, "memory_kb": 77592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s378204301", "group_id": "codeNet:p03297", "input_text": "my $n = ;\nfor (my $i=0; $i<$n; $i++){\n my ($A, $B, $C, $D) = map {$_ - 0} split(/\\s+/o,);\n if ($B > $A) {\n print \"No\".\"\\n\";\n } elsif ($B > $D) {\n print \"No\".\"\\n\";\n } elsif ($B == $D) {\n if ($C < $A-$B) {\n print \"No\".\"\\n\";\n } else {\n print \"Yes\".\"\\n\";\n }\n } else {\n if ($A > $C) {\n my $N2 = int(($A-$C)/$B);\n $A = $A - $B*$N2;\n }\n if ($C < 2*$B && $D > $B) {\n my $N3 = int($D/$B) - 1;\n $D = $D - $B*$N3;\n }\n my $N = int(($C-$A+$B)/($D-$B)) + 1;\n if ($B > ($A-$B) + ($D-$B)*$N){\n print \"No\".\"\\n\";\n } else {\n print \"Yes\".\"\\n\";\n }\n }\n}", "language": "Perl", "metadata": {"date": 1531625050, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03297.html", "problem_id": "p03297", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03297/input.txt", "sample_output_relpath": "derived/input_output/data/p03297/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03297/Perl/s378204301.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s378204301", "user_id": "u807948625"}, "prompt_components": {"gold_output": "No\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n", "input_to_evaluate": "my $n = ;\nfor (my $i=0; $i<$n; $i++){\n my ($A, $B, $C, $D) = map {$_ - 0} split(/\\s+/o,);\n if ($B > $A) {\n print \"No\".\"\\n\";\n } elsif ($B > $D) {\n print \"No\".\"\\n\";\n } elsif ($B == $D) {\n if ($C < $A-$B) {\n print \"No\".\"\\n\";\n } else {\n print \"Yes\".\"\\n\";\n }\n } else {\n if ($A > $C) {\n my $N2 = int(($A-$C)/$B);\n $A = $A - $B*$N2;\n }\n if ($C < 2*$B && $D > $B) {\n my $N3 = int($D/$B) - 1;\n $D = $D - $B*$N3;\n }\n my $N = int(($C-$A+$B)/($D-$B)) + 1;\n if ($B > ($A-$B) + ($D-$B)*$N){\n print \"No\".\"\\n\";\n } else {\n print \"Yes\".\"\\n\";\n }\n }\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nRingo Mart, a convenience store, sells apple juice.\n\nOn the opening day of Ringo Mart, there were A cans of juice in stock in the morning.\nSnuke buys B cans of juice here every day in the daytime.\nThen, the manager checks the number of cans of juice remaining in stock every night.\nIf there are C or less cans, D new cans will be added to the stock by the next morning.\n\nDetermine if Snuke can buy juice indefinitely, that is, there is always B or more cans of juice in stock when he attempts to buy them.\nNobody besides Snuke buy juice at this store.\n\nNote that each test case in this problem consists of T queries.\n\nConstraints\n\n1 \\leq T \\leq 300\n\n1 \\leq A, B, C, D \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\nA_1 B_1 C_1 D_1\nA_2 B_2 C_2 D_2\n:\nA_T B_T C_T D_T\n\nIn the i-th query, A = A_i, B = B_i, C = C_i, D = D_i.\n\nOutput\n\nPrint T lines. The i-th line should contain Yes if Snuke can buy apple juice indefinitely in the i-th query; No otherwise.\n\nSample Input 1\n\n14\n9 7 5 9\n9 7 6 9\n14 10 7 12\n14 10 8 12\n14 10 9 12\n14 10 7 11\n14 10 8 11\n14 10 9 11\n9 10 5 10\n10 10 5 10\n11 10 5 10\n16 10 5 10\n1000000000000000000 17 14 999999999999999985\n1000000000000000000 17 15 999999999999999985\n\nSample Output 1\n\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n\nIn the first query, the number of cans of juice in stock changes as follows: (D represents daytime and N represents night.)\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 6\n→D x\n\nIn the second query, the number of cans of juice in stock changes as follows:\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 15\n→D 8\n→N 8\n→D 1\n→N 10\n→D 3\n→N 12\n→D 5\n→N 14\n→D 7\n→N 7\n→D 0\n→N 9\n→D 2\n→N 11\n→D …\n\nand so on, thus Snuke can buy juice indefinitely.\n\nSample Input 2\n\n24\n1 2 3 4\n1 2 4 3\n1 3 2 4\n1 3 4 2\n1 4 2 3\n1 4 3 2\n2 1 3 4\n2 1 4 3\n2 3 1 4\n2 3 4 1\n2 4 1 3\n2 4 3 1\n3 1 2 4\n3 1 4 2\n3 2 1 4\n3 2 4 1\n3 4 1 2\n3 4 2 1\n4 1 2 3\n4 1 3 2\n4 2 1 3\n4 2 3 1\n4 3 1 2\n4 3 2 1\n\nSample Output 2\n\nNo\nNo\nNo\nNo\nNo\nNo\nYes\nYes\nNo\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo", "sample_input": "14\n9 7 5 9\n9 7 6 9\n14 10 7 12\n14 10 8 12\n14 10 9 12\n14 10 7 11\n14 10 8 11\n14 10 9 11\n9 10 5 10\n10 10 5 10\n11 10 5 10\n16 10 5 10\n1000000000000000000 17 14 999999999999999985\n1000000000000000000 17 15 999999999999999985\n"}, "reference_outputs": ["No\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n"], "source_document_id": "p03297", "source_text": "Score : 600 points\n\nProblem Statement\n\nRingo Mart, a convenience store, sells apple juice.\n\nOn the opening day of Ringo Mart, there were A cans of juice in stock in the morning.\nSnuke buys B cans of juice here every day in the daytime.\nThen, the manager checks the number of cans of juice remaining in stock every night.\nIf there are C or less cans, D new cans will be added to the stock by the next morning.\n\nDetermine if Snuke can buy juice indefinitely, that is, there is always B or more cans of juice in stock when he attempts to buy them.\nNobody besides Snuke buy juice at this store.\n\nNote that each test case in this problem consists of T queries.\n\nConstraints\n\n1 \\leq T \\leq 300\n\n1 \\leq A, B, C, D \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\nA_1 B_1 C_1 D_1\nA_2 B_2 C_2 D_2\n:\nA_T B_T C_T D_T\n\nIn the i-th query, A = A_i, B = B_i, C = C_i, D = D_i.\n\nOutput\n\nPrint T lines. The i-th line should contain Yes if Snuke can buy apple juice indefinitely in the i-th query; No otherwise.\n\nSample Input 1\n\n14\n9 7 5 9\n9 7 6 9\n14 10 7 12\n14 10 8 12\n14 10 9 12\n14 10 7 11\n14 10 8 11\n14 10 9 11\n9 10 5 10\n10 10 5 10\n11 10 5 10\n16 10 5 10\n1000000000000000000 17 14 999999999999999985\n1000000000000000000 17 15 999999999999999985\n\nSample Output 1\n\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n\nIn the first query, the number of cans of juice in stock changes as follows: (D represents daytime and N represents night.)\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 6\n→D x\n\nIn the second query, the number of cans of juice in stock changes as follows:\n\n9\n→D 2\n→N 11\n→D 4\n→N 13\n→D 6\n→N 15\n→D 8\n→N 8\n→D 1\n→N 10\n→D 3\n→N 12\n→D 5\n→N 14\n→D 7\n→N 7\n→D 0\n→N 9\n→D 2\n→N 11\n→D …\n\nand so on, thus Snuke can buy juice indefinitely.\n\nSample Input 2\n\n24\n1 2 3 4\n1 2 4 3\n1 3 2 4\n1 3 4 2\n1 4 2 3\n1 4 3 2\n2 1 3 4\n2 1 4 3\n2 3 1 4\n2 3 4 1\n2 4 1 3\n2 4 3 1\n3 1 2 4\n3 1 4 2\n3 2 1 4\n3 2 4 1\n3 4 1 2\n3 4 2 1\n4 1 2 3\n4 1 3 2\n4 2 1 3\n4 2 3 1\n4 3 1 2\n4 3 2 1\n\nSample Output 2\n\nNo\nNo\nNo\nNo\nNo\nNo\nYes\nYes\nNo\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 966, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s967660718", "group_id": "codeNet:p03303", "input_text": "say |get.comb[0,get...*]", "language": "Perl", "metadata": {"date": 1579657035, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03303.html", "problem_id": "p03303", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03303/input.txt", "sample_output_relpath": "derived/input_output/data/p03303/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03303/Perl/s967660718.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s967660718", "user_id": "u032223772"}, "prompt_components": {"gold_output": "adg\n", "input_to_evaluate": "say |get.comb[0,get...*]", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nWe will write down this string, starting a new line after every w letters. Print the string obtained by concatenating the letters at the beginnings of these lines from top to bottom.\n\nConstraints\n\n1 \\leq w \\leq |S| \\leq 1000\n\nS consists of lowercase English letters.\n\nw is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nw\n\nOutput\n\nPrint the desired string in one line.\n\nSample Input 1\n\nabcdefgh\n3\n\nSample Output 1\n\nadg\n\nWhen we write down abcdefgh, starting a new line after every three letters, we get the following:\n\nabc\n\ndef\n\ngh\n\nConcatenating the letters at the beginnings of these lines, we obtain adg.\n\nSample Input 2\n\nlllll\n1\n\nSample Output 2\n\nlllll\n\nSample Input 3\n\nsouuundhound\n2\n\nSample Output 3\n\nsuudon", "sample_input": "abcdefgh\n3\n"}, "reference_outputs": ["adg\n"], "source_document_id": "p03303", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nWe will write down this string, starting a new line after every w letters. Print the string obtained by concatenating the letters at the beginnings of these lines from top to bottom.\n\nConstraints\n\n1 \\leq w \\leq |S| \\leq 1000\n\nS consists of lowercase English letters.\n\nw is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nw\n\nOutput\n\nPrint the desired string in one line.\n\nSample Input 1\n\nabcdefgh\n3\n\nSample Output 1\n\nadg\n\nWhen we write down abcdefgh, starting a new line after every three letters, we get the following:\n\nabc\n\ndef\n\ngh\n\nConcatenating the letters at the beginnings of these lines, we obtain adg.\n\nSample Input 2\n\nlllll\n1\n\nSample Output 2\n\nlllll\n\nSample Input 3\n\nsouuundhound\n2\n\nSample Output 3\n\nsuudon", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 24, "cpu_time_ms": 422, "memory_kb": 78176}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s035979144", "group_id": "codeNet:p03307", "input_text": "say 2 lcm get", "language": "Perl", "metadata": {"date": 1530657600, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03307.html", "problem_id": "p03307", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03307/input.txt", "sample_output_relpath": "derived/input_output/data/p03307/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03307/Perl/s035979144.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s035979144", "user_id": "u657913472"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "say 2 lcm get", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\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\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03307", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\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\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 13, "cpu_time_ms": 341, "memory_kb": 60288}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s981289961", "group_id": "codeNet:p03308", "input_text": "get;say +^-minmax +<);\nmy (@a) = split(/\\s/, );\nmy $sum = 0;\n\nfor (my $i=0; $i<@a; $i++) {\n $sum += $a[$i]-$n/2;\n}\nmy $av = int($sum/$n);\n\nmy $sad = $n*$n;\nfor my $b (($av - $n/2-2)..($av - $n/2+2)) {\n my $tmp = 0;\n for (my $i=0; $i<@a; $i++) {\n\t$tmp += abs($a[$i]-($b+$i));\n }\n if ($sad > $tmp) { $sad = $tmp; }\n}\nprint $sad, \"\\n\";\n", "language": "Perl", "metadata": {"date": 1530510425, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03309.html", "problem_id": "p03309", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03309/input.txt", "sample_output_relpath": "derived/input_output/data/p03309/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03309/Perl/s781798519.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s781798519", "user_id": "u996239623"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my ($n) = split(/\\s/, );\nmy (@a) = split(/\\s/, );\nmy $sum = 0;\n\nfor (my $i=0; $i<@a; $i++) {\n $sum += $a[$i]-$n/2;\n}\nmy $av = int($sum/$n);\n\nmy $sad = $n*$n;\nfor my $b (($av - $n/2-2)..($av - $n/2+2)) {\n my $tmp = 0;\n for (my $i=0; $i<@a; $i++) {\n\t$tmp += abs($a[$i]-($b+$i));\n }\n if ($sad > $tmp) { $sad = $tmp; }\n}\nprint $sad, \"\\n\";\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "sample_input": "5\n2 2 3 5 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03309", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 364, "cpu_time_ms": 318, "memory_kb": 33868}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s011352038", "group_id": "codeNet:p03311", "input_text": "#!/usr/bin/perl\n#\nuse strict;\nuse warnings;\n\nmy $N = <>;\nmy @A = split(\" \",<>);\n\nmy $n=1;\nmy @B =sort{$a<=>$b} map{ $_-$n++ }@A;\nmy $mid = scalar(@B);\nmy $B;\nif($mid%2){\n $mid = ($mid-1)/2 - 1;\n $B = $B[$mid];\n}else{\n $mid = $mid/2 - 1;\n $mid = $B[$mid]+$B[$mid+1];\n if($mid%2){\n $B = ($mid-1)/2;\n }else{\n $B = $mid/2;\n }\n}\nmy $l=0;\nfor (my $i=1; $i<=$N; $i++){\n my $x = $A[$i-1];\n $l += abs($x-($B+$i));\n}\nprint $l;", "language": "Perl", "metadata": {"date": 1550883140, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03311.html", "problem_id": "p03311", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03311/input.txt", "sample_output_relpath": "derived/input_output/data/p03311/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03311/Perl/s011352038.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s011352038", "user_id": "u555298461"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n#\nuse strict;\nuse warnings;\n\nmy $N = <>;\nmy @A = split(\" \",<>);\n\nmy $n=1;\nmy @B =sort{$a<=>$b} map{ $_-$n++ }@A;\nmy $mid = scalar(@B);\nmy $B;\nif($mid%2){\n $mid = ($mid-1)/2 - 1;\n $B = $B[$mid];\n}else{\n $mid = $mid/2 - 1;\n $mid = $B[$mid]+$B[$mid+1];\n if($mid%2){\n $B = ($mid-1)/2;\n }else{\n $B = $mid/2;\n }\n}\nmy $l=0;\nfor (my $i=1; $i<=$N; $i++){\n my $x = $A[$i-1];\n $l += abs($x-($B+$i));\n}\nprint $l;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "sample_input": "5\n2 2 3 5 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03311", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 217, "memory_kb": 40352}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s581181309", "group_id": "codeNet:p03315", "input_text": "print y/+//-y/-// for<>", "language": "Perl", "metadata": {"date": 1529808392, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03315.html", "problem_id": "p03315", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03315/input.txt", "sample_output_relpath": "derived/input_output/data/p03315/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03315/Perl/s581181309.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s581181309", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print y/+//-y/-// for<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is always an integer in Takahashi's mind.\n\nInitially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 1; when he eats -, the integer in his mind decreases by 1.\n\nThe symbols Takahashi is going to eat are given to you as a string S. The i-th character in S is the i-th symbol for him to eat.\n\nFind the integer in Takahashi's mind after he eats all the symbols.\n\nConstraints\n\nThe length of S is 4.\n\nEach character in S is + or -.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the integer in Takahashi's mind after he eats all the symbols.\n\nSample Input 1\n\n+-++\n\nSample Output 1\n\n2\n\nInitially, the integer in Takahashi's mind is 0.\n\nThe first integer for him to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe second integer to eat is -. After eating it, the integer in his mind becomes 0.\n\nThe third integer to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe fourth integer to eat is +. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\nSample Input 2\n\n-+--\n\nSample Output 2\n\n-2\n\nSample Input 3\n\n----\n\nSample Output 3\n\n-4", "sample_input": "+-++\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03315", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is always an integer in Takahashi's mind.\n\nInitially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 1; when he eats -, the integer in his mind decreases by 1.\n\nThe symbols Takahashi is going to eat are given to you as a string S. The i-th character in S is the i-th symbol for him to eat.\n\nFind the integer in Takahashi's mind after he eats all the symbols.\n\nConstraints\n\nThe length of S is 4.\n\nEach character in S is + or -.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the integer in Takahashi's mind after he eats all the symbols.\n\nSample Input 1\n\n+-++\n\nSample Output 1\n\n2\n\nInitially, the integer in Takahashi's mind is 0.\n\nThe first integer for him to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe second integer to eat is -. After eating it, the integer in his mind becomes 0.\n\nThe third integer to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe fourth integer to eat is +. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\nSample Input 2\n\n-+--\n\nSample Output 2\n\n-2\n\nSample Input 3\n\n----\n\nSample Output 3\n\n-4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 23, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s171904522", "group_id": "codeNet:p03316", "input_text": "print$_%map(1..$_,/./g)?No:Yes for<>", "language": "Perl", "metadata": {"date": 1580278940, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03316.html", "problem_id": "p03316", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03316/input.txt", "sample_output_relpath": "derived/input_output/data/p03316/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03316/Perl/s171904522.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s171904522", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print$_%map(1..$_,/./g)?No:Yes for<>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(101) = 1 + 0 + 1 = 2.\n\nGiven an integer N, determine if S(N) divides N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf S(N) divides N, print Yes; if it does not, print No.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nIn this input, N=12.\nAs S(12) = 1 + 2 = 3, S(N) divides N.\n\nSample Input 2\n\n101\n\nSample Output 2\n\nNo\n\nAs S(101) = 1 + 0 + 1 = 2, S(N) does not divide N.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\nYes", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03316", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(101) = 1 + 0 + 1 = 2.\n\nGiven an integer N, determine if S(N) divides N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf S(N) divides N, print Yes; if it does not, print No.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nIn this input, N=12.\nAs S(12) = 1 + 2 = 3, S(N) divides N.\n\nSample Input 2\n\n101\n\nSample Output 2\n\nNo\n\nAs S(101) = 1 + 0 + 1 = 2, S(N) does not divide N.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s390989245", "group_id": "codeNet:p03316", "input_text": "$_=<>;map$s+=$_,/./;print$_%$s?No:Yes", "language": "Perl", "metadata": {"date": 1532845148, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03316.html", "problem_id": "p03316", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03316/input.txt", "sample_output_relpath": "derived/input_output/data/p03316/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03316/Perl/s390989245.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s390989245", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$_=<>;map$s+=$_,/./;print$_%$s?No:Yes", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(101) = 1 + 0 + 1 = 2.\n\nGiven an integer N, determine if S(N) divides N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf S(N) divides N, print Yes; if it does not, print No.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nIn this input, N=12.\nAs S(12) = 1 + 2 = 3, S(N) divides N.\n\nSample Input 2\n\n101\n\nSample Output 2\n\nNo\n\nAs S(101) = 1 + 0 + 1 = 2, S(N) does not divide N.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\nYes", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03316", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(101) = 1 + 0 + 1 = 2.\n\nGiven an integer N, determine if S(N) divides N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf S(N) divides N, print Yes; if it does not, print No.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nIn this input, N=12.\nAs S(12) = 1 + 2 = 3, S(N) divides N.\n\nSample Input 2\n\n101\n\nSample Output 2\n\nNo\n\nAs S(101) = 1 + 0 + 1 = 2, S(N) does not divide N.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s784268358", "group_id": "codeNet:p03319", "input_text": "say ceiling [/] get.words>>->>1", "language": "Perl", "metadata": {"date": 1538191664, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03319.html", "problem_id": "p03319", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03319/input.txt", "sample_output_relpath": "derived/input_output/data/p03319/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03319/Perl/s784268358.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s784268358", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "say ceiling [/] get.words>>->>1", "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": "p03319", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 31, "cpu_time_ms": 139, "memory_kb": 49432}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s496236085", "group_id": "codeNet:p03320", "input_text": "say($!+=$_*=($!+$_).comb.sum>=$!/$_+1||10)xx++$_*get", "language": "Perl", "metadata": {"date": 1579418926, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03320.html", "problem_id": "p03320", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03320/input.txt", "sample_output_relpath": "derived/input_output/data/p03320/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03320/Perl/s496236085.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s496236085", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n19\n", "input_to_evaluate": "say($!+=$_*=($!+$_).comb.sum>=$!/$_+1||10)xx++$_*get", "problem_context": "Score : 500 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(123) = 1 + 2 + 3 = 6.\n\nWe will call an integer n a Snuke number when, for all positive integers m such that m > n, \\frac{n}{S(n)} \\leq \\frac{m}{S(m)} holds.\n\nGiven an integer K, list the K smallest Snuke numbers.\n\nConstraints\n\n1 \\leq K\n\nThe K-th smallest Snuke number is not greater than 10^{15}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th smallest Snuke number.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n1\n2\n3\n4\n5\n6\n7\n8\n9\n19", "sample_input": "10\n"}, "reference_outputs": ["1\n2\n3\n4\n5\n6\n7\n8\n9\n19\n"], "source_document_id": "p03320", "source_text": "Score : 500 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(123) = 1 + 2 + 3 = 6.\n\nWe will call an integer n a Snuke number when, for all positive integers m such that m > n, \\frac{n}{S(n)} \\leq \\frac{m}{S(m)} holds.\n\nGiven an integer K, list the K smallest Snuke numbers.\n\nConstraints\n\n1 \\leq K\n\nThe K-th smallest Snuke number is not greater than 10^{15}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th smallest Snuke number.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n1\n2\n3\n4\n5\n6\n7\n8\n9\n19", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 52, "cpu_time_ms": 968, "memory_kb": 73572}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s327864800", "group_id": "codeNet:p03323", "input_text": "package abc100A;\nuse Exporter;\n@ISA = (Exporter);\n@EXPORT = qw(solve);\n\n# 提出するときのコピーはここから\n\nuse strict;\nuse warnings;\n\nsub main {\n my ($N,$M) = split(/ /,);\n print solve($N,$M);\n}\n\nmain() unless caller;\n\nsub solve {\n my ($N,$M) = @_;\n return ($N<=8 && $M<=8) ? 'Yay!' : ':(';\n}\n\n# ここまで\n\n1;\n__END__\n", "language": "Perl", "metadata": {"date": 1567452376, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03323.html", "problem_id": "p03323", "resource_group": "low_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/Perl/s327864800.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s327864800", "user_id": "u555298461"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package abc100A;\nuse Exporter;\n@ISA = (Exporter);\n@EXPORT = qw(solve);\n\n# 提出するときのコピーはここから\n\nuse strict;\nuse warnings;\n\nsub main {\n my ($N,$M) = split(/ /,);\n print solve($N,$M);\n}\n\nmain() unless caller;\n\nsub solve {\n my ($N,$M) = @_;\n return ($N<=8 && $M<=8) ? 'Yay!' : ':(';\n}\n\n# ここまで\n\n1;\n__END__\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s016965477", "group_id": "codeNet:p03323", "input_text": "#!/usr/bin/perl\n\nmy ($a,$b) = map {$_ - 0} split(/\\s+/o,);\n\nif( $a <= 8 and $b <= 8 ){\n print \"Yay!\\n\";\n} else {\n print \":(\\n\";\n}\n\nexit(0);\n\n\n", "language": "Perl", "metadata": {"date": 1529199781, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03323.html", "problem_id": "p03323", "resource_group": "low_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/Perl/s016965477.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s016965477", "user_id": "u750383873"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($a,$b) = map {$_ - 0} split(/\\s+/o,);\n\nif( $a <= 8 and $b <= 8 ){\n print \"Yay!\\n\";\n} else {\n print \":(\\n\";\n}\n\nexit(0);\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s869449899", "group_id": "codeNet:p03325", "input_text": "get;say lsb [lcm] get.words", "language": "Perl", "metadata": {"date": 1538190563, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03325.html", "problem_id": "p03325", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03325/input.txt", "sample_output_relpath": "derived/input_output/data/p03325/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03325/Perl/s869449899.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s869449899", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "get;say lsb [lcm] get.words", "problem_context": "Score: 300 points\n\nProblem Statement\n\nAs AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.\n\nSnuke, an employee, would like to play with this sequence.\n\nSpecifically, he would like to repeat the following operation as many times as possible:\n\nFor every i satisfying 1 \\leq i \\leq N, perform one of the following: \"divide a_i by 2\" and \"multiply a_i by 3\".\nHere, choosing \"multiply a_i by 3\" for every i is not allowed, and the value of a_i after the operation must be an integer.\n\nAt most how many operations can be performed?\n\nConstraints\n\nN is an integer between 1 and 10 \\ 000 (inclusive).\n\na_i is an integer between 1 and 1 \\ 000 \\ 000 \\ 000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint the maximum number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n5 2 4\n\nSample Output 1\n\n3\n\nThe sequence is initially {5, 2, 4}. Three operations can be performed as follows:\n\nFirst, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {15, 6, 2}.\n\nNext, multiply a_1 by 3, divide a_2 by 2 and multiply a_3 by 3. The sequence is now {45, 3, 6}.\n\nFinally, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {135, 9, 3}.\n\nSample Input 2\n\n4\n631 577 243 199\n\nSample Output 2\n\n0\n\nNo operation can be performed since all the elements are odd. Thus, the answer is 0.\n\nSample Input 3\n\n10\n2184 2126 1721 1800 1024 2528 3360 1945 1280 1776\n\nSample Output 3\n\n39", "sample_input": "3\n5 2 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03325", "source_text": "Score: 300 points\n\nProblem Statement\n\nAs AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.\n\nSnuke, an employee, would like to play with this sequence.\n\nSpecifically, he would like to repeat the following operation as many times as possible:\n\nFor every i satisfying 1 \\leq i \\leq N, perform one of the following: \"divide a_i by 2\" and \"multiply a_i by 3\".\nHere, choosing \"multiply a_i by 3\" for every i is not allowed, and the value of a_i after the operation must be an integer.\n\nAt most how many operations can be performed?\n\nConstraints\n\nN is an integer between 1 and 10 \\ 000 (inclusive).\n\na_i is an integer between 1 and 1 \\ 000 \\ 000 \\ 000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint the maximum number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n5 2 4\n\nSample Output 1\n\n3\n\nThe sequence is initially {5, 2, 4}. Three operations can be performed as follows:\n\nFirst, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {15, 6, 2}.\n\nNext, multiply a_1 by 3, divide a_2 by 2 and multiply a_3 by 3. The sequence is now {45, 3, 6}.\n\nFinally, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {135, 9, 3}.\n\nSample Input 2\n\n4\n631 577 243 199\n\nSample Output 2\n\n0\n\nNo operation can be performed since all the elements are odd. Thus, the answer is 0.\n\nSample Input 3\n\n10\n2184 2126 1721 1800 1024 2528 3360 1945 1280 1776\n\nSample Output 3\n\n39", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 27, "cpu_time_ms": 2110, "memory_kb": 73456}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s319503599", "group_id": "codeNet:p03328", "input_text": "my ($A, $B) = split(/ /, );\nmy $NB = $B - $A;\nmy $NA = $NB - 1;\nmy $HA = $NA*($NA+1)/2;\nprint $HA - $A;", "language": "Perl", "metadata": {"date": 1528679388, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03328.html", "problem_id": "p03328", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03328/input.txt", "sample_output_relpath": "derived/input_output/data/p03328/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03328/Perl/s319503599.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s319503599", "user_id": "u807948625"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my ($A, $B) = split(/ /, );\nmy $NB = $B - $A;\nmy $NA = $NB - 1;\nmy $HA = $NA*($NA+1)/2;\nprint $HA - $A;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn some village, there are 999 towers that are 1,(1+2),(1+2+3),...,(1+2+3+...+999) meters high from west to east, at intervals of 1 meter.\n\nIt had been snowing for a while before it finally stopped. For some two adjacent towers located 1 meter apart, we measured the lengths of the parts of those towers that are not covered with snow, and the results are a meters for the west tower, and b meters for the east tower.\n\nAssuming that the depth of snow cover and the altitude are the same everywhere in the village, find the amount of the snow cover.\n\nAssume also that the depth of the snow cover is always at least 1 meter.\n\nConstraints\n\n1 \\leq a < b < 499500(=1+2+3+...+999)\n\nAll values in input are integers.\n\nThere is no input that contradicts the assumption.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the depth of the snow cover is x meters, print x as an integer.\n\nSample Input 1\n\n8 13\n\nSample Output 1\n\n2\n\nThe heights of the two towers are 10 meters and 15 meters, respectively.\nThus, we can see that the depth of the snow cover is 2 meters.\n\nSample Input 2\n\n54 65\n\nSample Output 2\n\n1", "sample_input": "8 13\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03328", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn some village, there are 999 towers that are 1,(1+2),(1+2+3),...,(1+2+3+...+999) meters high from west to east, at intervals of 1 meter.\n\nIt had been snowing for a while before it finally stopped. For some two adjacent towers located 1 meter apart, we measured the lengths of the parts of those towers that are not covered with snow, and the results are a meters for the west tower, and b meters for the east tower.\n\nAssuming that the depth of snow cover and the altitude are the same everywhere in the village, find the amount of the snow cover.\n\nAssume also that the depth of the snow cover is always at least 1 meter.\n\nConstraints\n\n1 \\leq a < b < 499500(=1+2+3+...+999)\n\nAll values in input are integers.\n\nThere is no input that contradicts the assumption.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the depth of the snow cover is x meters, print x as an integer.\n\nSample Input 1\n\n8 13\n\nSample Output 1\n\n2\n\nThe heights of the two towers are 10 meters and 15 meters, respectively.\nThus, we can see that the depth of the snow cover is 2 meters.\n\nSample Input 2\n\n54 65\n\nSample Output 2\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s865744286", "group_id": "codeNet:p03330", "input_text": "($N,$C)=glob<>;\n@D=map[glob<>],@@=0..$C-1;\nfor(<>){\n\t$j=0;\n\tfor$x(glob){\n\t\t$k=($i+$j)%3;\n\t\tfor(@@){\n\t\t\t$_[$k][$_]+=$D[$x-1][$_]\n\t\t}\n\t\t++$j\n\t}\n\t++$i\n}\n$\\=1e15;\nfor$i(@@){\n\tfor$j(@@){\n\t\tfor(@@){\n\t\t\t$\\-=$-=$i-$j&&$i-$_&&$j-$_&&$\\-$_[0][$i]-$_[1][$j]-$_[2][$_]\n\t\t}\n\t}\n}\nprint\n", "language": "Perl", "metadata": {"date": 1528702315, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03330.html", "problem_id": "p03330", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03330/input.txt", "sample_output_relpath": "derived/input_output/data/p03330/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03330/Perl/s865744286.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s865744286", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "($N,$C)=glob<>;\n@D=map[glob<>],@@=0..$C-1;\nfor(<>){\n\t$j=0;\n\tfor$x(glob){\n\t\t$k=($i+$j)%3;\n\t\tfor(@@){\n\t\t\t$_[$k][$_]+=$D[$x-1][$_]\n\t\t}\n\t\t++$j\n\t}\n\t++$i\n}\n$\\=1e15;\nfor$i(@@){\n\tfor$j(@@){\n\t\tfor(@@){\n\t\t\t$\\-=$-=$i-$j&&$i-$_&&$j-$_&&$\\-$_[0][$i]-$_[1][$j]-$_[2][$_]\n\t\t}\n\t}\n}\nprint\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left.\n\nThese squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painted in Color c_{i,j}.\n\nWe say the grid is a good grid when the following condition is met for all i,j,x,y satisfying 1 \\leq i,j,x,y \\leq N:\n\nIf (i+j) \\% 3=(x+y) \\% 3, the color of (i,j) and the color of (x,y) are the same.\n\nIf (i+j) \\% 3 \\neq (x+y) \\% 3, the color of (i,j) and the color of (x,y) are different.\n\nHere, X \\% Y represents X modulo Y.\n\nWe will repaint zero or more squares so that the grid will be a good grid.\n\nFor a square, the wrongness when the color of the square is X before repainting and Y after repainting, is D_{X,Y}.\n\nFind the minimum possible sum of the wrongness of all the squares.\n\nConstraints\n\n1 \\leq N \\leq 500\n\n3 \\leq C \\leq 30\n\n1 \\leq D_{i,j} \\leq 1000 (i \\neq j),D_{i,j}=0 (i=j)\n\n1 \\leq c_{i,j} \\leq C\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nD_{1,1} ... D_{1,C}\n:\nD_{C,1} ... D_{C,C}\nc_{1,1} ... c_{1,N}\n:\nc_{N,1} ... c_{N,N}\n\nOutput\n\nIf the minimum possible sum of the wrongness of all the squares is x, print x.\n\nSample Input 1\n\n2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n\nSample Output 1\n\n3\n\nRepaint (1,1) to Color 2. The wrongness of (1,1) becomes D_{1,2}=1.\n\nRepaint (1,2) to Color 3. The wrongness of (1,2) becomes D_{2,3}=1.\n\nRepaint (2,2) to Color 1. The wrongness of (2,2) becomes D_{3,1}=1.\n\nIn this case, the sum of the wrongness of all the squares is 3.\n\nNote that D_{i,j} \\neq D_{j,i} is possible.\n\nSample Input 2\n\n4 3\n0 12 71\n81 0 53\n14 92 0\n1 1 2 1\n2 1 1 2\n2 2 1 3\n1 1 2 2\n\nSample Output 2\n\n428", "sample_input": "2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03330", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left.\n\nThese squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painted in Color c_{i,j}.\n\nWe say the grid is a good grid when the following condition is met for all i,j,x,y satisfying 1 \\leq i,j,x,y \\leq N:\n\nIf (i+j) \\% 3=(x+y) \\% 3, the color of (i,j) and the color of (x,y) are the same.\n\nIf (i+j) \\% 3 \\neq (x+y) \\% 3, the color of (i,j) and the color of (x,y) are different.\n\nHere, X \\% Y represents X modulo Y.\n\nWe will repaint zero or more squares so that the grid will be a good grid.\n\nFor a square, the wrongness when the color of the square is X before repainting and Y after repainting, is D_{X,Y}.\n\nFind the minimum possible sum of the wrongness of all the squares.\n\nConstraints\n\n1 \\leq N \\leq 500\n\n3 \\leq C \\leq 30\n\n1 \\leq D_{i,j} \\leq 1000 (i \\neq j),D_{i,j}=0 (i=j)\n\n1 \\leq c_{i,j} \\leq C\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nD_{1,1} ... D_{1,C}\n:\nD_{C,1} ... D_{C,C}\nc_{1,1} ... c_{1,N}\n:\nc_{N,1} ... c_{N,N}\n\nOutput\n\nIf the minimum possible sum of the wrongness of all the squares is x, print x.\n\nSample Input 1\n\n2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n\nSample Output 1\n\n3\n\nRepaint (1,1) to Color 2. The wrongness of (1,1) becomes D_{1,2}=1.\n\nRepaint (1,2) to Color 3. The wrongness of (1,2) becomes D_{2,3}=1.\n\nRepaint (2,2) to Color 1. The wrongness of (2,2) becomes D_{3,1}=1.\n\nIn this case, the sum of the wrongness of all the squares is 3.\n\nNote that D_{i,j} \\neq D_{j,i} is possible.\n\nSample Input 2\n\n4 3\n0 12 71\n81 0 53\n14 92 0\n1 1 2 1\n2 1 1 2\n2 2 1 3\n1 1 2 2\n\nSample Output 2\n\n428", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1949, "memory_kb": 1664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s041347225", "group_id": "codeNet:p03330", "input_text": "($N,$C)=glob<>;\n@D=map[glob<>],@@=0..$C-1;\nfor(<>){\n\t$j=0;\n\tfor$x(split){\n\t\t$k=($i+$j)%3;\n\t\tfor(@@){\n\t\t\t$_[$k][$_]+=$D[$x-1][$_]\n\t\t}\n\t\t++$j\n\t}\n\t++$i\n}\n$\\=1e15;\nfor$i(@@){\n\tfor$j(@@){\n\t\tfor(@@){\n\t\t\t$\\-=$-=$i-$j&&$i-$_&&$j-$_&&$\\-$_[0][$i]-$_[1][$j]-$_[2][$_]\n\t\t}\n\t}\n}\nprint\n", "language": "Perl", "metadata": {"date": 1528702240, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03330.html", "problem_id": "p03330", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03330/input.txt", "sample_output_relpath": "derived/input_output/data/p03330/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03330/Perl/s041347225.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s041347225", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "($N,$C)=glob<>;\n@D=map[glob<>],@@=0..$C-1;\nfor(<>){\n\t$j=0;\n\tfor$x(split){\n\t\t$k=($i+$j)%3;\n\t\tfor(@@){\n\t\t\t$_[$k][$_]+=$D[$x-1][$_]\n\t\t}\n\t\t++$j\n\t}\n\t++$i\n}\n$\\=1e15;\nfor$i(@@){\n\tfor$j(@@){\n\t\tfor(@@){\n\t\t\t$\\-=$-=$i-$j&&$i-$_&&$j-$_&&$\\-$_[0][$i]-$_[1][$j]-$_[2][$_]\n\t\t}\n\t}\n}\nprint\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left.\n\nThese squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painted in Color c_{i,j}.\n\nWe say the grid is a good grid when the following condition is met for all i,j,x,y satisfying 1 \\leq i,j,x,y \\leq N:\n\nIf (i+j) \\% 3=(x+y) \\% 3, the color of (i,j) and the color of (x,y) are the same.\n\nIf (i+j) \\% 3 \\neq (x+y) \\% 3, the color of (i,j) and the color of (x,y) are different.\n\nHere, X \\% Y represents X modulo Y.\n\nWe will repaint zero or more squares so that the grid will be a good grid.\n\nFor a square, the wrongness when the color of the square is X before repainting and Y after repainting, is D_{X,Y}.\n\nFind the minimum possible sum of the wrongness of all the squares.\n\nConstraints\n\n1 \\leq N \\leq 500\n\n3 \\leq C \\leq 30\n\n1 \\leq D_{i,j} \\leq 1000 (i \\neq j),D_{i,j}=0 (i=j)\n\n1 \\leq c_{i,j} \\leq C\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nD_{1,1} ... D_{1,C}\n:\nD_{C,1} ... D_{C,C}\nc_{1,1} ... c_{1,N}\n:\nc_{N,1} ... c_{N,N}\n\nOutput\n\nIf the minimum possible sum of the wrongness of all the squares is x, print x.\n\nSample Input 1\n\n2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n\nSample Output 1\n\n3\n\nRepaint (1,1) to Color 2. The wrongness of (1,1) becomes D_{1,2}=1.\n\nRepaint (1,2) to Color 3. The wrongness of (1,2) becomes D_{2,3}=1.\n\nRepaint (2,2) to Color 1. The wrongness of (2,2) becomes D_{3,1}=1.\n\nIn this case, the sum of the wrongness of all the squares is 3.\n\nNote that D_{i,j} \\neq D_{j,i} is possible.\n\nSample Input 2\n\n4 3\n0 12 71\n81 0 53\n14 92 0\n1 1 2 1\n2 1 1 2\n2 2 1 3\n1 1 2 2\n\nSample Output 2\n\n428", "sample_input": "2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03330", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left.\n\nThese squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painted in Color c_{i,j}.\n\nWe say the grid is a good grid when the following condition is met for all i,j,x,y satisfying 1 \\leq i,j,x,y \\leq N:\n\nIf (i+j) \\% 3=(x+y) \\% 3, the color of (i,j) and the color of (x,y) are the same.\n\nIf (i+j) \\% 3 \\neq (x+y) \\% 3, the color of (i,j) and the color of (x,y) are different.\n\nHere, X \\% Y represents X modulo Y.\n\nWe will repaint zero or more squares so that the grid will be a good grid.\n\nFor a square, the wrongness when the color of the square is X before repainting and Y after repainting, is D_{X,Y}.\n\nFind the minimum possible sum of the wrongness of all the squares.\n\nConstraints\n\n1 \\leq N \\leq 500\n\n3 \\leq C \\leq 30\n\n1 \\leq D_{i,j} \\leq 1000 (i \\neq j),D_{i,j}=0 (i=j)\n\n1 \\leq c_{i,j} \\leq C\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nD_{1,1} ... D_{1,C}\n:\nD_{C,1} ... D_{C,C}\nc_{1,1} ... c_{1,N}\n:\nc_{N,1} ... c_{N,N}\n\nOutput\n\nIf the minimum possible sum of the wrongness of all the squares is x, print x.\n\nSample Input 1\n\n2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n\nSample Output 1\n\n3\n\nRepaint (1,1) to Color 2. The wrongness of (1,1) becomes D_{1,2}=1.\n\nRepaint (1,2) to Color 3. The wrongness of (1,2) becomes D_{2,3}=1.\n\nRepaint (2,2) to Color 1. The wrongness of (2,2) becomes D_{3,1}=1.\n\nIn this case, the sum of the wrongness of all the squares is 3.\n\nNote that D_{i,j} \\neq D_{j,i} is possible.\n\nSample Input 2\n\n4 3\n0 12 71\n81 0 53\n14 92 0\n1 1 2 1\n2 1 1 2\n2 2 1 3\n1 1 2 2\n\nSample Output 2\n\n428", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1624, "memory_kb": 1664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s028873045", "group_id": "codeNet:p03333", "input_text": "@in1=in();\n$n=$in1[0];\nfor($i=0;$i<$n;$i++){\n@in2=in();\n$ary[$i]=$i;\n$l[$i]=$in2[0];\n$r[$i]=$in2[1];\n}\n@sl=sort {$l[$b] <=> $l[$a]} @ary;\n@sr=sort {$r[$a] <=> $r[$b]} @ary;\n$now=0;\n$sum=0;\nwhile(1){\nwhile(defined $done{$l[$sl[$lidx]]}){\n$lidx++;\nif($lidx>=$n){last;}\n}\nif($lidx>=$n){last;}\n$done{$l[$sl[$lidx]]}=1;\nif($now<$l[$sl[$lidx]]){\n$sum+=$l[$sl[$lidx]]-$now;\n$now=$l[$sl[$lidx]];\n}else{last;}\nwhile(defined $done{$r[$sr[$ridx]]}){\n$ridx++;\nif($ridx>=$n){last;}\n}\nif($ridx>=$n){last;}\n$done{$r[$sr[$ridx]]}=1;\nif($now>$r[$sr[$ridx]]){\n$sum+=$now-$r[$sr[$ridx]];\n$now=$r[$sr[$ridx]];\n}else{last;}\n}\n$sum+=abs($now);\n\n$now=0;\n$ans=0;\nwhile(1){\nwhile(defined $done{$r[$sr[$ridx]]}){\n$ridx++;\nif($ridx>=$n){last;}\n}\nif($ridx>=$n){last;}\n$done{$r[$sr[$ridx]]}=1;\nif($now>$r[$sr[$ridx]]){\n$ans+=$now-$r[$sr[$ridx]];\n$now=$r[$sr[$ridx]];\n}else{last;}\nwhile(defined $done{$l[$sl[$lidx]]}){\n$lidx++;\nif($lidx>=$n){last;}\n}\nif($lidx>=$n){last;}\n$done{$l[$sl[$lidx]]}=1;\nif($now<$l[$sl[$lidx]]){\n$ans+=$l[$sl[$lidx]]-$now;\n$now=$l[$sl[$lidx]];\n}else{last;}\n\n}\n$ans+=abs($now);\nif($ans<$sum){$ans=$sum;}\n\nprint \"$ans\";\n\nsub in{\n$t=;\n$t=~s/[¥r¥n]+//;\nreturn split / /, $t;\n}\n", "language": "Perl", "metadata": {"date": 1576873894, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03333.html", "problem_id": "p03333", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03333/input.txt", "sample_output_relpath": "derived/input_output/data/p03333/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03333/Perl/s028873045.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s028873045", "user_id": "u004311543"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "@in1=in();\n$n=$in1[0];\nfor($i=0;$i<$n;$i++){\n@in2=in();\n$ary[$i]=$i;\n$l[$i]=$in2[0];\n$r[$i]=$in2[1];\n}\n@sl=sort {$l[$b] <=> $l[$a]} @ary;\n@sr=sort {$r[$a] <=> $r[$b]} @ary;\n$now=0;\n$sum=0;\nwhile(1){\nwhile(defined $done{$l[$sl[$lidx]]}){\n$lidx++;\nif($lidx>=$n){last;}\n}\nif($lidx>=$n){last;}\n$done{$l[$sl[$lidx]]}=1;\nif($now<$l[$sl[$lidx]]){\n$sum+=$l[$sl[$lidx]]-$now;\n$now=$l[$sl[$lidx]];\n}else{last;}\nwhile(defined $done{$r[$sr[$ridx]]}){\n$ridx++;\nif($ridx>=$n){last;}\n}\nif($ridx>=$n){last;}\n$done{$r[$sr[$ridx]]}=1;\nif($now>$r[$sr[$ridx]]){\n$sum+=$now-$r[$sr[$ridx]];\n$now=$r[$sr[$ridx]];\n}else{last;}\n}\n$sum+=abs($now);\n\n$now=0;\n$ans=0;\nwhile(1){\nwhile(defined $done{$r[$sr[$ridx]]}){\n$ridx++;\nif($ridx>=$n){last;}\n}\nif($ridx>=$n){last;}\n$done{$r[$sr[$ridx]]}=1;\nif($now>$r[$sr[$ridx]]){\n$ans+=$now-$r[$sr[$ridx]];\n$now=$r[$sr[$ridx]];\n}else{last;}\nwhile(defined $done{$l[$sl[$lidx]]}){\n$lidx++;\nif($lidx>=$n){last;}\n}\nif($lidx>=$n){last;}\n$done{$l[$sl[$lidx]]}=1;\nif($now<$l[$sl[$lidx]]){\n$ans+=$l[$sl[$lidx]]-$now;\n$now=$l[$sl[$lidx]];\n}else{last;}\n\n}\n$ans+=abs($now);\nif($ans<$sum){$ans=$sum;}\n\nprint \"$ans\";\n\nsub in{\n$t=;\n$t=~s/[¥r¥n]+//;\nreturn split / /, $t;\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nTakahashi and Aoki will play a game with a number line and some segments.\nTakahashi is standing on the number line and he is initially at coordinate 0.\nAoki has N segments. The i-th segment is [L_i,R_i], that is, a segment consisting of points with coordinates between L_i and R_i (inclusive).\n\nThe game has N steps. The i-th step proceeds as follows:\n\nFirst, Aoki chooses a segment that is still not chosen yet from the N segments and tells it to Takahashi.\n\nThen, Takahashi walks along the number line to some point within the segment chosen by Aoki this time.\n\nAfter N steps are performed, Takahashi will return to coordinate 0 and the game ends.\n\nLet K be the total distance traveled by Takahashi throughout the game. Aoki will choose segments so that K will be as large as possible, and Takahashi walks along the line so that K will be as small as possible. What will be the value of K in the end?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n-10^5 ≤ L_i < R_i ≤ 10^5\n\nL_i and R_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 R_1\n:\nL_N R_N\n\nOutput\n\nPrint the total distance traveled by Takahashi throughout the game when Takahashi and Aoki acts as above.\nIt is guaranteed that K is always an integer when L_i,R_i are integers.\n\nSample Input 1\n\n3\n-5 1\n3 7\n-4 -2\n\nSample Output 1\n\n10\n\nOne possible sequence of actions of Takahashi and Aoki is as follows:\n\nAoki chooses the first segment. Takahashi moves from coordinate 0 to -4, covering a distance of 4.\n\nAoki chooses the third segment. Takahashi stays at coordinate -4.\n\nAoki chooses the second segment. Takahashi moves from coordinate -4 to 3, covering a distance of 7.\n\nTakahashi moves from coordinate 3 to 0, covering a distance of 3.\n\nThe distance covered by Takahashi here is 14 (because Takahashi didn't move optimally).\nIt turns out that if both players move optimally, the distance covered by Takahashi will be 10.\n\nSample Input 2\n\n3\n1 2\n3 4\n5 6\n\nSample Output 2\n\n12\n\nSample Input 3\n\n5\n-2 0\n-2 0\n7 8\n9 10\n-2 -1\n\nSample Output 3\n\n34", "sample_input": "3\n-5 1\n3 7\n-4 -2\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03333", "source_text": "Score : 700 points\n\nProblem Statement\n\nTakahashi and Aoki will play a game with a number line and some segments.\nTakahashi is standing on the number line and he is initially at coordinate 0.\nAoki has N segments. The i-th segment is [L_i,R_i], that is, a segment consisting of points with coordinates between L_i and R_i (inclusive).\n\nThe game has N steps. The i-th step proceeds as follows:\n\nFirst, Aoki chooses a segment that is still not chosen yet from the N segments and tells it to Takahashi.\n\nThen, Takahashi walks along the number line to some point within the segment chosen by Aoki this time.\n\nAfter N steps are performed, Takahashi will return to coordinate 0 and the game ends.\n\nLet K be the total distance traveled by Takahashi throughout the game. Aoki will choose segments so that K will be as large as possible, and Takahashi walks along the line so that K will be as small as possible. What will be the value of K in the end?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n-10^5 ≤ L_i < R_i ≤ 10^5\n\nL_i and R_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 R_1\n:\nL_N R_N\n\nOutput\n\nPrint the total distance traveled by Takahashi throughout the game when Takahashi and Aoki acts as above.\nIt is guaranteed that K is always an integer when L_i,R_i are integers.\n\nSample Input 1\n\n3\n-5 1\n3 7\n-4 -2\n\nSample Output 1\n\n10\n\nOne possible sequence of actions of Takahashi and Aoki is as follows:\n\nAoki chooses the first segment. Takahashi moves from coordinate 0 to -4, covering a distance of 4.\n\nAoki chooses the third segment. Takahashi stays at coordinate -4.\n\nAoki chooses the second segment. Takahashi moves from coordinate -4 to 3, covering a distance of 7.\n\nTakahashi moves from coordinate 3 to 0, covering a distance of 3.\n\nThe distance covered by Takahashi here is 14 (because Takahashi didn't move optimally).\nIt turns out that if both players move optimally, the distance covered by Takahashi will be 10.\n\nSample Input 2\n\n3\n1 2\n3 4\n5 6\n\nSample Output 2\n\n12\n\nSample Input 3\n\n5\n-2 0\n-2 0\n7 8\n9 10\n-2 -1\n\nSample Output 3\n\n34", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1178, "cpu_time_ms": 789, "memory_kb": 40944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s764164254", "group_id": "codeNet:p03333", "input_text": "<>;@@=<>;//,@$_=sort{$b-$a}0,map 2*(glob)[$'],@@for 0,1;$\\+=$-=$_-pop@1for@0;print", "language": "Perl", "metadata": {"date": 1550303906, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03333.html", "problem_id": "p03333", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03333/input.txt", "sample_output_relpath": "derived/input_output/data/p03333/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03333/Perl/s764164254.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s764164254", "user_id": "u283869437"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "<>;@@=<>;//,@$_=sort{$b-$a}0,map 2*(glob)[$'],@@for 0,1;$\\+=$-=$_-pop@1for@0;print", "problem_context": "Score : 700 points\n\nProblem Statement\n\nTakahashi and Aoki will play a game with a number line and some segments.\nTakahashi is standing on the number line and he is initially at coordinate 0.\nAoki has N segments. The i-th segment is [L_i,R_i], that is, a segment consisting of points with coordinates between L_i and R_i (inclusive).\n\nThe game has N steps. The i-th step proceeds as follows:\n\nFirst, Aoki chooses a segment that is still not chosen yet from the N segments and tells it to Takahashi.\n\nThen, Takahashi walks along the number line to some point within the segment chosen by Aoki this time.\n\nAfter N steps are performed, Takahashi will return to coordinate 0 and the game ends.\n\nLet K be the total distance traveled by Takahashi throughout the game. Aoki will choose segments so that K will be as large as possible, and Takahashi walks along the line so that K will be as small as possible. What will be the value of K in the end?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n-10^5 ≤ L_i < R_i ≤ 10^5\n\nL_i and R_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 R_1\n:\nL_N R_N\n\nOutput\n\nPrint the total distance traveled by Takahashi throughout the game when Takahashi and Aoki acts as above.\nIt is guaranteed that K is always an integer when L_i,R_i are integers.\n\nSample Input 1\n\n3\n-5 1\n3 7\n-4 -2\n\nSample Output 1\n\n10\n\nOne possible sequence of actions of Takahashi and Aoki is as follows:\n\nAoki chooses the first segment. Takahashi moves from coordinate 0 to -4, covering a distance of 4.\n\nAoki chooses the third segment. Takahashi stays at coordinate -4.\n\nAoki chooses the second segment. Takahashi moves from coordinate -4 to 3, covering a distance of 7.\n\nTakahashi moves from coordinate 3 to 0, covering a distance of 3.\n\nThe distance covered by Takahashi here is 14 (because Takahashi didn't move optimally).\nIt turns out that if both players move optimally, the distance covered by Takahashi will be 10.\n\nSample Input 2\n\n3\n1 2\n3 4\n5 6\n\nSample Output 2\n\n12\n\nSample Input 3\n\n5\n-2 0\n-2 0\n7 8\n9 10\n-2 -1\n\nSample Output 3\n\n34", "sample_input": "3\n-5 1\n3 7\n-4 -2\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03333", "source_text": "Score : 700 points\n\nProblem Statement\n\nTakahashi and Aoki will play a game with a number line and some segments.\nTakahashi is standing on the number line and he is initially at coordinate 0.\nAoki has N segments. The i-th segment is [L_i,R_i], that is, a segment consisting of points with coordinates between L_i and R_i (inclusive).\n\nThe game has N steps. The i-th step proceeds as follows:\n\nFirst, Aoki chooses a segment that is still not chosen yet from the N segments and tells it to Takahashi.\n\nThen, Takahashi walks along the number line to some point within the segment chosen by Aoki this time.\n\nAfter N steps are performed, Takahashi will return to coordinate 0 and the game ends.\n\nLet K be the total distance traveled by Takahashi throughout the game. Aoki will choose segments so that K will be as large as possible, and Takahashi walks along the line so that K will be as small as possible. What will be the value of K in the end?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n-10^5 ≤ L_i < R_i ≤ 10^5\n\nL_i and R_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 R_1\n:\nL_N R_N\n\nOutput\n\nPrint the total distance traveled by Takahashi throughout the game when Takahashi and Aoki acts as above.\nIt is guaranteed that K is always an integer when L_i,R_i are integers.\n\nSample Input 1\n\n3\n-5 1\n3 7\n-4 -2\n\nSample Output 1\n\n10\n\nOne possible sequence of actions of Takahashi and Aoki is as follows:\n\nAoki chooses the first segment. Takahashi moves from coordinate 0 to -4, covering a distance of 4.\n\nAoki chooses the third segment. Takahashi stays at coordinate -4.\n\nAoki chooses the second segment. Takahashi moves from coordinate -4 to 3, covering a distance of 7.\n\nTakahashi moves from coordinate 3 to 0, covering a distance of 3.\n\nThe distance covered by Takahashi here is 14 (because Takahashi didn't move optimally).\nIt turns out that if both players move optimally, the distance covered by Takahashi will be 10.\n\nSample Input 2\n\n3\n1 2\n3 4\n5 6\n\nSample Output 2\n\n12\n\nSample Input 3\n\n5\n-2 0\n-2 0\n7 8\n9 10\n-2 -1\n\nSample Output 3\n\n34", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1323, "memory_kb": 26608}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s108564848", "group_id": "codeNet:p03337", "input_text": "my ($c, $d) = split(/\\s/, );\nmy @x = ($c+$d, $c-$d, $c*$d);\nmy @y = sort{ $a <=> $b } (@x);\nprint $y[2], \"\\n\";\n", "language": "Perl", "metadata": {"date": 1527387839, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03337.html", "problem_id": "p03337", "resource_group": "low_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/Perl/s108564848.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s108564848", "user_id": "u996239623"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "my ($c, $d) = split(/\\s/, );\nmy @x = ($c+$d, $c-$d, $c*$d);\nmy @y = sort{ $a <=> $b } (@x);\nprint $y[2], \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s371202708", "group_id": "codeNet:p03338", "input_text": "get;say max +(.[^$++]∩.[$++..*])xx($_=get.comb)", "language": "Perl", "metadata": {"date": 1595592403, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03338.html", "problem_id": "p03338", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03338/input.txt", "sample_output_relpath": "derived/input_output/data/p03338/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03338/Perl/s371202708.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s371202708", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get;say max +(.[^$++]∩.[$++..*])xx($_=get.comb)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\nWe will cut this string at one position into two strings X and Y.\nHere, we would like to maximize the number of different letters contained in both X and Y.\nFind the largest possible number of different letters contained in both X and Y when we cut the string at the optimal position.\n\nConstraints\n\n2 \\leq N \\leq 100\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 largest possible number of different letters contained in both X and Y.\n\nSample Input 1\n\n6\naabbca\n\nSample Output 1\n\n2\n\nIf we cut the string between the third and fourth letters into X = aab and Y = bca, the letters contained in both X and Y are a and b.\nThere will never be three or more different letters contained in both X and Y, so the answer is 2.\n\nSample Input 2\n\n10\naaaaaaaaaa\n\nSample Output 2\n\n1\n\nHowever we divide S, only a will be contained in both X and Y.\n\nSample Input 3\n\n45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\n\nSample Output 3\n\n9", "sample_input": "6\naabbca\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03338", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\nWe will cut this string at one position into two strings X and Y.\nHere, we would like to maximize the number of different letters contained in both X and Y.\nFind the largest possible number of different letters contained in both X and Y when we cut the string at the optimal position.\n\nConstraints\n\n2 \\leq N \\leq 100\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 largest possible number of different letters contained in both X and Y.\n\nSample Input 1\n\n6\naabbca\n\nSample Output 1\n\n2\n\nIf we cut the string between the third and fourth letters into X = aab and Y = bca, the letters contained in both X and Y are a and b.\nThere will never be three or more different letters contained in both X and Y, so the answer is 2.\n\nSample Input 2\n\n10\naaaaaaaaaa\n\nSample Output 2\n\n1\n\nHowever we divide S, only a will be contained in both X and Y.\n\nSample Input 3\n\n45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\n\nSample Output 3\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 49, "cpu_time_ms": 337, "memory_kb": 96416}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s081715027", "group_id": "codeNet:p03338", "input_text": "$line = ;\nchomp $line;\n$N=scalar($line);\n$line = ;\nchomp $line;\n$S=$line;\n\n$mm=-1;$mi=-1;$m=0;\n\nfor($i=0;$i<$N;$i++){\n\t$k=substr($S,$i,1);\n\t$ri=rindex($S,$k,$i-1);\n\t$li=index($S,$k,$i+1);\n\tif ($li>=0) {\n\t\tif($ri>=0) {\n\t\t\t#no change\n\t\t} else {\n\t\t\t$m+=1;\n\t\t\tif($mm<$m) {\n\t\t\t\t$mm=$m;\n\t\t\t\t$mi=$i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif($ri>=0) {\n\t\t\t$m-=1;\n\t\t} else {\n\t\t\t#no change\n\t\t}\n\t}\n}\n\nprint \"$mm\\n\";\n", "language": "Perl", "metadata": {"date": 1527384831, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03338.html", "problem_id": "p03338", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03338/input.txt", "sample_output_relpath": "derived/input_output/data/p03338/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03338/Perl/s081715027.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s081715027", "user_id": "u420702888"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$line = ;\nchomp $line;\n$N=scalar($line);\n$line = ;\nchomp $line;\n$S=$line;\n\n$mm=-1;$mi=-1;$m=0;\n\nfor($i=0;$i<$N;$i++){\n\t$k=substr($S,$i,1);\n\t$ri=rindex($S,$k,$i-1);\n\t$li=index($S,$k,$i+1);\n\tif ($li>=0) {\n\t\tif($ri>=0) {\n\t\t\t#no change\n\t\t} else {\n\t\t\t$m+=1;\n\t\t\tif($mm<$m) {\n\t\t\t\t$mm=$m;\n\t\t\t\t$mi=$i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif($ri>=0) {\n\t\t\t$m-=1;\n\t\t} else {\n\t\t\t#no change\n\t\t}\n\t}\n}\n\nprint \"$mm\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\nWe will cut this string at one position into two strings X and Y.\nHere, we would like to maximize the number of different letters contained in both X and Y.\nFind the largest possible number of different letters contained in both X and Y when we cut the string at the optimal position.\n\nConstraints\n\n2 \\leq N \\leq 100\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 largest possible number of different letters contained in both X and Y.\n\nSample Input 1\n\n6\naabbca\n\nSample Output 1\n\n2\n\nIf we cut the string between the third and fourth letters into X = aab and Y = bca, the letters contained in both X and Y are a and b.\nThere will never be three or more different letters contained in both X and Y, so the answer is 2.\n\nSample Input 2\n\n10\naaaaaaaaaa\n\nSample Output 2\n\n1\n\nHowever we divide S, only a will be contained in both X and Y.\n\nSample Input 3\n\n45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\n\nSample Output 3\n\n9", "sample_input": "6\naabbca\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03338", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\nWe will cut this string at one position into two strings X and Y.\nHere, we would like to maximize the number of different letters contained in both X and Y.\nFind the largest possible number of different letters contained in both X and Y when we cut the string at the optimal position.\n\nConstraints\n\n2 \\leq N \\leq 100\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 largest possible number of different letters contained in both X and Y.\n\nSample Input 1\n\n6\naabbca\n\nSample Output 1\n\n2\n\nIf we cut the string between the third and fourth letters into X = aab and Y = bca, the letters contained in both X and Y are a and b.\nThere will never be three or more different letters contained in both X and Y, so the answer is 2.\n\nSample Input 2\n\n10\naaaaaaaaaa\n\nSample Output 2\n\n1\n\nHowever we divide S, only a will be contained in both X and Y.\n\nSample Input 3\n\n45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\n\nSample Output 3\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s625181369", "group_id": "codeNet:p03339", "input_text": "#!/usr/bin/perl\n\nmy ($n) = map {$_ - 0} split(/\\s+/o,);\n( my $s = ) =~ s/[\\x00-\\x20]+$//io;\n\nmy @w_ct = ();\n$#w_ct = ($n - 1);\nmy @e_ct = ();\n$#e_ct = ($n - 1);\nmy $w = 0;\nmy $e = 0;\nfor(my $i=0;$i<$n;$i++){\n $w += ( substr($s,$i,1) eq 'W' ? 1 : 0 );\n $w_ct[$i] = $w;\n $e += ( substr($s,$n-1-$i,1) eq 'E' ? 1 : 0 );\n $e_ct[$n-1-$i] += $e;\n}\n\nmy $mn = $n-1;\nfor(my $i=0;$i<$n;$i++){\n my $ct = 0;\n $ct += $w_ct[$i-1] if $i>0;\n $ct += $e_ct[$i+1] if $i<$n-1;\n $mn = $ct if $ct < $mn;\n}\nprint \"$mn\\n\";\n\n\n", "language": "Perl", "metadata": {"date": 1528000953, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03339.html", "problem_id": "p03339", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03339/input.txt", "sample_output_relpath": "derived/input_output/data/p03339/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03339/Perl/s625181369.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s625181369", "user_id": "u750383873"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n) = map {$_ - 0} split(/\\s+/o,);\n( my $s = ) =~ s/[\\x00-\\x20]+$//io;\n\nmy @w_ct = ();\n$#w_ct = ($n - 1);\nmy @e_ct = ();\n$#e_ct = ($n - 1);\nmy $w = 0;\nmy $e = 0;\nfor(my $i=0;$i<$n;$i++){\n $w += ( substr($s,$i,1) eq 'W' ? 1 : 0 );\n $w_ct[$i] = $w;\n $e += ( substr($s,$n-1-$i,1) eq 'E' ? 1 : 0 );\n $e_ct[$n-1-$i] += $e;\n}\n\nmy $mn = $n-1;\nfor(my $i=0;$i<$n;$i++){\n my $ct = 0;\n $ct += $w_ct[$i-1] if $i>0;\n $ct += $e_ct[$i+1] if $i<$n-1;\n $mn = $ct if $ct < $mn;\n}\nprint \"$mn\\n\";\n\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people standing in a row from west to east.\nEach person is facing east or west.\nThe directions of the people is given as a string S of length N.\nThe i-th person from the west is facing east if S_i = E, and west if S_i = W.\n\nYou will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader.\nHere, we do not care which direction the leader is facing.\n\nThe people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized.\nFind the minimum number of people who have to change their directions.\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n|S| = N\n\nS_i is E or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of people who have to change their directions.\n\nSample Input 1\n\n5\nWEEWW\n\nSample Output 1\n\n1\n\nAssume that we appoint the third person from the west as the leader.\nThen, the first person from the west needs to face east and has to turn around.\nThe other people do not need to change their directions, so the number of people who have to change their directions is 1 in this case.\nIt is not possible to have 0 people who have to change their directions, so the answer is 1.\n\nSample Input 2\n\n12\nWEWEWEEEWWWE\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\nWWWWWEEE\n\nSample Output 3\n\n3", "sample_input": "5\nWEEWW\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03339", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people standing in a row from west to east.\nEach person is facing east or west.\nThe directions of the people is given as a string S of length N.\nThe i-th person from the west is facing east if S_i = E, and west if S_i = W.\n\nYou will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader.\nHere, we do not care which direction the leader is facing.\n\nThe people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized.\nFind the minimum number of people who have to change their directions.\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n|S| = N\n\nS_i is E or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of people who have to change their directions.\n\nSample Input 1\n\n5\nWEEWW\n\nSample Output 1\n\n1\n\nAssume that we appoint the third person from the west as the leader.\nThen, the first person from the west needs to face east and has to turn around.\nThe other people do not need to change their directions, so the number of people who have to change their directions is 1 in this case.\nIt is not possible to have 0 people who have to change their directions, so the answer is 1.\n\nSample Input 2\n\n12\nWEWEWEEEWWWE\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\nWWWWWEEE\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 523, "cpu_time_ms": 386, "memory_kb": 19660}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s056209526", "group_id": "codeNet:p03341", "input_text": "$\\=$n=<>;map{$l=y/W//;$\\-=$-=- --$n+$\\-$t+$l-($t+=/W/)for/./g}<>;print", "language": "Perl", "metadata": {"date": 1527394984, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03341.html", "problem_id": "p03341", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03341/input.txt", "sample_output_relpath": "derived/input_output/data/p03341/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03341/Perl/s056209526.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s056209526", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$\\=$n=<>;map{$l=y/W//;$\\-=$-=- --$n+$\\-$t+$l-($t+=/W/)for/./g}<>;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people standing in a row from west to east.\nEach person is facing east or west.\nThe directions of the people is given as a string S of length N.\nThe i-th person from the west is facing east if S_i = E, and west if S_i = W.\n\nYou will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader.\nHere, we do not care which direction the leader is facing.\n\nThe people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized.\nFind the minimum number of people who have to change their directions.\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n|S| = N\n\nS_i is E or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of people who have to change their directions.\n\nSample Input 1\n\n5\nWEEWW\n\nSample Output 1\n\n1\n\nAssume that we appoint the third person from the west as the leader.\nThen, the first person from the west needs to face east and has to turn around.\nThe other people do not need to change their directions, so the number of people who have to change their directions is 1 in this case.\nIt is not possible to have 0 people who have to change their directions, so the answer is 1.\n\nSample Input 2\n\n12\nWEWEWEEEWWWE\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\nWWWWWEEE\n\nSample Output 3\n\n3", "sample_input": "5\nWEEWW\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03341", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people standing in a row from west to east.\nEach person is facing east or west.\nThe directions of the people is given as a string S of length N.\nThe i-th person from the west is facing east if S_i = E, and west if S_i = W.\n\nYou will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader.\nHere, we do not care which direction the leader is facing.\n\nThe people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized.\nFind the minimum number of people who have to change their directions.\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n|S| = N\n\nS_i is E or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of people who have to change their directions.\n\nSample Input 1\n\n5\nWEEWW\n\nSample Output 1\n\n1\n\nAssume that we appoint the third person from the west as the leader.\nThen, the first person from the west needs to face east and has to turn around.\nThe other people do not need to change their directions, so the number of people who have to change their directions is 1 in this case.\nIt is not possible to have 0 people who have to change their directions, so the answer is 1.\n\nSample Input 2\n\n12\nWEWEWEEEWWWE\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\nWWWWWEEE\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 314, "memory_kb": 28708}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s787902466", "group_id": "codeNet:p03343", "input_text": "$line = ;\nchomp $line;\n($N,$K,$Q) = split(/ /, $line);\n$line = ;\nchomp $line;\n@A = split(/ /, $line);\n\n$minXmY=-1;\n\n@A0 = sort {$a <=> $b} @A;\n\nfor($i=0;$i<=$N-$Q;$i++){\n\t$Y=$A0[$i];\n\t\n\t@A3=();\n\t@A2=();\n\tfor($j=0;$j<$N;$j++){\n\t\tif($A[$j]>=$Y) {\n\t\t\t#push @A2, $A[$j];\n\t\t\tfor($k=0; $k<=$Q+$K-1 && $k<=$#A2 && $A[$j]>$A2[$k];$k++){}\n\t\t\tsplice @A2, $k, 0, $A[$j] if ($k<=$Q+$K-1);\n\t\t} else {\n\t\t\t$c=($#A2+1)-$K+1;\n\t\t\tif($c>0) {\n\t\t\t\t#@A2 = sort {$a <=> $b} @A2;\n\t\t\t\t#push @A3,@A2[0..$c-1];\n\t\t\t\t$l=0;\n\t\t\t\tfor($k=0; $k<$c;$k++){\n\t\t\t\t\tfor(; $l<=$Q && $l<=$#A3 && $A2[$k]>$A3[$l];$l++){}\n\t\t\t\t\tsplice @A3, $l, 0, $A2[$k] if ($l<=$Q);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@A2=();\n\t\t}\n\t}\n\t$c=($#A2+1)-$K+1;\n\tif($c>0) {\n\t\t#@A2 = sort {$a <=> $b} @A2;\n\t\t#push @A3,@A2[0..$c-1];\n\t\t$l=0;\n\t\tfor($k=0; $k<$c;$k++){\n\t\t\tfor(; $l<=$Q && $l<=$#A3 && $A2[$k]>$A3[$l];$l++){}\n\t\t\tsplice @A3, $l, 0, $A2[$k] if ($l<=$Q);\n\t\t}\n\t}\n\t#@A3 = sort {$a <=> $b} @A3;\n\t\n\tif($#A3+1>=$Q) {\n\t\t$XmY=$A3[$Q-1]-$Y;\n\t\t$minXmY = $XmY if($minXmY > $XmY || $minXmY<0);\n\t}\n}\n\nprint \"$minXmY\\n\";\n", "language": "Perl", "metadata": {"date": 1527402954, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03343.html", "problem_id": "p03343", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03343/input.txt", "sample_output_relpath": "derived/input_output/data/p03343/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03343/Perl/s787902466.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s787902466", "user_id": "u420702888"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$line = ;\nchomp $line;\n($N,$K,$Q) = split(/ /, $line);\n$line = ;\nchomp $line;\n@A = split(/ /, $line);\n\n$minXmY=-1;\n\n@A0 = sort {$a <=> $b} @A;\n\nfor($i=0;$i<=$N-$Q;$i++){\n\t$Y=$A0[$i];\n\t\n\t@A3=();\n\t@A2=();\n\tfor($j=0;$j<$N;$j++){\n\t\tif($A[$j]>=$Y) {\n\t\t\t#push @A2, $A[$j];\n\t\t\tfor($k=0; $k<=$Q+$K-1 && $k<=$#A2 && $A[$j]>$A2[$k];$k++){}\n\t\t\tsplice @A2, $k, 0, $A[$j] if ($k<=$Q+$K-1);\n\t\t} else {\n\t\t\t$c=($#A2+1)-$K+1;\n\t\t\tif($c>0) {\n\t\t\t\t#@A2 = sort {$a <=> $b} @A2;\n\t\t\t\t#push @A3,@A2[0..$c-1];\n\t\t\t\t$l=0;\n\t\t\t\tfor($k=0; $k<$c;$k++){\n\t\t\t\t\tfor(; $l<=$Q && $l<=$#A3 && $A2[$k]>$A3[$l];$l++){}\n\t\t\t\t\tsplice @A3, $l, 0, $A2[$k] if ($l<=$Q);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@A2=();\n\t\t}\n\t}\n\t$c=($#A2+1)-$K+1;\n\tif($c>0) {\n\t\t#@A2 = sort {$a <=> $b} @A2;\n\t\t#push @A3,@A2[0..$c-1];\n\t\t$l=0;\n\t\tfor($k=0; $k<$c;$k++){\n\t\t\tfor(; $l<=$Q && $l<=$#A3 && $A2[$k]>$A3[$l];$l++){}\n\t\t\tsplice @A3, $l, 0, $A2[$k] if ($l<=$Q);\n\t\t}\n\t}\n\t#@A3 = sort {$a <=> $b} @A3;\n\t\n\tif($#A3+1>=$Q) {\n\t\t$XmY=$A3[$Q-1]-$Y;\n\t\t$minXmY = $XmY if($minXmY > $XmY || $minXmY<0);\n\t}\n}\n\nprint \"$minXmY\\n\";\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N and an integer K.\nYou will perform the following operation on this sequence Q times:\n\nChoose a contiguous subsequence of length K, then remove the smallest element among the K elements contained in the chosen subsequence (if there are multiple such elements, choose one of them as you like).\n\nLet X and Y be the values of the largest and smallest element removed in the Q operations. You would like X-Y to be as small as possible.\nFind the smallest possible value of X-Y when the Q operations are performed optimally.\n\nConstraints\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq N\n\n1 \\leq Q \\leq N-K+1\n\n1 \\leq A_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 Q\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the smallest possible value of X-Y.\n\nSample Input 1\n\n5 3 2\n4 3 1 5 2\n\nSample Output 1\n\n1\n\nIn the first operation, whichever contiguous subsequence of length 3 we choose, the minimum element in it is 1.\nThus, the first operation removes A_3=1 and now we have A=(4,3,5,2).\nIn the second operation, it is optimal to choose (A_2,A_3,A_4)=(3,5,2) as the contiguous subsequence of length 3 and remove A_4=2.\nIn this case, the largest element removed is 2, and the smallest is 1, so their difference is 2-1=1.\n\nSample Input 2\n\n10 1 6\n1 1 2 3 5 8 13 21 34 55\n\nSample Output 2\n\n7\n\nSample Input 3\n\n11 7 5\n24979445 861648772 623690081 433933447 476190629 262703497 211047202 971407775 628894325 731963982 822804784\n\nSample Output 3\n\n451211184", "sample_input": "5 3 2\n4 3 1 5 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03343", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N and an integer K.\nYou will perform the following operation on this sequence Q times:\n\nChoose a contiguous subsequence of length K, then remove the smallest element among the K elements contained in the chosen subsequence (if there are multiple such elements, choose one of them as you like).\n\nLet X and Y be the values of the largest and smallest element removed in the Q operations. You would like X-Y to be as small as possible.\nFind the smallest possible value of X-Y when the Q operations are performed optimally.\n\nConstraints\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq N\n\n1 \\leq Q \\leq N-K+1\n\n1 \\leq A_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 Q\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the smallest possible value of X-Y.\n\nSample Input 1\n\n5 3 2\n4 3 1 5 2\n\nSample Output 1\n\n1\n\nIn the first operation, whichever contiguous subsequence of length 3 we choose, the minimum element in it is 1.\nThus, the first operation removes A_3=1 and now we have A=(4,3,5,2).\nIn the second operation, it is optimal to choose (A_2,A_3,A_4)=(3,5,2) as the contiguous subsequence of length 3 and remove A_4=2.\nIn this case, the largest element removed is 2, and the smallest is 1, so their difference is 2-1=1.\n\nSample Input 2\n\n10 1 6\n1 1 2 3 5 8 13 21 34 55\n\nSample Output 2\n\n7\n\nSample Input 3\n\n11 7 5\n24979445 861648772 623690081 433933447 476190629 262703497 211047202 971407775 628894325 731963982 822804784\n\nSample Output 3\n\n451211184", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1038, "cpu_time_ms": 2103, "memory_kb": 1280}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s983038819", "group_id": "codeNet:p03345", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($a, $b, $c, $k) = split / /, );\nif ($a==$b && $a==$c) {\n say 0;\n exit;\n}\nif ($k % 2 == 0) {\n say -1;\n} else {\n say 1;\n}", "language": "Perl", "metadata": {"date": 1586021501, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03345.html", "problem_id": "p03345", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03345/input.txt", "sample_output_relpath": "derived/input_output/data/p03345/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03345/Perl/s983038819.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s983038819", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($a, $b, $c, $k) = split / /, );\nif ($a==$b && $a==$c) {\n say 0;\n exit;\n}\nif ($k % 2 == 0) {\n say -1;\n} else {\n say 1;\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively.\nAfter repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:\n\nEach of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.\n\nHowever, if the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nConstraints\n\n1 \\leq A,B,C \\leq 10^9\n\n0 \\leq K \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the integer Takahashi will get minus the integer Nakahashi will get, after repeating the following operation K times.\nIf the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nSample Input 1\n\n1 2 3 1\n\nSample Output 1\n\n1\n\nAfter one operation, Takahashi, Nakahashi and Hikuhashi have 5, 4 and 3, respectively. We should print 5-4=1.\n\nSample Input 2\n\n2 3 2 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n1000000000 1000000000 1000000000 1000000000000000000\n\nSample Output 3\n\n0", "sample_input": "1 2 3 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03345", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively.\nAfter repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:\n\nEach of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.\n\nHowever, if the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nConstraints\n\n1 \\leq A,B,C \\leq 10^9\n\n0 \\leq K \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the integer Takahashi will get minus the integer Nakahashi will get, after repeating the following operation K times.\nIf the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nSample Input 1\n\n1 2 3 1\n\nSample Output 1\n\n1\n\nAfter one operation, Takahashi, Nakahashi and Hikuhashi have 5, 4 and 3, respectively. We should print 5-4=1.\n\nSample Input 2\n\n2 3 2 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n1000000000 1000000000 1000000000 1000000000000000000\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 232, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s709125418", "group_id": "codeNet:p03345", "input_text": "use v5.18;\nuse warnings;\nsub read_line { chomp(my $str = ); $str }\nsub splited_read_line { split / /, read_line }\n\nmy ($A, $B, $C, $K) = splited_read_line;\nmy @sums;\n$sums[0] = [$B + $C, $A + $C, $A + $B];\n$sums[1] = [$sums[0][1] + $sums[0][2], $sums[0][0] + $sums[0][2], $sums[0][0] + $sums[0][1]]; \nsay $K % 2 == 1 ? $sums[0][0] - $sums[0][1] : $sums[1][0] - $sums[1][1];\n", "language": "Perl", "metadata": {"date": 1526866124, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03345.html", "problem_id": "p03345", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03345/input.txt", "sample_output_relpath": "derived/input_output/data/p03345/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03345/Perl/s709125418.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s709125418", "user_id": "u376692089"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nsub read_line { chomp(my $str = ); $str }\nsub splited_read_line { split / /, read_line }\n\nmy ($A, $B, $C, $K) = splited_read_line;\nmy @sums;\n$sums[0] = [$B + $C, $A + $C, $A + $B];\n$sums[1] = [$sums[0][1] + $sums[0][2], $sums[0][0] + $sums[0][2], $sums[0][0] + $sums[0][1]]; \nsay $K % 2 == 1 ? $sums[0][0] - $sums[0][1] : $sums[1][0] - $sums[1][1];\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively.\nAfter repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:\n\nEach of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.\n\nHowever, if the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nConstraints\n\n1 \\leq A,B,C \\leq 10^9\n\n0 \\leq K \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the integer Takahashi will get minus the integer Nakahashi will get, after repeating the following operation K times.\nIf the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nSample Input 1\n\n1 2 3 1\n\nSample Output 1\n\n1\n\nAfter one operation, Takahashi, Nakahashi and Hikuhashi have 5, 4 and 3, respectively. We should print 5-4=1.\n\nSample Input 2\n\n2 3 2 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n1000000000 1000000000 1000000000 1000000000000000000\n\nSample Output 3\n\n0", "sample_input": "1 2 3 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03345", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively.\nAfter repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:\n\nEach of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.\n\nHowever, if the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nConstraints\n\n1 \\leq A,B,C \\leq 10^9\n\n0 \\leq K \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the integer Takahashi will get minus the integer Nakahashi will get, after repeating the following operation K times.\nIf the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nSample Input 1\n\n1 2 3 1\n\nSample Output 1\n\n1\n\nAfter one operation, Takahashi, Nakahashi and Hikuhashi have 5, 4 and 3, respectively. We should print 5-4=1.\n\nSample Input 2\n\n2 3 2 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n1000000000 1000000000 1000000000 1000000000000000000\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 381, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s946589970", "group_id": "codeNet:p03346", "input_text": "$%+=$-=($a[$_]=$a[$_-1]+1)-$%for<>;print$#a-$%", "language": "Perl", "metadata": {"date": 1526956707, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03346.html", "problem_id": "p03346", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03346/input.txt", "sample_output_relpath": "derived/input_output/data/p03346/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03346/Perl/s946589970.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s946589970", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$%+=$-=($a[$_]=$a[$_-1]+1)-$%for<>;print$#a-$%", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence (P_1,P_2,...,P_N) which is a permutation of the integers from 1 through N.\nYou would like to sort this sequence in ascending order by repeating the following operation:\n\nChoose an element in the sequence and move it to the beginning or the end of the sequence.\n\nFind the minimum number of operations required.\nIt can be proved that it is actually possible to sort the sequence using this operation.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n(P_1,P_2,...,P_N) is a permutation of (1,2,...,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\n:\nP_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\n1\n3\n2\n4\n\nSample Output 1\n\n2\n\nFor example, the sequence can be sorted in ascending order as follows:\n\nMove 2 to the beginning. The sequence is now (2,1,3,4).\n\nMove 1 to the beginning. The sequence is now (1,2,3,4).\n\nSample Input 2\n\n6\n3\n2\n5\n1\n4\n6\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\n6\n3\n1\n2\n7\n4\n8\n5\n\nSample Output 3\n\n5", "sample_input": "4\n1\n3\n2\n4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03346", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence (P_1,P_2,...,P_N) which is a permutation of the integers from 1 through N.\nYou would like to sort this sequence in ascending order by repeating the following operation:\n\nChoose an element in the sequence and move it to the beginning or the end of the sequence.\n\nFind the minimum number of operations required.\nIt can be proved that it is actually possible to sort the sequence using this operation.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n(P_1,P_2,...,P_N) is a permutation of (1,2,...,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\n:\nP_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\n1\n3\n2\n4\n\nSample Output 1\n\n2\n\nFor example, the sequence can be sorted in ascending order as follows:\n\nMove 2 to the beginning. The sequence is now (2,1,3,4).\n\nMove 1 to the beginning. The sequence is now (1,2,3,4).\n\nSample Input 2\n\n6\n3\n2\n5\n1\n4\n6\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\n6\n3\n1\n2\n7\n4\n8\n5\n\nSample Output 3\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 198, "memory_kb": 47360}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s764570012", "group_id": "codeNet:p03347", "input_text": "<>;$\\-=$\\<0|$b<$_?$\\+$_+1:$b>$_&&1-$b,$b=$_+1for<>,0;print", "language": "Perl", "metadata": {"date": 1550154992, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03347.html", "problem_id": "p03347", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03347/input.txt", "sample_output_relpath": "derived/input_output/data/p03347/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03347/Perl/s764570012.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s764570012", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;$\\-=$\\<0|$b<$_?$\\+$_+1:$b>$_&&1-$b,$b=$_+1for<>,0;print", "problem_context": "Score : 700 points\n\nProblem Statement\n\nThere is a sequence X of length N, where every element is initially 0. Let X_i denote the i-th element of X.\n\nYou are given a sequence A of length N. The i-th element of A is A_i. Determine if we can make X equal to A by repeating the operation below. If we can, find the minimum number of operations required.\n\nChoose an integer i such that 1\\leq i\\leq N-1. Replace the value of X_{i+1} with the value of X_i plus 1.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq 10^9(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\n:\nA_N\n\nOutput\n\nIf we can make X equal to A by repeating the operation, print the minimum number of operations required. If we cannot, print -1.\n\nSample Input 1\n\n4\n0\n1\n1\n2\n\nSample Output 1\n\n3\n\nWe can make X equal to A as follows:\n\nChoose i=2. X becomes (0,0,1,0).\n\nChoose i=1. X becomes (0,1,1,0).\n\nChoose i=3. X becomes (0,1,1,2).\n\nSample Input 2\n\n3\n1\n2\n1\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n9\n0\n1\n1\n0\n1\n2\n2\n1\n2\n\nSample Output 3\n\n8", "sample_input": "4\n0\n1\n1\n2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03347", "source_text": "Score : 700 points\n\nProblem Statement\n\nThere is a sequence X of length N, where every element is initially 0. Let X_i denote the i-th element of X.\n\nYou are given a sequence A of length N. The i-th element of A is A_i. Determine if we can make X equal to A by repeating the operation below. If we can, find the minimum number of operations required.\n\nChoose an integer i such that 1\\leq i\\leq N-1. Replace the value of X_{i+1} with the value of X_i plus 1.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq 10^9(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\n:\nA_N\n\nOutput\n\nIf we can make X equal to A by repeating the operation, print the minimum number of operations required. If we cannot, print -1.\n\nSample Input 1\n\n4\n0\n1\n1\n2\n\nSample Output 1\n\n3\n\nWe can make X equal to A as follows:\n\nChoose i=2. X becomes (0,0,1,0).\n\nChoose i=1. X becomes (0,1,1,0).\n\nChoose i=3. X becomes (0,1,1,2).\n\nSample Input 2\n\n3\n1\n2\n1\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n9\n0\n1\n1\n0\n1\n2\n2\n1\n2\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 213, "memory_kb": 34816}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s498074346", "group_id": "codeNet:p03351", "input_text": "$/=get.words;say [?(abs(($0-$1|$1-$2)&$0-$2)>$3)]", "language": "Perl", "metadata": {"date": 1551017631, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "low_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/Perl/s498074346.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s498074346", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$/=get.words;say [?(abs(($0-$1|$1-$2)&$0-$2)>$3)]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 159, "memory_kb": 51240}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s557806088", "group_id": "codeNet:p03351", "input_text": "$/=get.words;[?($3>=abs $0-$2|$0-$1&$1-$2)].say", "language": "Perl", "metadata": {"date": 1538452674, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "low_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/Perl/s557806088.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s557806088", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$/=get.words;[?($3>=abs $0-$2|$0-$1&$1-$2)].say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 55, "cpu_time_ms": 145, "memory_kb": 51036}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s760299372", "group_id": "codeNet:p03351", "input_text": "($a, $b, $c, $d)=split / /, <>;\nif (abs($c-$a)<=$d || (abs($b-$a)<=$d && abs($c-$b)<=$d)){print \"Yes\\n\"}else{print \"No\\n\"}\n", "language": "Perl", "metadata": {"date": 1526173416, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "low_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/Perl/s760299372.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s760299372", "user_id": "u485495271"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "($a, $b, $c, $d)=split / /, <>;\nif (abs($c-$a)<=$d || (abs($b-$a)<=$d && abs($c-$b)<=$d)){print \"Yes\\n\"}else{print \"No\\n\"}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s076859666", "group_id": "codeNet:p03352", "input_text": "$_=get;say last $_>=*,sort ^32 X**2..9", "language": "Perl", "metadata": {"date": 1538450922, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03352.html", "problem_id": "p03352", "resource_group": "low_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/Perl/s076859666.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s076859666", "user_id": "u657913472"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "$_=get;say last $_>=*,sort ^32 X**2..9", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 187, "memory_kb": 58356}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s363771298", "group_id": "codeNet:p03352", "input_text": "my $X = ;\nprint int(sqrt($X))**2;", "language": "Perl", "metadata": {"date": 1526173707, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03352.html", "problem_id": "p03352", "resource_group": "low_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/Perl/s363771298.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s363771298", "user_id": "u807948625"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "my $X = ;\nprint int(sqrt($X))**2;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 40, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s321841993", "group_id": "codeNet:p03354", "input_text": "use strict;\nuse warnings;\nuse utf8;\nuse v5.18;\n\npackage UnionFind {\n\n sub new {\n my $class = shift;\n my %param = @_;\n\n my @parent = map { $_ } ( 0 .. $param{N} - 1 );\n my @rank = map { 0 } ( 0 .. $param{N} - 1 );\n\n my $self = bless {\n N => $param{N},\n parent => \\@parent,\n rank => \\@rank\n },\n $class;\n return $self;\n }\n\n sub find {\n my ( $self, $x ) = @_;\n\n # warn \"debug: $self->{parent}->[$x], $x\";\n return $x if $self->{parent}->[$x] == $x;\n\n $self->{parent}->[$x] = $self->find( $self->{parent}->[$x] );\n $self->{parent}->[$x];\n }\n\n sub unite {\n my ( $self, $x, $y ) = @_;\n $x = $self->find($x);\n $y = $self->find($y);\n return if $x == $y;\n\n my $rank = $self->{rank};\n my $parent = $self->{parent};\n\n if ( $rank->[$x] < $rank->[$y] ) {\n $parent->[$x] = $y;\n }\n else {\n $parent->[$y] = $x;\n if ( $rank->[$x] == $rank->[$y] ) {\n $rank->[$x]++;\n }\n }\n }\n\n sub same {\n my ( $self, $x, $y ) = @_;\n $self->find($x) == $self->find($y);\n }\n}\n\nmy ( $N, $M ) = split( / /, );\nmy @p = map { $_ - 1 } split( / /, );\nmy @x;\nmy @y;\nfor ( 1 .. $M ) {\n my ( $a, $b ) = split( / /, );\n push @x => $a - 1;\n push @y => $b - 1;\n}\n\nmy $uf = UnionFind->new( N => $N );\nfor ( 0 .. $M - 1 ) {\n $uf->unite( $x[$_], $y[$_] );\n}\n\nmy $ans = 0;\nfor ( 0 .. $N - 1 ) {\n $ans++ if $_ == $p[$_] or $uf->same( $_, $p[$_] );\n}\n\nprint \"$ans\\n\";\n", "language": "Perl", "metadata": {"date": 1526599902, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03354.html", "problem_id": "p03354", "resource_group": "low_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/Perl/s321841993.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s321841993", "user_id": "u988832865"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\nuse v5.18;\n\npackage UnionFind {\n\n sub new {\n my $class = shift;\n my %param = @_;\n\n my @parent = map { $_ } ( 0 .. $param{N} - 1 );\n my @rank = map { 0 } ( 0 .. $param{N} - 1 );\n\n my $self = bless {\n N => $param{N},\n parent => \\@parent,\n rank => \\@rank\n },\n $class;\n return $self;\n }\n\n sub find {\n my ( $self, $x ) = @_;\n\n # warn \"debug: $self->{parent}->[$x], $x\";\n return $x if $self->{parent}->[$x] == $x;\n\n $self->{parent}->[$x] = $self->find( $self->{parent}->[$x] );\n $self->{parent}->[$x];\n }\n\n sub unite {\n my ( $self, $x, $y ) = @_;\n $x = $self->find($x);\n $y = $self->find($y);\n return if $x == $y;\n\n my $rank = $self->{rank};\n my $parent = $self->{parent};\n\n if ( $rank->[$x] < $rank->[$y] ) {\n $parent->[$x] = $y;\n }\n else {\n $parent->[$y] = $x;\n if ( $rank->[$x] == $rank->[$y] ) {\n $rank->[$x]++;\n }\n }\n }\n\n sub same {\n my ( $self, $x, $y ) = @_;\n $self->find($x) == $self->find($y);\n }\n}\n\nmy ( $N, $M ) = split( / /, );\nmy @p = map { $_ - 1 } split( / /, );\nmy @x;\nmy @y;\nfor ( 1 .. $M ) {\n my ( $a, $b ) = split( / /, );\n push @x => $a - 1;\n push @y => $b - 1;\n}\n\nmy $uf = UnionFind->new( N => $N );\nfor ( 0 .. $M - 1 ) {\n $uf->unite( $x[$_], $y[$_] );\n}\n\nmy $ans = 0;\nfor ( 0 .. $N - 1 ) {\n $ans++ if $_ == $p[$_] or $uf->same( $_, $p[$_] );\n}\n\nprint \"$ans\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1656, "cpu_time_ms": 739, "memory_kb": 29900}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s021055621", "group_id": "codeNet:p03355", "input_text": "say unique(~< 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": "p03355", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 41, "cpu_time_ms": 918, "memory_kb": 109764}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s484556731", "group_id": "codeNet:p03356", "input_text": "sub f{my$i=pop;$u[$i]=$u[$i]-$i?f($u[$i]//=$i):$i}print<>-grep{/ /,$u[f$']=f$`for<>;f(++$i)^f$_}glob<>", "language": "Perl", "metadata": {"date": 1551733588, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03356.html", "problem_id": "p03356", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03356/input.txt", "sample_output_relpath": "derived/input_output/data/p03356/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03356/Perl/s484556731.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s484556731", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "sub f{my$i=pop;$u[$i]=$u[$i]-$i?f($u[$i]//=$i):$i}print<>-grep{/ /,$u[f$']=f$`for<>;f(++$i)^f$_}glob<>", "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": "p03356", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 102, "cpu_time_ms": 1244, "memory_kb": 41472}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s208581633", "group_id": "codeNet:p03359", "input_text": "print<>!~$\"-($`>$')+$`", "language": "Perl", "metadata": {"date": 1551039742, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03359.html", "problem_id": "p03359", "resource_group": "low_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/Perl/s208581633.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s208581633", "user_id": "u832039789"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "print<>!~$\"-($`>$')+$`", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 22, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s305164493", "group_id": "codeNet:p03360", "input_text": "say sum map *+);\nmy @a = map {$_ - 0} split(/\\s+/o,);\n\nmy $s = 0;\nmy %ss = ();\n$ss{$s} ++;\nfor(my $i=0;$i<$n;$i++){\n $s += $a[$i];\n $ss{$s} ++;\n}\nmy $ans = 0;\nforeach my $s1 ( keys %ss ){\n my $k = $ss{$s1} - 0;\n next if $k <= 1;\n $k --;\n $ans += $k * ($k + 1 )/2;\n}\nprint \"$ans\\n\";\nexit(0);\n\n\n", "language": "Perl", "metadata": {"date": 1537110877, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03363.html", "problem_id": "p03363", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03363/input.txt", "sample_output_relpath": "derived/input_output/data/p03363/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03363/Perl/s324738452.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s324738452", "user_id": "u750383873"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n) = map {$_ - 0} split(/\\s+/o,);\nmy @a = map {$_ - 0} split(/\\s+/o,);\n\nmy $s = 0;\nmy %ss = ();\n$ss{$s} ++;\nfor(my $i=0;$i<$n;$i++){\n $s += $a[$i];\n $ss{$s} ++;\n}\nmy $ans = 0;\nforeach my $s1 ( keys %ss ){\n my $k = $ss{$s1} - 0;\n next if $k <= 1;\n $k --;\n $ans += $k * ($k + 1 )/2;\n}\nprint \"$ans\\n\";\nexit(0);\n\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have an integer sequence A, whose length is N.\n\nFind the number of the non-empty contiguous subsequences of A whose sums are 0.\nNote that we are counting the ways to take out subsequences.\nThat is, even if the contents of some two subsequences are the same, they are counted individually if they are taken from different positions.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^9 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nFind the number of the non-empty contiguous subsequences of A whose sum is 0.\n\nSample Input 1\n\n6\n1 3 -4 2 2 -2\n\nSample Output 1\n\n3\n\nThere are three contiguous subsequences whose sums are 0: (1,3,-4), (-4,2,2) and (2,-2).\n\nSample Input 2\n\n7\n1 -1 1 -1 1 -1 1\n\nSample Output 2\n\n12\n\nIn this case, some subsequences that have the same contents but are taken from different positions are counted individually.\nFor example, three occurrences of (1, -1) are counted.\n\nSample Input 3\n\n5\n1 -2 3 -4 5\n\nSample Output 3\n\n0\n\nThere are no contiguous subsequences whose sums are 0.", "sample_input": "6\n1 3 -4 2 2 -2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03363", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have an integer sequence A, whose length is N.\n\nFind the number of the non-empty contiguous subsequences of A whose sums are 0.\nNote that we are counting the ways to take out subsequences.\nThat is, even if the contents of some two subsequences are the same, they are counted individually if they are taken from different positions.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^9 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nFind the number of the non-empty contiguous subsequences of A whose sum is 0.\n\nSample Input 1\n\n6\n1 3 -4 2 2 -2\n\nSample Output 1\n\n3\n\nThere are three contiguous subsequences whose sums are 0: (1,3,-4), (-4,2,2) and (2,-2).\n\nSample Input 2\n\n7\n1 -1 1 -1 1 -1 1\n\nSample Output 2\n\n12\n\nIn this case, some subsequences that have the same contents but are taken from different positions are counted individually.\nFor example, three occurrences of (1, -1) are counted.\n\nSample Input 3\n\n5\n1 -2 3 -4 5\n\nSample Output 3\n\n0\n\nThere are no contiguous subsequences whose sums are 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 352, "cpu_time_ms": 343, "memory_kb": 52260}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s293934872", "group_id": "codeNet:p03369", "input_text": "print 100*(7+y/o//)for<>", "language": "Perl", "metadata": {"date": 1551040125, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03369.html", "problem_id": "p03369", "resource_group": "low_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/Perl/s293934872.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s293934872", "user_id": "u832039789"}, "prompt_components": {"gold_output": "900\n", "input_to_evaluate": "print 100*(7+y/o//)for<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 24, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s013110224", "group_id": "codeNet:p03370", "input_text": "chomp($a=<>);\n($n,$x)=split/ /,$a;\n\nwhile(<>){\n chomp;\n push @a,$_;\n $sum+=$_;\n}\n@a=sort{$a <=> $b}@a;\n$kosu=@a;\n$nokori=int(($x-$sum)/$a[0]);\n\nprint $kosu+$nokori;", "language": "Perl", "metadata": {"date": 1570587420, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03370.html", "problem_id": "p03370", "resource_group": "low_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/Perl/s013110224.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s013110224", "user_id": "u124498235"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "chomp($a=<>);\n($n,$x)=split/ /,$a;\n\nwhile(<>){\n chomp;\n push @a,$_;\n $sum+=$_;\n}\n@a=sort{$a <=> $b}@a;\n$kosu=@a;\n$nokori=int(($x-$sum)/$a[0]);\n\nprint $kosu+$nokori;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 173, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s536988462", "group_id": "codeNet:p03377", "input_text": "my ($a, $b, $x) = split(' ', <>);\nprint ($a <= $x && $x <= $a+$b ? 'YES' : 'NO');", "language": "Perl", "metadata": {"date": 1524180016, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03377.html", "problem_id": "p03377", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03377/input.txt", "sample_output_relpath": "derived/input_output/data/p03377/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03377/Perl/s536988462.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s536988462", "user_id": "u081594539"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "my ($a, $b, $x) = split(' ', <>);\nprint ($a <= $x && $x <= $a+$b ? 'YES' : 'NO');", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "sample_input": "3 5 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03377", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s228551330", "group_id": "codeNet:p03378", "input_text": "<>=~/ .* /;print$&>2*($a=grep$_<$',glob<>)?$a:$&-$a", "language": "Perl", "metadata": {"date": 1523758756, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03378.html", "problem_id": "p03378", "resource_group": "low_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/Perl/s228551330.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s228551330", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>=~/ .* /;print$&>2*($a=grep$_<$',glob<>)?$a:$&-$a", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s100380975", "group_id": "codeNet:p03379", "input_text": "chomp($n=<>);\nchomp($nn=<>);\n@ary=split/ /,$nn;\n\nfor($i=0;$i<$n;$i++){\n\t@wkary = @ary;\n\t$num=splice @wkary,$i,1;\n \n @wkary=sort{$a <=> $b}@wkary;\n print $wkary[$n/2-1].\"\\n\";\n}", "language": "Perl", "metadata": {"date": 1569638051, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03379.html", "problem_id": "p03379", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03379/input.txt", "sample_output_relpath": "derived/input_output/data/p03379/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03379/Perl/s100380975.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s100380975", "user_id": "u124498235"}, "prompt_components": {"gold_output": "4\n3\n3\n4\n", "input_to_evaluate": "chomp($n=<>);\nchomp($nn=<>);\n@ary=split/ /,$nn;\n\nfor($i=0;$i<$n;$i++){\n\t@wkary = @ary;\n\t$num=splice @wkary,$i,1;\n \n @wkary=sort{$a <=> $b}@wkary;\n print $wkary[$n/2-1].\"\\n\";\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWhen l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\n\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number.\nFor each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.\n\nFind B_i for each i = 1, 2, ..., N.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n1 \\leq X_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\nX_1 X_2 ... X_N\n\nOutput\n\nPrint N lines.\nThe i-th line should contain B_i.\n\nSample Input 1\n\n4\n2 4 4 3\n\nSample Output 1\n\n4\n3\n3\n4\n\nSince the median of X_2, X_3, X_4 is 4, B_1 = 4.\n\nSince the median of X_1, X_3, X_4 is 3, B_2 = 3.\n\nSince the median of X_1, X_2, X_4 is 3, B_3 = 3.\n\nSince the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n2\n1\n\nSample Input 3\n\n6\n5 5 4 4 3 3\n\nSample Output 3\n\n4\n4\n4\n4\n4\n4", "sample_input": "4\n2 4 4 3\n"}, "reference_outputs": ["4\n3\n3\n4\n"], "source_document_id": "p03379", "source_text": "Score : 300 points\n\nProblem Statement\n\nWhen l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\n\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number.\nFor each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.\n\nFind B_i for each i = 1, 2, ..., N.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n1 \\leq X_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\nX_1 X_2 ... X_N\n\nOutput\n\nPrint N lines.\nThe i-th line should contain B_i.\n\nSample Input 1\n\n4\n2 4 4 3\n\nSample Output 1\n\n4\n3\n3\n4\n\nSince the median of X_2, X_3, X_4 is 4, B_1 = 4.\n\nSince the median of X_1, X_3, X_4 is 3, B_2 = 3.\n\nSince the median of X_1, X_2, X_4 is 3, B_3 = 3.\n\nSince the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n2\n1\n\nSample Input 3\n\n6\n5 5 4 4 3 3\n\nSample Output 3\n\n4\n4\n4\n4\n4\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2106, "memory_kb": 43880}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s998298002", "group_id": "codeNet:p03382", "input_text": "get;$_=+< a_j so that {\\rm comb}(a_i,a_j) is maximized.\nIf there are multiple pairs that maximize the value, any of them is accepted.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n0 \\leq a_i \\leq 10^9\n\na_1,a_2,...,a_n are pairwise distinct.\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 a_i and a_j that you selected, with a space in between.\n\nSample Input 1\n\n5\n6 9 4 2 11\n\nSample Output 1\n\n11 6\n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n\\rm{comb}(4,2)=6\n\n\\rm{comb}(6,2)=15\n\n\\rm{comb}(6,4)=15\n\n\\rm{comb}(9,2)=36\n\n\\rm{comb}(9,4)=126\n\n\\rm{comb}(9,6)=84\n\n\\rm{comb}(11,2)=55\n\n\\rm{comb}(11,4)=330\n\n\\rm{comb}(11,6)=462\n\n\\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\nSample Input 2\n\n2\n100 0\n\nSample Output 2\n\n100 0", "sample_input": "5\n6 9 4 2 11\n"}, "reference_outputs": ["11 6\n"], "source_document_id": "p03382", "source_text": "Score : 400 points\n\nProblem Statement\n\nLet {\\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order.\nFrom n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\\rm comb}(a_i,a_j) is maximized.\nIf there are multiple pairs that maximize the value, any of them is accepted.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n0 \\leq a_i \\leq 10^9\n\na_1,a_2,...,a_n are pairwise distinct.\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 a_i and a_j that you selected, with a space in between.\n\nSample Input 1\n\n5\n6 9 4 2 11\n\nSample Output 1\n\n11 6\n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n\\rm{comb}(4,2)=6\n\n\\rm{comb}(6,2)=15\n\n\\rm{comb}(6,4)=15\n\n\\rm{comb}(9,2)=36\n\n\\rm{comb}(9,4)=126\n\n\\rm{comb}(9,6)=84\n\n\\rm{comb}(11,2)=55\n\n\\rm{comb}(11,4)=330\n\n\\rm{comb}(11,6)=462\n\n\\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\nSample Input 2\n\n2\n100 0\n\nSample Output 2\n\n100 0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 50, "cpu_time_ms": 1262, "memory_kb": 104600}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s469850408", "group_id": "codeNet:p03385", "input_text": "$_=<>;print/a/&/b/&/c/?Yes:No", "language": "Perl", "metadata": {"date": 1561577664, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03385.html", "problem_id": "p03385", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03385/input.txt", "sample_output_relpath": "derived/input_output/data/p03385/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03385/Perl/s469850408.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s469850408", "user_id": "u573154728"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$_=<>;print/a/&/b/&/c/?Yes:No", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 3 consisting of a, b and c. Determine if S can be obtained by permuting abc.\n\nConstraints\n\n|S|=3\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S can be obtained by permuting abc, print Yes; otherwise, print No.\n\nSample Input 1\n\nbac\n\nSample Output 1\n\nYes\n\nSwapping the first and second characters in bac results in abc.\n\nSample Input 2\n\nbab\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nabc\n\nSample Output 3\n\nYes\n\nSample Input 4\n\naaa\n\nSample Output 4\n\nNo", "sample_input": "bac\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03385", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 3 consisting of a, b and c. Determine if S can be obtained by permuting abc.\n\nConstraints\n\n|S|=3\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S can be obtained by permuting abc, print Yes; otherwise, print No.\n\nSample Input 1\n\nbac\n\nSample Output 1\n\nYes\n\nSwapping the first and second characters in bac results in abc.\n\nSample Input 2\n\nbab\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nabc\n\nSample Output 3\n\nYes\n\nSample Input 4\n\naaa\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 29, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s708782424", "group_id": "codeNet:p03386", "input_text": "<>=~/ .* /;$,=$/;\nprint grep{$_-$`<$' || $&-$_<$'}$`..$&;\n\n#wjsjsjsjnssnskffieeldldkdndnjdjeuwiwkdkndbfjfufidkddjjsbsjdjdkdududkelekdidudjdbddjdjjje", "language": "Perl", "metadata": {"date": 1571692157, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03386.html", "problem_id": "p03386", "resource_group": "low_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/Perl/s708782424.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s708782424", "user_id": "u832039789"}, "prompt_components": {"gold_output": "3\n4\n7\n8\n", "input_to_evaluate": "<>=~/ .* /;$,=$/;\nprint grep{$_-$`<$' || $&-$_<$'}$`..$&;\n\n#wjsjsjsjnssnskffieeldldkdndnjdjeuwiwkdkndbfjfufidkddjjsbsjdjdkdududkelekdidudjdbddjdjjje", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 16, "memory_kb": 1408}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s962828356", "group_id": "codeNet:p03386", "input_text": "$/=get.words;put ($0..^($_=$0+$2 min+$1),($_ max$1-$2+1)..$1)", "language": "Perl", "metadata": {"date": 1538449880, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03386.html", "problem_id": "p03386", "resource_group": "low_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/Perl/s962828356.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s962828356", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n4\n7\n8\n", "input_to_evaluate": "$/=get.words;put ($0..^($_=$0+$2 min+$1),($_ max$1-$2+1)..$1)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 170, "memory_kb": 56304}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s644080236", "group_id": "codeNet:p03386", "input_text": "#! /usr/bin/perl\n\nuse strict;\nuse warnings;\n\nchomp(my $s = <>);\nmy($a, $b, $k) = split(/\\s+/, $s);\n\nmy $s1 = $a;\nmy $e1 = $a + ($k - 1);\nmy $s2 = $b - ($k - 1);\nmy $e2 = $b;\n\nif($b < $e1) {\n $e1 = $b;\n}\nif($s2 <= $e1) {\n $s2 = $e1 + 1;\n}\nforeach my $i ($s1 .. $e1) {\n print $i, \"\\n\";\n}\nforeach my $i ($s2 .. $e2) {\n print $i, \"\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1536012568, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03386.html", "problem_id": "p03386", "resource_group": "low_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/Perl/s644080236.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s644080236", "user_id": "u477280761"}, "prompt_components": {"gold_output": "3\n4\n7\n8\n", "input_to_evaluate": "#! /usr/bin/perl\n\nuse strict;\nuse warnings;\n\nchomp(my $s = <>);\nmy($a, $b, $k) = split(/\\s+/, $s);\n\nmy $s1 = $a;\nmy $e1 = $a + ($k - 1);\nmy $s2 = $b - ($k - 1);\nmy $e2 = $b;\n\nif($b < $e1) {\n $e1 = $b;\n}\nif($s2 <= $e1) {\n $s2 = $e1 + 1;\n}\nforeach my $i ($s1 .. $e1) {\n print $i, \"\\n\";\n}\nforeach my $i ($s2 .. $e2) {\n print $i, \"\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 346, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s753749223", "group_id": "codeNet:p03386", "input_text": "get~~m:g/\\d+/;(|($0..^($_=$0+$2 min+$1)),|(($_ max$1-$2+1)..$1))>>.say", "language": "Perl", "metadata": {"date": 1533196034, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03386.html", "problem_id": "p03386", "resource_group": "low_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/Perl/s753749223.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s753749223", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n4\n7\n8\n", "input_to_evaluate": "get~~m:g/\\d+/;(|($0..^($_=$0+$2 min+$1)),|(($_ max$1-$2+1)..$1))>>.say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 371, "memory_kb": 71004}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s512203898", "group_id": "codeNet:p03387", "input_text": "use v5.18;\nuse warnings;\nuse List::Util qw( min );\nsub read_line { chomp(my $str = ); $str }\nsub splited_read_line { split / /, read_line }\nmy @nums = sort { $b <=> $a } splited_read_line;\nmy ($max, $middle, $min) = @nums;\nmy $one_conut = $max - $middle;\n$middle += $one_conut, $min += $one_conut;\nmy $two_count = $max - $min;\n$one_conut++ if $two_count % 2;\n$two_count = int( ($two_count + 1) / 2);\nsay $one_conut + $two_count;\n", "language": "Perl", "metadata": {"date": 1523152275, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03387.html", "problem_id": "p03387", "resource_group": "low_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/Perl/s512203898.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s512203898", "user_id": "u376692089"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nuse List::Util qw( min );\nsub read_line { chomp(my $str = ); $str }\nsub splited_read_line { split / /, read_line }\nmy @nums = sort { $b <=> $a } splited_read_line;\nmy ($max, $middle, $min) = @nums;\nmy $one_conut = $max - $middle;\n$middle += $one_conut, $min += $one_conut;\nmy $two_count = $max - $min;\n$one_conut++ if $two_count % 2;\n$two_count = int( ($two_count + 1) / 2);\nsay $one_conut + $two_count;\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s519610716", "group_id": "codeNet:p03389", "input_text": "my@a=get.words;say ($_=@a.max*3-@a.sum)/2+|0+$_%2*2", "language": "Perl", "metadata": {"date": 1523157397, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03389.html", "problem_id": "p03389", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03389/input.txt", "sample_output_relpath": "derived/input_output/data/p03389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03389/Perl/s519610716.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s519610716", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my@a=get.words;say ($_=@a.max*3-@a.sum)/2+|0+$_%2*2", "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": "p03389", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 635, "memory_kb": 65348}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s765054256", "group_id": "codeNet:p03390", "input_text": "use bigint;<>;print/ /*(-($`!=$')+($_=$`*$'+0))/($a=sqrt)+$a-2,$/for<>", "language": "Perl", "metadata": {"date": 1539923660, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03390.html", "problem_id": "p03390", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03390/input.txt", "sample_output_relpath": "derived/input_output/data/p03390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03390/Perl/s765054256.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s765054256", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n12\n4\n11\n14\n57\n31\n671644785\n", "input_to_evaluate": "use bigint;<>;print/ /*(-($`!=$')+($_=$`*$'+0))/($a=sqrt)+$a-2,$/for<>", "problem_context": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "sample_input": "8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n"}, "reference_outputs": ["1\n12\n4\n11\n14\n57\n31\n671644785\n"], "source_document_id": "p03390", "source_text": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 53, "memory_kb": 4992}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s582655781", "group_id": "codeNet:p03390", "input_text": "<>;print/ /*((($_*=$')-($`!=$'))/($%=sqrt)|0)+$%-2,$/for<>", "language": "Perl", "metadata": {"date": 1537730692, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03390.html", "problem_id": "p03390", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03390/input.txt", "sample_output_relpath": "derived/input_output/data/p03390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03390/Perl/s582655781.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s582655781", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n12\n4\n11\n14\n57\n31\n671644785\n", "input_to_evaluate": "<>;print/ /*((($_*=$')-($`!=$'))/($%=sqrt)|0)+$%-2,$/for<>", "problem_context": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "sample_input": "8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n"}, "reference_outputs": ["1\n12\n4\n11\n14\n57\n31\n671644785\n"], "source_document_id": "p03390", "source_text": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s241874587", "group_id": "codeNet:p03390", "input_text": "<>;\nfor(<>){\n\t/ /;\n\t$%=sqrt$`*$';\n\t$%-=$%*$%==$`*$';\n\tprint$%*2-($%+1>=$`*$'/$%)-($`!=$'),$/\n}\n", "language": "Perl", "metadata": {"date": 1537729456, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03390.html", "problem_id": "p03390", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03390/input.txt", "sample_output_relpath": "derived/input_output/data/p03390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03390/Perl/s241874587.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s241874587", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n12\n4\n11\n14\n57\n31\n671644785\n", "input_to_evaluate": "<>;\nfor(<>){\n\t/ /;\n\t$%=sqrt$`*$';\n\t$%-=$%*$%==$`*$';\n\tprint$%*2-($%+1>=$`*$'/$%)-($`!=$'),$/\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "sample_input": "8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n"}, "reference_outputs": ["1\n12\n4\n11\n14\n57\n31\n671644785\n"], "source_document_id": "p03390", "source_text": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 95, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s645606262", "group_id": "codeNet:p03390", "input_text": "get;map {m:g/\\d+/;say ($0*$1-!($0==$1))/($!=0+|sqrt $0*$1)+$!-2+|0},lines", "language": "Perl", "metadata": {"date": 1537690522, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03390.html", "problem_id": "p03390", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03390/input.txt", "sample_output_relpath": "derived/input_output/data/p03390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03390/Perl/s645606262.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s645606262", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n12\n4\n11\n14\n57\n31\n671644785\n", "input_to_evaluate": "get;map {m:g/\\d+/;say ($0*$1-!($0==$1))/($!=0+|sqrt $0*$1)+$!-2+|0},lines", "problem_context": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "sample_input": "8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n"}, "reference_outputs": ["1\n12\n4\n11\n14\n57\n31\n671644785\n"], "source_document_id": "p03390", "source_text": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 425, "memory_kb": 80912}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s376482009", "group_id": "codeNet:p03391", "input_text": "$m=9e9;/ /,$m-=$-=$`>$'&&$m-$',$%+=$`for<>;print$-=$%-$m", "language": "Perl", "metadata": {"date": 1566819140, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03391.html", "problem_id": "p03391", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03391/input.txt", "sample_output_relpath": "derived/input_output/data/p03391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03391/Perl/s376482009.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s376482009", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$m=9e9;/ /,$m-=$-=$`>$'&&$m-$',$%+=$`for<>;print$-=$%-$m", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given sequences A and B consisting of non-negative integers.\nThe lengths of both A and B are N, and the sums of the elements in A and B are equal.\nThe i-th element in A is A_i, and the i-th element in B is B_i.\n\nTozan and Gezan repeats the following sequence of operations:\n\nIf A and B are equal sequences, terminate the process.\n\nOtherwise, first Tozan chooses a positive element in A and decrease it by 1.\n\nThen, Gezan chooses a positive element in B and decrease it by 1.\n\nThen, give one candy to Takahashi, their pet.\n\nTozan wants the number of candies given to Takahashi until the process is terminated to be as large as possible, while Gezan wants it to be as small as possible.\nFind the number of candies given to Takahashi when both of them perform the operations optimally.\n\nConstraints\n\n1 \\leq N \\leq 2 × 10^5\n\n0 \\leq A_i,B_i \\leq 10^9(1\\leq i\\leq N)\n\nThe sums of the elements in A and B are equal.\n\nAll values in input are integers.\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 number of candies given to Takahashi when both Tozan and Gezan perform the operations optimally.\n\nSample Input 1\n\n2\n1 2\n3 2\n\nSample Output 1\n\n2\n\nWhen both Tozan and Gezan perform the operations optimally, the process will proceed as follows:\n\nTozan decreases A_1 by 1.\n\nGezan decreases B_1 by 1.\n\nOne candy is given to Takahashi.\n\nTozan decreases A_2 by 1.\n\nGezan decreases B_1 by 1.\n\nOne candy is given to Takahashi.\n\nAs A and B are equal, the process is terminated.\n\nSample Input 2\n\n3\n8 3\n0 1\n4 8\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1\n1 1\n\nSample Output 3\n\n0", "sample_input": "2\n1 2\n3 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03391", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given sequences A and B consisting of non-negative integers.\nThe lengths of both A and B are N, and the sums of the elements in A and B are equal.\nThe i-th element in A is A_i, and the i-th element in B is B_i.\n\nTozan and Gezan repeats the following sequence of operations:\n\nIf A and B are equal sequences, terminate the process.\n\nOtherwise, first Tozan chooses a positive element in A and decrease it by 1.\n\nThen, Gezan chooses a positive element in B and decrease it by 1.\n\nThen, give one candy to Takahashi, their pet.\n\nTozan wants the number of candies given to Takahashi until the process is terminated to be as large as possible, while Gezan wants it to be as small as possible.\nFind the number of candies given to Takahashi when both of them perform the operations optimally.\n\nConstraints\n\n1 \\leq N \\leq 2 × 10^5\n\n0 \\leq A_i,B_i \\leq 10^9(1\\leq i\\leq N)\n\nThe sums of the elements in A and B are equal.\n\nAll values in input are integers.\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 number of candies given to Takahashi when both Tozan and Gezan perform the operations optimally.\n\nSample Input 1\n\n2\n1 2\n3 2\n\nSample Output 1\n\n2\n\nWhen both Tozan and Gezan perform the operations optimally, the process will proceed as follows:\n\nTozan decreases A_1 by 1.\n\nGezan decreases B_1 by 1.\n\nOne candy is given to Takahashi.\n\nTozan decreases A_2 by 1.\n\nGezan decreases B_1 by 1.\n\nOne candy is given to Takahashi.\n\nAs A and B are equal, the process is terminated.\n\nSample Input 2\n\n3\n8 3\n0 1\n4 8\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1\n1 1\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 56, "cpu_time_ms": 28, "memory_kb": 3328}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s566196067", "group_id": "codeNet:p03399", "input_text": "sub f{$_[$_[1]<\"@_\"]}print+f(~~<>,~~<>)+f~~<>,~~<>", "language": "Perl", "metadata": {"date": 1571326799, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03399.html", "problem_id": "p03399", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03399/input.txt", "sample_output_relpath": "derived/input_output/data/p03399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03399/Perl/s566196067.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s566196067", "user_id": "u832039789"}, "prompt_components": {"gold_output": "520\n", "input_to_evaluate": "sub f{$_[$_[1]<\"@_\"]}print+f(~~<>,~~<>)+f~~<>,~~<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou planned a trip using trains and buses.\nThe train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket.\nSimilarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket.\n\nFind the minimum total fare when the optimal choices are made for trains and buses.\n\nConstraints\n\n1 \\leq A \\leq 1 000\n\n1 \\leq B \\leq 1 000\n\n1 \\leq C \\leq 1 000\n\n1 \\leq D \\leq 1 000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\n\nOutput\n\nPrint the minimum total fare.\n\nSample Input 1\n\n600\n300\n220\n420\n\nSample Output 1\n\n520\n\nThe train fare will be 600 yen if you buy ordinary tickets, and 300 yen if you buy an unlimited ticket.\nThus, the optimal choice for trains is to buy an unlimited ticket for 300 yen.\nOn the other hand, the optimal choice for buses is to buy ordinary tickets for 220 yen.\n\nTherefore, the minimum total fare is 300 + 220 = 520 yen.\n\nSample Input 2\n\n555\n555\n400\n200\n\nSample Output 2\n\n755\n\nSample Input 3\n\n549\n817\n715\n603\n\nSample Output 3\n\n1152", "sample_input": "600\n300\n220\n420\n"}, "reference_outputs": ["520\n"], "source_document_id": "p03399", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou planned a trip using trains and buses.\nThe train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket.\nSimilarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket.\n\nFind the minimum total fare when the optimal choices are made for trains and buses.\n\nConstraints\n\n1 \\leq A \\leq 1 000\n\n1 \\leq B \\leq 1 000\n\n1 \\leq C \\leq 1 000\n\n1 \\leq D \\leq 1 000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\n\nOutput\n\nPrint the minimum total fare.\n\nSample Input 1\n\n600\n300\n220\n420\n\nSample Output 1\n\n520\n\nThe train fare will be 600 yen if you buy ordinary tickets, and 300 yen if you buy an unlimited ticket.\nThus, the optimal choice for trains is to buy an unlimited ticket for 300 yen.\nOn the other hand, the optimal choice for buses is to buy ordinary tickets for 220 yen.\n\nTherefore, the minimum total fare is 300 + 220 = 520 yen.\n\nSample Input 2\n\n555\n555\n400\n200\n\nSample Output 2\n\n755\n\nSample Input 3\n\n549\n817\n715\n603\n\nSample Output 3\n\n1152", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 50, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s663314041", "group_id": "codeNet:p03399", "input_text": "use nqp;\nnqp::stmts(\n(my int $a := get.Int),\n(my int $b := get.Int),\n(my int $c := get.Int),\n(my int $d := get.Int),\nsay nqp::if(nqp::isle_i($a,$b),$a,$b) + nqp::if(nqp::isle_i($c,$d),$c,$d));", "language": "Perl", "metadata": {"date": 1522043156, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03399.html", "problem_id": "p03399", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03399/input.txt", "sample_output_relpath": "derived/input_output/data/p03399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03399/Perl/s663314041.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s663314041", "user_id": "u502845410"}, "prompt_components": {"gold_output": "520\n", "input_to_evaluate": "use nqp;\nnqp::stmts(\n(my int $a := get.Int),\n(my int $b := get.Int),\n(my int $c := get.Int),\n(my int $d := get.Int),\nsay nqp::if(nqp::isle_i($a,$b),$a,$b) + nqp::if(nqp::isle_i($c,$d),$c,$d));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou planned a trip using trains and buses.\nThe train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket.\nSimilarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket.\n\nFind the minimum total fare when the optimal choices are made for trains and buses.\n\nConstraints\n\n1 \\leq A \\leq 1 000\n\n1 \\leq B \\leq 1 000\n\n1 \\leq C \\leq 1 000\n\n1 \\leq D \\leq 1 000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\n\nOutput\n\nPrint the minimum total fare.\n\nSample Input 1\n\n600\n300\n220\n420\n\nSample Output 1\n\n520\n\nThe train fare will be 600 yen if you buy ordinary tickets, and 300 yen if you buy an unlimited ticket.\nThus, the optimal choice for trains is to buy an unlimited ticket for 300 yen.\nOn the other hand, the optimal choice for buses is to buy ordinary tickets for 220 yen.\n\nTherefore, the minimum total fare is 300 + 220 = 520 yen.\n\nSample Input 2\n\n555\n555\n400\n200\n\nSample Output 2\n\n755\n\nSample Input 3\n\n549\n817\n715\n603\n\nSample Output 3\n\n1152", "sample_input": "600\n300\n220\n420\n"}, "reference_outputs": ["520\n"], "source_document_id": "p03399", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou planned a trip using trains and buses.\nThe train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket.\nSimilarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket.\n\nFind the minimum total fare when the optimal choices are made for trains and buses.\n\nConstraints\n\n1 \\leq A \\leq 1 000\n\n1 \\leq B \\leq 1 000\n\n1 \\leq C \\leq 1 000\n\n1 \\leq D \\leq 1 000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\n\nOutput\n\nPrint the minimum total fare.\n\nSample Input 1\n\n600\n300\n220\n420\n\nSample Output 1\n\n520\n\nThe train fare will be 600 yen if you buy ordinary tickets, and 300 yen if you buy an unlimited ticket.\nThus, the optimal choice for trains is to buy an unlimited ticket for 300 yen.\nOn the other hand, the optimal choice for buses is to buy ordinary tickets for 220 yen.\n\nTherefore, the minimum total fare is 300 + 220 = 520 yen.\n\nSample Input 2\n\n555\n555\n400\n200\n\nSample Output 2\n\n755\n\nSample Input 3\n\n549\n817\n715\n603\n\nSample Output 3\n\n1152", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 124, "memory_kb": 50332}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s152142292", "group_id": "codeNet:p03400", "input_text": "<>;$\\+=? ??$':1+~-$`/$_|0for<>;print", "language": "Perl", "metadata": {"date": 1522033178, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03400.html", "problem_id": "p03400", "resource_group": "low_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/Perl/s152142292.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s152142292", "user_id": "u283869437"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "<>;$\\+=? ??$':1+~-$`/$_|0for<>;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s019552037", "group_id": "codeNet:p03401", "input_text": "use v5.18;\nuse warnings;\nuse Data::Dumper qw( Dumper );\nuse List::Util qw( sum );\nsub line { chomp(my $str = ); $str }\nsub split_line { split / /, line }\nmy $spot_num = line;\nmy @points = (0, split_line, 0);\nmy $orig_sum_cost = sum map { abs($points[$_ - 1] - $points[$_]) } 1 .. $#points;\nfor my $spot (1 .. $#points - 1) {\n my ($cost, $left_cost, $right_cost) = ($points[$spot], $points[$spot - 1], $points[$spot + 1]);\n # 単調減少or増加 \n if ( ($left_cost <= $cost && $cost <= $right_cost) || ($left_cost >= $cost && $cost >= $right_cost) ) {\n say $orig_sum_cost;\n } else {\n my $orig_diff = abs($left_cost - $cost) + abs($cost - $right_cost);\n my $deleted_diff = abs($left_cost - $right_cost);\n say( $orig_sum_cost - ($orig_diff - $deleted_diff) );\n }\n}", "language": "Perl", "metadata": {"date": 1522030881, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03401.html", "problem_id": "p03401", "resource_group": "low_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/Perl/s019552037.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s019552037", "user_id": "u376692089"}, "prompt_components": {"gold_output": "12\n8\n10\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nuse Data::Dumper qw( Dumper );\nuse List::Util qw( sum );\nsub line { chomp(my $str = ); $str }\nsub split_line { split / /, line }\nmy $spot_num = line;\nmy @points = (0, split_line, 0);\nmy $orig_sum_cost = sum map { abs($points[$_ - 1] - $points[$_]) } 1 .. $#points;\nfor my $spot (1 .. $#points - 1) {\n my ($cost, $left_cost, $right_cost) = ($points[$spot], $points[$spot - 1], $points[$spot + 1]);\n # 単調減少or増加 \n if ( ($left_cost <= $cost && $cost <= $right_cost) || ($left_cost >= $cost && $cost >= $right_cost) ) {\n say $orig_sum_cost;\n } else {\n my $orig_diff = abs($left_cost - $cost) + abs($cost - $right_cost);\n my $deleted_diff = abs($left_cost - $right_cost);\n say( $orig_sum_cost - ($orig_diff - $deleted_diff) );\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 786, "cpu_time_ms": 180, "memory_kb": 22268}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s821585292", "group_id": "codeNet:p03401", "input_text": "#!/usr/bin/perl\n\nmy ($n) = map {$_ - 0} split(/\\s+/o,);\nmy @a = map {$_ - 0} split(/\\s+/o,);\n\nmy $prev = 0;\nmy $acost = 0;\nfor(my $i=0;$i<$n;$i++){\n $acost += abs($prev - $a[$i]);\n $prev = $a[$i];\n}\n$acost += abs($prev);\n\nfor(my $i=0;$i<$n;$i++){\n my $dif = 0;\n if( $i==0 ){\n $dif = -( abs($a[0]) + abs($a[0]-$a[1]) ) + abs($a[1]);\n } elsif( $i==$n-1 ){\n $dif = -( abs($a[$i-1]-$a[$i]) + abs($a[$i]) ) + abs($a[$i-1]);\n } else {\n $dif = -( abs($a[$i-1]-$a[$i]) + abs($a[$i]-$a[$i+1]) ) + abs($a[$i-1]-$a[$i+1]);\n }\n my $r = $acost + $dif;\n print \"$r\\n\";\n}\n\nexit(0);\n", "language": "Perl", "metadata": {"date": 1522027488, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03401.html", "problem_id": "p03401", "resource_group": "low_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/Perl/s821585292.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s821585292", "user_id": "u750383873"}, "prompt_components": {"gold_output": "12\n8\n10\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($n) = map {$_ - 0} split(/\\s+/o,);\nmy @a = map {$_ - 0} split(/\\s+/o,);\n\nmy $prev = 0;\nmy $acost = 0;\nfor(my $i=0;$i<$n;$i++){\n $acost += abs($prev - $a[$i]);\n $prev = $a[$i];\n}\n$acost += abs($prev);\n\nfor(my $i=0;$i<$n;$i++){\n my $dif = 0;\n if( $i==0 ){\n $dif = -( abs($a[0]) + abs($a[0]-$a[1]) ) + abs($a[1]);\n } elsif( $i==$n-1 ){\n $dif = -( abs($a[$i-1]-$a[$i]) + abs($a[$i]) ) + abs($a[$i-1]);\n } else {\n $dif = -( abs($a[$i-1]-$a[$i]) + abs($a[$i]-$a[$i+1]) ) + abs($a[$i-1]-$a[$i+1]);\n }\n my $r = $acost + $dif;\n print \"$r\\n\";\n}\n\nexit(0);\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 598, "cpu_time_ms": 190, "memory_kb": 21068}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s428501984", "group_id": "codeNet:p03403", "input_text": "$e='(\\S* )'x3;<>;$x+=abs-$p+($p=$_)for@_=glob<>.0;\" @_ \"=~/ $e(?{print$x-abs($3-$2)-abs($2-$1)+abs$3-$1,$\"})^/", "language": "Perl", "metadata": {"date": 1574816413, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03403.html", "problem_id": "p03403", "resource_group": "low_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/Perl/s428501984.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s428501984", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n8\n10\n", "input_to_evaluate": "$e='(\\S* )'x3;<>;$x+=abs-$p+($p=$_)for@_=glob<>.0;\" @_ \"=~/ $e(?{print$x-abs($3-$2)-abs($2-$1)+abs$3-$1,$\"})^/", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 395, "memory_kb": 27400}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s214909643", "group_id": "codeNet:p03407", "input_text": "<>!~/ .* /;print$`+$&-$'<0?No:Yes", "language": "Perl", "metadata": {"date": 1550804053, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03407.html", "problem_id": "p03407", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03407/input.txt", "sample_output_relpath": "derived/input_output/data/p03407/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03407/Perl/s214909643.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s214909643", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "<>!~/ .* /;print$`+$&-$'<0?No:Yes", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "sample_input": "50 100 120\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03407", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s422626826", "group_id": "codeNet:p03407", "input_text": "@a = split(/ /,<>);\nif(@a[0] + @a[1] >= @a[2]){\n print \"Yes\\n\";\n}else{\n print \"No\\n\";\n}", "language": "Perl", "metadata": {"date": 1521741827, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03407.html", "problem_id": "p03407", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03407/input.txt", "sample_output_relpath": "derived/input_output/data/p03407/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03407/Perl/s422626826.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s422626826", "user_id": "u584355711"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "@a = split(/ /,<>);\nif(@a[0] + @a[1] >= @a[2]){\n print \"Yes\\n\";\n}else{\n print \"No\\n\";\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "sample_input": "50 100 120\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03407", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s280404974", "group_id": "codeNet:p03407", "input_text": "$a = <> + 0;\n$b = <> + 0;\n$c = <> + 0;\nif($a + $b >= $c){\n print \"Yes\\n\";\n}else{\n print \"No\\n\";\n}", "language": "Perl", "metadata": {"date": 1521737453, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03407.html", "problem_id": "p03407", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03407/input.txt", "sample_output_relpath": "derived/input_output/data/p03407/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03407/Perl/s280404974.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s280404974", "user_id": "u584355711"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$a = <> + 0;\n$b = <> + 0;\n$c = <> + 0;\nif($a + $b >= $c){\n print \"Yes\\n\";\n}else{\n print \"No\\n\";\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "sample_input": "50 100 120\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03407", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 101, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s552031225", "group_id": "codeNet:p03408", "input_text": "my $a, $b;\nmy %aa, %bb;\n\n$a = <>;\nfor (1..$a) {\n my $str = <>;\n chomp $str;\n $aa{$str}++;\n}\n\n$b = <>;\nfor (1..$a) {\n my $str = <>;\n chomp $str;\n $bb{$str}++;\n}\n\nmy $max = 0;\nforeach (keys %aa) {\n my $tmp = $aa{$_} - $bb{$_};\n $max = $max < $tmp\n ? $tmp\n : $max\n ;\n}\n\nprint $max;", "language": "Perl", "metadata": {"date": 1522974739, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03408.html", "problem_id": "p03408", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03408/input.txt", "sample_output_relpath": "derived/input_output/data/p03408/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03408/Perl/s552031225.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s552031225", "user_id": "u314301316"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my $a, $b;\nmy %aa, %bb;\n\n$a = <>;\nfor (1..$a) {\n my $str = <>;\n chomp $str;\n $aa{$str}++;\n}\n\n$b = <>;\nfor (1..$a) {\n my $str = <>;\n chomp $str;\n $bb{$str}++;\n}\n\nmy $max = 0;\nforeach (keys %aa) {\n my $tmp = $aa{$_} - $bb{$_};\n $max = $max < $tmp\n ? $tmp\n : $max\n ;\n}\n\nprint $max;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "sample_input": "3\napple\norange\napple\n1\ngrape\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03408", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 323, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s427593581", "group_id": "codeNet:p03408", "input_text": "use List::Util qw/first/;\n$hash{<>}++ for (0..<>-1);\n$hash{<>}-- for (0..<>-1);\n\n$count = first { $_ } map { $hash{$_} } sort { $hash{$b} <=> $hash{$a} } keys %hash;\nprint $count > 0 ? $count : 0;\n", "language": "Perl", "metadata": {"date": 1522973696, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03408.html", "problem_id": "p03408", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03408/input.txt", "sample_output_relpath": "derived/input_output/data/p03408/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03408/Perl/s427593581.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s427593581", "user_id": "u698551366"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use List::Util qw/first/;\n$hash{<>}++ for (0..<>-1);\n$hash{<>}-- for (0..<>-1);\n\n$count = first { $_ } map { $hash{$_} } sort { $hash{$b} <=> $hash{$a} } keys %hash;\nprint $count > 0 ? $count : 0;\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "sample_input": "3\napple\norange\napple\n1\ngrape\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03408", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 197, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s725759451", "group_id": "codeNet:p03409", "input_text": "$n = <>;chomp $n;\npush @red, [ split / /, <> ] for (0..$n-1);\n@red = sort { $a->[0] <=> $b->[0] or $a->[1] <=> $b->[1] } @red;\n\npush @blue, [ split / /, <> ] for (0..$n-1);\n@blue = sort { $a->[0] <=> $b->[0] or $a->[1] <=> $b->[1] } @blue;\n\n$count = 0;\n%sumi;\nfor my $b (@blue) {\n for my $r (@red) {\n if (!$sumi{$r->[0]} && ($b->[0] > $r->[0]) && ($b->[1] > $r->[1])) {\n $sumi{$r->[0]} = 1;\n $count++;\n last;\n }\n next;\n }\n}\n\nprint $count;\n", "language": "Perl", "metadata": {"date": 1522974681, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03409.html", "problem_id": "p03409", "resource_group": "low_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/Perl/s725759451.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s725759451", "user_id": "u698551366"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$n = <>;chomp $n;\npush @red, [ split / /, <> ] for (0..$n-1);\n@red = sort { $a->[0] <=> $b->[0] or $a->[1] <=> $b->[1] } @red;\n\npush @blue, [ split / /, <> ] for (0..$n-1);\n@blue = sort { $a->[0] <=> $b->[0] or $a->[1] <=> $b->[1] } @blue;\n\n$count = 0;\n%sumi;\nfor my $b (@blue) {\n for my $r (@red) {\n if (!$sumi{$r->[0]} && ($b->[0] > $r->[0]) && ($b->[1] > $r->[1])) {\n $sumi{$r->[0]} = 1;\n $count++;\n last;\n }\n next;\n }\n}\n\nprint $count;\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 499, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s541110600", "group_id": "codeNet:p03411", "input_text": "my@R=sort -*.[1],get.words xx get;say +grep {try {@R[@R.first:{.[0]>$^a[0]&&.[1]>$^a[1]},:k]=3e2}},(+<>.words).sort", "language": "Perl", "metadata": {"date": 1538122186, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03411.html", "problem_id": "p03411", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03411/input.txt", "sample_output_relpath": "derived/input_output/data/p03411/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03411/Perl/s541110600.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s541110600", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my@R=sort -*.[1],get.words xx get;say +grep {try {@R[@R.first:{.[0]>$^a[0]&&.[1]>$^a[1]},:k]=3e2}},(+<>.words).sort", "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": "p03411", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1230, "memory_kb": 88452}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s366113723", "group_id": "codeNet:p03411", "input_text": "my@R=sort -*.[1],get.words xx get;say +grep {($!=@R.first:{.[0]>$^a[0]&&.[1]>$^a[1]},:k).isa(Int)&&(@R[$!]=3e2)},(+<>.words).sort", "language": "Perl", "metadata": {"date": 1538121550, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03411.html", "problem_id": "p03411", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03411/input.txt", "sample_output_relpath": "derived/input_output/data/p03411/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03411/Perl/s366113723.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s366113723", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my@R=sort -*.[1],get.words xx get;say +grep {($!=@R.first:{.[0]>$^a[0]&&.[1]>$^a[1]},:k).isa(Int)&&(@R[$!]=3e2)},(+<>.words).sort", "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": "p03411", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1225, "memory_kb": 87560}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s864544190", "group_id": "codeNet:p03413", "input_text": "$N+=<>;\n@a=(_,glob<>);\n$s[$_%2]+=$-=$a[$_]for 1..$N;\n$s=$s[$p=$s[1]>$s[0]];\nfor($i=$N;$i;--$i){\n\tif($i%2!=$p&&$a[$i-1]>0||$i%2==$p&&$a[$i]<0){\n\t\tpush@o,$i;\n\t\t$N-=$N==$i||$i==1?1:2\n\t}\n}\nif($N!=1){\n\tpush@o,1\n}\n$,=$/;\nprint$s,@o+0,@o\n", "language": "Perl", "metadata": {"date": 1521339846, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03413.html", "problem_id": "p03413", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03413/input.txt", "sample_output_relpath": "derived/input_output/data/p03413/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03413/Perl/s864544190.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s864544190", "user_id": "u283869437"}, "prompt_components": {"gold_output": "11\n3\n1\n4\n2\n", "input_to_evaluate": "$N+=<>;\n@a=(_,glob<>);\n$s[$_%2]+=$-=$a[$_]for 1..$N;\n$s=$s[$p=$s[1]>$s[0]];\nfor($i=$N;$i;--$i){\n\tif($i%2!=$p&&$a[$i-1]>0||$i%2==$p&&$a[$i]<0){\n\t\tpush@o,$i;\n\t\t$N-=$N==$i||$i==1?1:2\n\t}\n}\nif($N!=1){\n\tpush@o,1\n}\n$,=$/;\nprint$s,@o+0,@o\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou have an integer sequence of length N: a_1, a_2, ..., a_N.\n\nYou repeatedly perform the following operation until the length of the sequence becomes 1:\n\nFirst, choose an element of the sequence.\n\nIf that element is at either end of the sequence, delete the element.\n\nIf that element is not at either end of the sequence, replace the element with the sum of the two elements that are adjacent to it. Then, delete those two elements.\n\nYou would like to maximize the final element that remains in the sequence.\n\nFind the maximum possible value of the final element, and the way to achieve it.\n\nConstraints\n\nAll input values are integers.\n\n2 \\leq N \\leq 1000\n\n|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\nIn the first line, print the maximum possible value of the final element in the sequence.\n\nIn the second line, print the number of operations that you perform.\n\nIn the (2+i)-th line, if the element chosen in the i-th operation is the x-th element from the left in the sequence at that moment, print x.\n\nIf there are multiple ways to achieve the maximum value of the final element, any of them may be printed.\n\nSample Input 1\n\n5\n1 4 3 7 5\n\nSample Output 1\n\n11\n3\n1\n4\n2\n\nThe sequence would change as follows:\n\nAfter the first operation: 4, 3, 7, 5\n\nAfter the second operation: 4, 3, 7\n\nAfter the third operation: 11(4+7)\n\nSample Input 2\n\n4\n100 100 -1 100\n\nSample Output 2\n\n200\n2\n3\n1\n\nAfter the first operation: 100, 200(100+100)\n\nAfter the second operation: 200\n\nSample Input 3\n\n6\n-1 -2 -3 1 2 3\n\nSample Output 3\n\n4\n3\n2\n1\n2\n\nAfter the first operation: -4, 1, 2, 3\n\nAfter the second operation: 1, 2, 3\n\nAfter the third operation: 4\n\nSample Input 4\n\n9\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n5000000000\n4\n2\n2\n2\n2", "sample_input": "5\n1 4 3 7 5\n"}, "reference_outputs": ["11\n3\n1\n4\n2\n"], "source_document_id": "p03413", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou have an integer sequence of length N: a_1, a_2, ..., a_N.\n\nYou repeatedly perform the following operation until the length of the sequence becomes 1:\n\nFirst, choose an element of the sequence.\n\nIf that element is at either end of the sequence, delete the element.\n\nIf that element is not at either end of the sequence, replace the element with the sum of the two elements that are adjacent to it. Then, delete those two elements.\n\nYou would like to maximize the final element that remains in the sequence.\n\nFind the maximum possible value of the final element, and the way to achieve it.\n\nConstraints\n\nAll input values are integers.\n\n2 \\leq N \\leq 1000\n\n|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\nIn the first line, print the maximum possible value of the final element in the sequence.\n\nIn the second line, print the number of operations that you perform.\n\nIn the (2+i)-th line, if the element chosen in the i-th operation is the x-th element from the left in the sequence at that moment, print x.\n\nIf there are multiple ways to achieve the maximum value of the final element, any of them may be printed.\n\nSample Input 1\n\n5\n1 4 3 7 5\n\nSample Output 1\n\n11\n3\n1\n4\n2\n\nThe sequence would change as follows:\n\nAfter the first operation: 4, 3, 7, 5\n\nAfter the second operation: 4, 3, 7\n\nAfter the third operation: 11(4+7)\n\nSample Input 2\n\n4\n100 100 -1 100\n\nSample Output 2\n\n200\n2\n3\n1\n\nAfter the first operation: 100, 200(100+100)\n\nAfter the second operation: 200\n\nSample Input 3\n\n6\n-1 -2 -3 1 2 3\n\nSample Output 3\n\n4\n3\n2\n1\n2\n\nAfter the first operation: -4, 1, 2, 3\n\nAfter the second operation: 1, 2, 3\n\nAfter the third operation: 4\n\nSample Input 4\n\n9\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n5000000000\n4\n2\n2\n2\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 231, "cpu_time_ms": 9, "memory_kb": 1152}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s902480219", "group_id": "codeNet:p03415", "input_text": "for(1..3){@a=split//,<>;print$a[$i++]}", "language": "Perl", "metadata": {"date": 1562189339, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03415.html", "problem_id": "p03415", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03415/input.txt", "sample_output_relpath": "derived/input_output/data/p03415/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03415/Perl/s902480219.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s902480219", "user_id": "u573154728"}, "prompt_components": {"gold_output": "abc\n", "input_to_evaluate": "for(1..3){@a=split//,<>;print$a[$i++]}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a 3×3 square grid, where each square contains a lowercase English letters.\nThe letter in the square at the i-th row from the top and j-th column from the left is c_{ij}.\n\nPrint the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nConstraints\n\nInput consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{11}c_{12}c_{13}\nc_{21}c_{22}c_{23}\nc_{31}c_{32}c_{33}\n\nOutput\n\nPrint the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nSample Input 1\n\nant\nobe\nrec\n\nSample Output 1\n\nabc\n\nThe letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.\n\nSample Input 2\n\nedu\ncat\nion\n\nSample Output 2\n\nean", "sample_input": "ant\nobe\nrec\n"}, "reference_outputs": ["abc\n"], "source_document_id": "p03415", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a 3×3 square grid, where each square contains a lowercase English letters.\nThe letter in the square at the i-th row from the top and j-th column from the left is c_{ij}.\n\nPrint the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nConstraints\n\nInput consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{11}c_{12}c_{13}\nc_{21}c_{22}c_{23}\nc_{31}c_{32}c_{33}\n\nOutput\n\nPrint the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nSample Input 1\n\nant\nobe\nrec\n\nSample Output 1\n\nabc\n\nThe letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.\n\nSample Input 2\n\nedu\ncat\nion\n\nSample Output 2\n\nean", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s601166076", "group_id": "codeNet:p03415", "input_text": "print+(`dd`=~/./g)[0,4,8]", "language": "Perl", "metadata": {"date": 1520824253, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03415.html", "problem_id": "p03415", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03415/input.txt", "sample_output_relpath": "derived/input_output/data/p03415/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03415/Perl/s601166076.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s601166076", "user_id": "u283869437"}, "prompt_components": {"gold_output": "abc\n", "input_to_evaluate": "print+(`dd`=~/./g)[0,4,8]", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a 3×3 square grid, where each square contains a lowercase English letters.\nThe letter in the square at the i-th row from the top and j-th column from the left is c_{ij}.\n\nPrint the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nConstraints\n\nInput consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{11}c_{12}c_{13}\nc_{21}c_{22}c_{23}\nc_{31}c_{32}c_{33}\n\nOutput\n\nPrint the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nSample Input 1\n\nant\nobe\nrec\n\nSample Output 1\n\nabc\n\nThe letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.\n\nSample Input 2\n\nedu\ncat\nion\n\nSample Output 2\n\nean", "sample_input": "ant\nobe\nrec\n"}, "reference_outputs": ["abc\n"], "source_document_id": "p03415", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a 3×3 square grid, where each square contains a lowercase English letters.\nThe letter in the square at the i-th row from the top and j-th column from the left is c_{ij}.\n\nPrint the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nConstraints\n\nInput consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{11}c_{12}c_{13}\nc_{21}c_{22}c_{23}\nc_{31}c_{32}c_{33}\n\nOutput\n\nPrint the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nSample Input 1\n\nant\nobe\nrec\n\nSample Output 1\n\nabc\n\nThe letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.\n\nSample Input 2\n\nedu\ncat\nion\n\nSample Output 2\n\nean", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 25, "cpu_time_ms": 239, "memory_kb": 824}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s633469833", "group_id": "codeNet:p03416", "input_text": "$/=words;say +grep {$_~~.flip},+$0..$1", "language": "Perl", "metadata": {"date": 1594460095, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03416.html", "problem_id": "p03416", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03416/input.txt", "sample_output_relpath": "derived/input_output/data/p03416/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03416/Perl/s633469833.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s633469833", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$/=words;say +grep {$_~~.flip},+$0..$1", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "sample_input": "11009 11332\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03416", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 431, "memory_kb": 98608}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s110991706", "group_id": "codeNet:p03416", "input_text": "print<>=~$\"*map$_=~reverse,$`..$'", "language": "Perl", "metadata": {"date": 1561548438, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03416.html", "problem_id": "p03416", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03416/input.txt", "sample_output_relpath": "derived/input_output/data/p03416/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03416/Perl/s110991706.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s110991706", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "print<>=~$\"*map$_=~reverse,$`..$'", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "sample_input": "11009 11332\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03416", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 184, "memory_kb": 8960}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s511295606", "group_id": "codeNet:p03416", "input_text": "sub isParaStr{\n my $str = $_[0];\n my $Lh = int length($str)/2;\n substr($str, 0, $Lh) eq reverse substr($str, -$Lh);\n}\n\nsub main{\n (my $s, my $e) = split(/ /, );\n my $cnt = 0;\n for (; $s <= $e; $s++){\n if (&isParaStr($s)){\n $cnt++;\n }\n } \n\n print $cnt.\"\\n\";\n}\n\n&main;", "language": "Perl", "metadata": {"date": 1522961128, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03416.html", "problem_id": "p03416", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03416/input.txt", "sample_output_relpath": "derived/input_output/data/p03416/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03416/Perl/s511295606.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s511295606", "user_id": "u240502040"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "sub isParaStr{\n my $str = $_[0];\n my $Lh = int length($str)/2;\n substr($str, 0, $Lh) eq reverse substr($str, -$Lh);\n}\n\nsub main{\n (my $s, my $e) = split(/ /, );\n my $cnt = 0;\n for (; $s <= $e; $s++){\n if (&isParaStr($s)){\n $cnt++;\n }\n } \n\n print $cnt.\"\\n\";\n}\n\n&main;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "sample_input": "11009 11332\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03416", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 316, "cpu_time_ms": 60, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s411003098", "group_id": "codeNet:p03419", "input_text": "say abs [*] get.words»-»2", "language": "Perl", "metadata": {"date": 1538115944, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03419.html", "problem_id": "p03419", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03419/input.txt", "sample_output_relpath": "derived/input_output/data/p03419/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03419/Perl/s411003098.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s411003098", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "say abs [*] get.words»-»2", "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": "p03419", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 27, "cpu_time_ms": 119, "memory_kb": 47900}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s983690688", "group_id": "codeNet:p03419", "input_text": "print$/=$\",abs(<>-2)*abs(<>-2)", "language": "Perl", "metadata": {"date": 1520822055, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03419.html", "problem_id": "p03419", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03419/input.txt", "sample_output_relpath": "derived/input_output/data/p03419/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03419/Perl/s983690688.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s983690688", "user_id": "u287015418"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "print$/=$\",abs(<>-2)*abs(<>-2)", "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": "p03419", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s487178279", "group_id": "codeNet:p03423", "input_text": "sub main{\n my $N = ;\n print int($N/3);\n}\n\n&main;", "language": "Perl", "metadata": {"date": 1522961776, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03423.html", "problem_id": "p03423", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03423/input.txt", "sample_output_relpath": "derived/input_output/data/p03423/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03423/Perl/s487178279.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s487178279", "user_id": "u240502040"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "sub main{\n my $N = ;\n print int($N/3);\n}\n\n&main;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N students in a school.\n\nWe will divide these students into some groups, and in each group they will discuss some themes.\n\nYou think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible.\n\nDivide the students so that the number of groups consisting of three or more students is maximized.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf you can form at most x groups consisting of three or more students, print x.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nFor example, you can form a group of three students and another of five students.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0\n\nSometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.\n\nSample Input 3\n\n9\n\nSample Output 3\n\n3", "sample_input": "8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03423", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N students in a school.\n\nWe will divide these students into some groups, and in each group they will discuss some themes.\n\nYou think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible.\n\nDivide the students so that the number of groups consisting of three or more students is maximized.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf you can form at most x groups consisting of three or more students, print x.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nFor example, you can form a group of three students and another of five students.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0\n\nSometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.\n\nSample Input 3\n\n9\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s879974751", "group_id": "codeNet:p03424", "input_text": "<>;print<>=~Y?Four:Three", "language": "Perl", "metadata": {"date": 1561557269, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03424.html", "problem_id": "p03424", "resource_group": "low_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/Perl/s879974751.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s879974751", "user_id": "u573154728"}, "prompt_components": {"gold_output": "Four\n", "input_to_evaluate": "<>;print<>=~Y?Four: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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 24, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s703519283", "group_id": "codeNet:p03424", "input_text": "print<>-grep($$_++,glob<>)>3?Four:Three", "language": "Perl", "metadata": {"date": 1520216844, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03424.html", "problem_id": "p03424", "resource_group": "low_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/Perl/s703519283.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s703519283", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Four\n", "input_to_evaluate": "print<>-grep($$_++,glob<>)>3?Four: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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s949004802", "group_id": "codeNet:p03425", "input_text": "get;say sum map {[*] $_},lines>>.ord.Bag{77,65,82,67,72}.combinations: 3", "language": "Perl", "metadata": {"date": 1594459515, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03425.html", "problem_id": "p03425", "resource_group": "low_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/Perl/s949004802.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s949004802", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get;say sum map {[*] $_},lines>>.ord.Bag{77,65,82,67,72}.combinations: 3", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 419, "memory_kb": 100976}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s352218368", "group_id": "codeNet:p03426", "input_text": "($H,$W,$D)=glob<>;\n$#x=$W;$#y=$H;\nfor$h(0..$H-1){\n @l=glob<>;\n for(0..$W-1){\n $x[$l[$_]]=$_;\n $y[$l[$_]]=$h\n }\n}\n$c[$_]=($_<=$D)?0:$c[$_-$D]+abs($x[$_]-$x[$_-$D])+abs($y[$_]-$y[$_-$D])for(1..$H*$W);\n$Q=<>;\nprint<>!~$\",$c[$']-$c[$`],\"\\n\" for(1..$Q)", "language": "Perl", "metadata": {"date": 1561559519, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03426.html", "problem_id": "p03426", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03426/input.txt", "sample_output_relpath": "derived/input_output/data/p03426/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03426/Perl/s352218368.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s352218368", "user_id": "u573154728"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "($H,$W,$D)=glob<>;\n$#x=$W;$#y=$H;\nfor$h(0..$H-1){\n @l=glob<>;\n for(0..$W-1){\n $x[$l[$_]]=$_;\n $y[$l[$_]]=$h\n }\n}\n$c[$_]=($_<=$D)?0:$c[$_-$D]+abs($x[$_]-$x[$_-$D])+abs($y[$_]-$y[$_-$D])for(1..$H*$W);\n$Q=<>;\nprint<>!~$\",$c[$']-$c[$`],\"\\n\" for(1..$Q)", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. The square at the i-th row and the j-th column will be called Square (i,j).\n\nThe integers from 1 through H×W are written throughout the grid, and the integer written in Square (i,j) is A_{i,j}.\n\nYou, a magical girl, can teleport a piece placed on Square (i,j) to Square (x,y) by consuming |x-i|+|y-j| magic points.\n\nYou now have to take Q practical tests of your ability as a magical girl.\n\nThe i-th test will be conducted as follows:\n\nInitially, a piece is placed on the square where the integer L_i is written.\n\nLet x be the integer written in the square occupied by the piece. Repeatedly move the piece to the square where the integer x+D is written, as long as x is not R_i. The test ends when x=R_i.\n\nHere, it is guaranteed that R_i-L_i is a multiple of D.\n\nFor each test, find the sum of magic points consumed during that test.\n\nConstraints\n\n1 \\leq H,W \\leq 300\n\n1 \\leq D \\leq H×W\n\n1 \\leq A_{i,j} \\leq H×W\n\nA_{i,j} \\neq A_{x,y} ((i,j) \\neq (x,y))\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq H×W\n\n(R_i-L_i) is a multiple of D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W D\nA_{1,1} A_{1,2} ... A_{1,W}\n:\nA_{H,1} A_{H,2} ... A_{H,W}\nQ\nL_1 R_1\n:\nL_Q R_Q\n\nOutput\n\nFor each test, print the sum of magic points consumed during that test.\n\nOutput should be in the order the tests are conducted.\n\nSample Input 1\n\n3 3 2\n1 4 3\n2 5 7\n8 9 6\n1\n4 8\n\nSample Output 1\n\n5\n\n4 is written in Square (1,2).\n\n6 is written in Square (3,3).\n\n8 is written in Square (3,1).\n\nThus, the sum of magic points consumed during the first test is (|3-1|+|3-2|)+(|3-3|+|1-3|)=5.\n\nSample Input 2\n\n4 2 3\n3 7\n1 4\n5 2\n6 8\n2\n2 2\n2 2\n\nSample Output 2\n\n0\n0\n\nNote that there may be a test where the piece is not moved at all, and there may be multiple identical tests.\n\nSample Input 3\n\n5 5 4\n13 25 7 15 17\n16 22 20 2 9\n14 11 12 1 19\n10 6 23 8 18\n3 21 5 24 4\n3\n13 13\n2 10\n13 13\n\nSample Output 3\n\n0\n5\n0", "sample_input": "3 3 2\n1 4 3\n2 5 7\n8 9 6\n1\n4 8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03426", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. The square at the i-th row and the j-th column will be called Square (i,j).\n\nThe integers from 1 through H×W are written throughout the grid, and the integer written in Square (i,j) is A_{i,j}.\n\nYou, a magical girl, can teleport a piece placed on Square (i,j) to Square (x,y) by consuming |x-i|+|y-j| magic points.\n\nYou now have to take Q practical tests of your ability as a magical girl.\n\nThe i-th test will be conducted as follows:\n\nInitially, a piece is placed on the square where the integer L_i is written.\n\nLet x be the integer written in the square occupied by the piece. Repeatedly move the piece to the square where the integer x+D is written, as long as x is not R_i. The test ends when x=R_i.\n\nHere, it is guaranteed that R_i-L_i is a multiple of D.\n\nFor each test, find the sum of magic points consumed during that test.\n\nConstraints\n\n1 \\leq H,W \\leq 300\n\n1 \\leq D \\leq H×W\n\n1 \\leq A_{i,j} \\leq H×W\n\nA_{i,j} \\neq A_{x,y} ((i,j) \\neq (x,y))\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq H×W\n\n(R_i-L_i) is a multiple of D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W D\nA_{1,1} A_{1,2} ... A_{1,W}\n:\nA_{H,1} A_{H,2} ... A_{H,W}\nQ\nL_1 R_1\n:\nL_Q R_Q\n\nOutput\n\nFor each test, print the sum of magic points consumed during that test.\n\nOutput should be in the order the tests are conducted.\n\nSample Input 1\n\n3 3 2\n1 4 3\n2 5 7\n8 9 6\n1\n4 8\n\nSample Output 1\n\n5\n\n4 is written in Square (1,2).\n\n6 is written in Square (3,3).\n\n8 is written in Square (3,1).\n\nThus, the sum of magic points consumed during the first test is (|3-1|+|3-2|)+(|3-3|+|1-3|)=5.\n\nSample Input 2\n\n4 2 3\n3 7\n1 4\n5 2\n6 8\n2\n2 2\n2 2\n\nSample Output 2\n\n0\n0\n\nNote that there may be a test where the piece is not moved at all, and there may be multiple identical tests.\n\nSample Input 3\n\n5 5 4\n13 25 7 15 17\n16 22 20 2 9\n14 11 12 1 19\n10 6 23 8 18\n3 21 5 24 4\n3\n13 13\n2 10\n13 13\n\nSample Output 3\n\n0\n5\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 572, "memory_kb": 10496}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s286486440", "group_id": "codeNet:p03427", "input_text": "#!/usr/bin/perl\n\n( my $n = ) =~ s/[\\x00-\\x20]+$//io;\n\nif( length($n) > 1 and $n !~ /^\\d9+$/o ){\n $n =~ /^\\d/;\n my $d1 = $&;\n my $d2 = $';\n $n = ( $d1 - 1 ) . ('9' x length($d2));\n}\nmy @a = split('',$n);\nmy $tot = 0;\n$tot += $_ foreach @a;\nprint \"$tot\\n\";\n\nexit(0);\n", "language": "Perl", "metadata": {"date": 1522373016, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03427.html", "problem_id": "p03427", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03427/input.txt", "sample_output_relpath": "derived/input_output/data/p03427/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03427/Perl/s286486440.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s286486440", "user_id": "u750383873"}, "prompt_components": {"gold_output": "18\n", "input_to_evaluate": "#!/usr/bin/perl\n\n( my $n = ) =~ s/[\\x00-\\x20]+$//io;\n\nif( length($n) > 1 and $n !~ /^\\d9+$/o ){\n $n =~ /^\\d/;\n my $d1 = $&;\n my $d2 = $';\n $n = ( $d1 - 1 ) . ('9' x length($d2));\n}\nmy @a = split('',$n);\nmy $tot = 0;\n$tot += $_ foreach @a;\nprint \"$tot\\n\";\n\nexit(0);\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nConstraints\n\n1\\leq N \\leq 10^{16}\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 maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nSample Input 1\n\n100\n\nSample Output 1\n\n18\n\nFor example, the sum of the digits in 99 is 18, which turns out to be the maximum value.\n\nSample Input 2\n\n9995\n\nSample Output 2\n\n35\n\nFor example, the sum of the digits in 9989 is 35, which turns out to be the maximum value.\n\nSample Input 3\n\n3141592653589793\n\nSample Output 3\n\n137", "sample_input": "100\n"}, "reference_outputs": ["18\n"], "source_document_id": "p03427", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nConstraints\n\n1\\leq N \\leq 10^{16}\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 maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nSample Input 1\n\n100\n\nSample Output 1\n\n18\n\nFor example, the sum of the digits in 99 is 18, which turns out to be the maximum value.\n\nSample Input 2\n\n9995\n\nSample Output 2\n\n35\n\nFor example, the sum of the digits in 9989 is 35, which turns out to be the maximum value.\n\nSample Input 3\n\n3141592653589793\n\nSample Output 3\n\n137", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 277, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s782851555", "group_id": "codeNet:p03428", "input_text": "<>;($x,$y)=glob,printf\"%f\n\",sort{$b<=>$a}0,map.159154*(-$~+($~=$_))-.5,(@b=sort{$a-$b}map+(/ /*atan2$'-$y,$`-$x)x!/^$x $y/,@a),\"@b\"+6.2832for@a=<>", "language": "Perl", "metadata": {"date": 1551601304, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03428.html", "problem_id": "p03428", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03428/input.txt", "sample_output_relpath": "derived/input_output/data/p03428/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03428/Perl/s782851555.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s782851555", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0.5\n0.5\n", "input_to_evaluate": "<>;($x,$y)=glob,printf\"%f\n\",sort{$b<=>$a}0,map.159154*(-$~+($~=$_))-.5,(@b=sort{$a-$b}map+(/ /*atan2$'-$y,$`-$x)x!/^$x $y/,@a),\"@b\"+6.2832for@a=<>", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere are N holes in a two-dimensional plane. The coordinates of the i-th hole are (x_i,y_i).\n\nLet R=10^{10^{10^{10}}}. Ringo performs the following operation:\n\nRandomly choose a point from the interior of a circle of radius R centered at the origin, and put Snuke there. Snuke will move to the hole with the smallest Euclidean distance from the point, and fall into that hole. If there are multiple such holes, the hole with the smallest index will be chosen.\n\nFor every i (1 \\leq i \\leq N), find the probability that Snuke falls into the i-th hole.\n\nHere, the operation of randomly choosing a point from the interior of a circle of radius R is defined as follows:\n\nPick two real numbers x and y independently according to uniform distribution on [-R,R].\n\nIf x^2+y^2\\leq R^2, the point (x,y) is chosen. Otherwise, repeat picking the real numbers x,y until the condition is met.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n|x_i|,|y_i| \\leq 10^6(1\\leq i\\leq N)\n\nAll given points are pairwise distinct.\n\nAll input values 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 N real numbers. The i-th real number must represent the probability that Snuke falls into the i-th hole.\n\nThe output will be judged correct when, for all output values, the absolute or relative error is at most 10^{-5}.\n\nSample Input 1\n\n2\n0 0\n1 1\n\nSample Output 1\n\n0.5\n0.5\n\nIf Ringo put Snuke in the region x+y\\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.5.\nOtherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.5.\n\nSample Input 2\n\n5\n0 0\n2 8\n4 5\n2 6\n3 10\n\nSample Output 2\n\n0.43160120892732328768\n0.03480224363653196956\n0.13880483535586193855\n0.00000000000000000000\n0.39479171208028279727", "sample_input": "2\n0 0\n1 1\n"}, "reference_outputs": ["0.5\n0.5\n"], "source_document_id": "p03428", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N holes in a two-dimensional plane. The coordinates of the i-th hole are (x_i,y_i).\n\nLet R=10^{10^{10^{10}}}. Ringo performs the following operation:\n\nRandomly choose a point from the interior of a circle of radius R centered at the origin, and put Snuke there. Snuke will move to the hole with the smallest Euclidean distance from the point, and fall into that hole. If there are multiple such holes, the hole with the smallest index will be chosen.\n\nFor every i (1 \\leq i \\leq N), find the probability that Snuke falls into the i-th hole.\n\nHere, the operation of randomly choosing a point from the interior of a circle of radius R is defined as follows:\n\nPick two real numbers x and y independently according to uniform distribution on [-R,R].\n\nIf x^2+y^2\\leq R^2, the point (x,y) is chosen. Otherwise, repeat picking the real numbers x,y until the condition is met.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n|x_i|,|y_i| \\leq 10^6(1\\leq i\\leq N)\n\nAll given points are pairwise distinct.\n\nAll input values 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 N real numbers. The i-th real number must represent the probability that Snuke falls into the i-th hole.\n\nThe output will be judged correct when, for all output values, the absolute or relative error is at most 10^{-5}.\n\nSample Input 1\n\n2\n0 0\n1 1\n\nSample Output 1\n\n0.5\n0.5\n\nIf Ringo put Snuke in the region x+y\\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.5.\nOtherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.5.\n\nSample Input 2\n\n5\n0 0\n2 8\n4 5\n2 6\n3 10\n\nSample Output 2\n\n0.43160120892732328768\n0.03480224363653196956\n0.13880483535586193855\n0.00000000000000000000\n0.39479171208028279727", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 56, "memory_kb": 5248}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s754555926", "group_id": "codeNet:p03428", "input_text": "<>;($x,$y)=glob,printf\"%f\\n\",sort{$b<=>$a}0,map+(-$~+($~=$_))*.1591545-.5,(@b=sort{$a<=>$b}map+(/ /*atan2$'-$y,$`-$x)x!/^$x $y/,@a),\"@b\"+6.2832for@a=<>", "language": "Perl", "metadata": {"date": 1551599392, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03428.html", "problem_id": "p03428", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03428/input.txt", "sample_output_relpath": "derived/input_output/data/p03428/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03428/Perl/s754555926.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s754555926", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0.5\n0.5\n", "input_to_evaluate": "<>;($x,$y)=glob,printf\"%f\\n\",sort{$b<=>$a}0,map+(-$~+($~=$_))*.1591545-.5,(@b=sort{$a<=>$b}map+(/ /*atan2$'-$y,$`-$x)x!/^$x $y/,@a),\"@b\"+6.2832for@a=<>", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere are N holes in a two-dimensional plane. The coordinates of the i-th hole are (x_i,y_i).\n\nLet R=10^{10^{10^{10}}}. Ringo performs the following operation:\n\nRandomly choose a point from the interior of a circle of radius R centered at the origin, and put Snuke there. Snuke will move to the hole with the smallest Euclidean distance from the point, and fall into that hole. If there are multiple such holes, the hole with the smallest index will be chosen.\n\nFor every i (1 \\leq i \\leq N), find the probability that Snuke falls into the i-th hole.\n\nHere, the operation of randomly choosing a point from the interior of a circle of radius R is defined as follows:\n\nPick two real numbers x and y independently according to uniform distribution on [-R,R].\n\nIf x^2+y^2\\leq R^2, the point (x,y) is chosen. Otherwise, repeat picking the real numbers x,y until the condition is met.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n|x_i|,|y_i| \\leq 10^6(1\\leq i\\leq N)\n\nAll given points are pairwise distinct.\n\nAll input values 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 N real numbers. The i-th real number must represent the probability that Snuke falls into the i-th hole.\n\nThe output will be judged correct when, for all output values, the absolute or relative error is at most 10^{-5}.\n\nSample Input 1\n\n2\n0 0\n1 1\n\nSample Output 1\n\n0.5\n0.5\n\nIf Ringo put Snuke in the region x+y\\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.5.\nOtherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.5.\n\nSample Input 2\n\n5\n0 0\n2 8\n4 5\n2 6\n3 10\n\nSample Output 2\n\n0.43160120892732328768\n0.03480224363653196956\n0.13880483535586193855\n0.00000000000000000000\n0.39479171208028279727", "sample_input": "2\n0 0\n1 1\n"}, "reference_outputs": ["0.5\n0.5\n"], "source_document_id": "p03428", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N holes in a two-dimensional plane. The coordinates of the i-th hole are (x_i,y_i).\n\nLet R=10^{10^{10^{10}}}. Ringo performs the following operation:\n\nRandomly choose a point from the interior of a circle of radius R centered at the origin, and put Snuke there. Snuke will move to the hole with the smallest Euclidean distance from the point, and fall into that hole. If there are multiple such holes, the hole with the smallest index will be chosen.\n\nFor every i (1 \\leq i \\leq N), find the probability that Snuke falls into the i-th hole.\n\nHere, the operation of randomly choosing a point from the interior of a circle of radius R is defined as follows:\n\nPick two real numbers x and y independently according to uniform distribution on [-R,R].\n\nIf x^2+y^2\\leq R^2, the point (x,y) is chosen. Otherwise, repeat picking the real numbers x,y until the condition is met.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n|x_i|,|y_i| \\leq 10^6(1\\leq i\\leq N)\n\nAll given points are pairwise distinct.\n\nAll input values 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 N real numbers. The i-th real number must represent the probability that Snuke falls into the i-th hole.\n\nThe output will be judged correct when, for all output values, the absolute or relative error is at most 10^{-5}.\n\nSample Input 1\n\n2\n0 0\n1 1\n\nSample Output 1\n\n0.5\n0.5\n\nIf Ringo put Snuke in the region x+y\\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.5.\nOtherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.5.\n\nSample Input 2\n\n5\n0 0\n2 8\n4 5\n2 6\n3 10\n\nSample Output 2\n\n0.43160120892732328768\n0.03480224363653196956\n0.13880483535586193855\n0.00000000000000000000\n0.39479171208028279727", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 52, "memory_kb": 5248}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s785594007", "group_id": "codeNet:p03429", "input_text": "($H,$W,$A,$B)=glob<>;\n@o=map[('.')x$W],1..$H;\nif($H%2){\n\tfor($x=0;$x+1<$W;$x+=2){\n\t\tif($A){\n\t\t\t$o[-1][$x]='<';\n\t\t\t$o[-1][$x+1]='>';\n\t\t\t--$A\n\t\t}\n\t}\n}\nif($W%2){\n\tfor($y=0;$y+1<$H;$y+=2){\n\t\tif($B){\n\t\t\t$o[$y][-1]='^';\n\t\t\t$o[$y+1][-1]='v';\n\t\t\t--$B\n\t\t}\n\t}\n}\nfor($y=0;$y+1<$H;$y+=2){\n\tfor($x=0;$x+1<$W;$x+=2){\n\t\tif($A>=2){\n\t\t\t$o[$y][$x]='<';\n\t\t\t$o[$y][$x+1]='>';\n\t\t\t$o[$y+1][$x]='<';\n\t\t\t$o[$y+1][$x+1]='>';\n\t\t\t$A-=2\n\t\t}elsif($B>=2){\n\t\t\t$o[$y][$x]='^';\n\t\t\t$o[$y+1][$x]='v';\n\t\t\t$o[$y][$x+1]='^';\n\t\t\t$o[$y+1][$x+1]='v';\n\t\t\t$B-=2\n\t\t}elsif($A){\n\t\t\t$o[$y][$x]='<';\n\t\t\t$o[$y][$x+1]='>';\n\t\t\t--$A\n\t\t}elsif($B){\n\t\t\t$o[$y][$x]='^';\n\t\t\t$o[$y+1][$x]='v';\n\t\t\t--$B\n\t\t}\n\t}\n}\nif($H>=3&&$H%2 && $W>=3&&$W%2 && $A==0 && $B==1){\n\tif($o[-2][-2]eq'.'){\n\t\t$o[-2][-3]='^';\n\t\t$o[-1][-3]='v';$o[-1][-2]='<';$o[-1][-1]='>'\n\t\t--$B\n\t}\n}\nif($A==0 && $B==0){\n\tprint\"YES\\n\";\n\tprint@$_,$/for@o\n}else{\n\tprint\"NO\\n\"\n}\n", "language": "Perl", "metadata": {"date": 1519675900, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03429.html", "problem_id": "p03429", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03429/input.txt", "sample_output_relpath": "derived/input_output/data/p03429/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03429/Perl/s785594007.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s785594007", "user_id": "u283869437"}, "prompt_components": {"gold_output": "YES\n<><>\n^<>^\nv<>v\n", "input_to_evaluate": "($H,$W,$A,$B)=glob<>;\n@o=map[('.')x$W],1..$H;\nif($H%2){\n\tfor($x=0;$x+1<$W;$x+=2){\n\t\tif($A){\n\t\t\t$o[-1][$x]='<';\n\t\t\t$o[-1][$x+1]='>';\n\t\t\t--$A\n\t\t}\n\t}\n}\nif($W%2){\n\tfor($y=0;$y+1<$H;$y+=2){\n\t\tif($B){\n\t\t\t$o[$y][-1]='^';\n\t\t\t$o[$y+1][-1]='v';\n\t\t\t--$B\n\t\t}\n\t}\n}\nfor($y=0;$y+1<$H;$y+=2){\n\tfor($x=0;$x+1<$W;$x+=2){\n\t\tif($A>=2){\n\t\t\t$o[$y][$x]='<';\n\t\t\t$o[$y][$x+1]='>';\n\t\t\t$o[$y+1][$x]='<';\n\t\t\t$o[$y+1][$x+1]='>';\n\t\t\t$A-=2\n\t\t}elsif($B>=2){\n\t\t\t$o[$y][$x]='^';\n\t\t\t$o[$y+1][$x]='v';\n\t\t\t$o[$y][$x+1]='^';\n\t\t\t$o[$y+1][$x+1]='v';\n\t\t\t$B-=2\n\t\t}elsif($A){\n\t\t\t$o[$y][$x]='<';\n\t\t\t$o[$y][$x+1]='>';\n\t\t\t--$A\n\t\t}elsif($B){\n\t\t\t$o[$y][$x]='^';\n\t\t\t$o[$y+1][$x]='v';\n\t\t\t--$B\n\t\t}\n\t}\n}\nif($H>=3&&$H%2 && $W>=3&&$W%2 && $A==0 && $B==1){\n\tif($o[-2][-2]eq'.'){\n\t\t$o[-2][-3]='^';\n\t\t$o[-1][-3]='v';$o[-1][-2]='<';$o[-1][-1]='>'\n\t\t--$B\n\t}\n}\nif($A==0 && $B==0){\n\tprint\"YES\\n\";\n\tprint@$_,$/for@o\n}else{\n\tprint\"NO\\n\"\n}\n", "problem_context": "Score : 900 points\n\nProblem Statement\n\nTakahashi has an N \\times M grid, with N horizontal rows and M vertical columns.\nDetermine if we can place A 1 \\times 2 tiles (1 vertical, 2 horizontal) and B 2 \\times 1 tiles (2 vertical, 1 horizontal) satisfying the following conditions, and construct one arrangement of the tiles if it is possible:\n\nAll the tiles must be placed on the grid.\n\nTiles must not stick out of the grid, and no two different tiles may intersect.\n\nNeither the grid nor the tiles may be rotated.\n\nEvery tile completely covers exactly two squares.\n\nConstraints\n\n1 \\leq N,M \\leq 1000\n\n0 \\leq A,B \\leq 500000\n\nN, M, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M A B\n\nOutput\n\nIf it is impossible to place all the tiles, print NO.\nOtherwise, print the following:\n\nYES\nc_{11}...c_{1M}\n:\nc_{N1}...c_{NM}\n\nHere, c_{ij} must be one of the following characters: ., <, >, ^ and v. Represent an arrangement by using each of these characters as follows:\n\nWhen c_{ij} is ., it indicates that the square at the i-th row and j-th column is empty;\n\nWhen c_{ij} is <, it indicates that the square at the i-th row and j-th column is covered by the left half of a 1 \\times 2 tile;\n\nWhen c_{ij} is >, it indicates that the square at the i-th row and j-th column is covered by the right half of a 1 \\times 2 tile;\n\nWhen c_{ij} is ^, it indicates that the square at the i-th row and j-th column is covered by the top half of a 2 \\times 1 tile;\n\nWhen c_{ij} is v, it indicates that the square at the i-th row and j-th column is covered by the bottom half of a 2 \\times 1 tile.\n\nSample Input 1\n\n3 4 4 2\n\nSample Output 1\n\nYES\n<><>\n^<>^\nv<>v\n\nThis is one example of a way to place four 1 \\times 2 tiles and three 2 \\times 1 tiles on a 3 \\times 4 grid.\n\nSample Input 2\n\n4 5 5 3\n\nSample Output 2\n\nYES\n<>..^\n^.<>v\nv<>.^\n<><>v\n\nSample Input 3\n\n7 9 20 20\n\nSample Output 3\n\nNO", "sample_input": "3 4 4 2\n"}, "reference_outputs": ["YES\n<><>\n^<>^\nv<>v\n"], "source_document_id": "p03429", "source_text": "Score : 900 points\n\nProblem Statement\n\nTakahashi has an N \\times M grid, with N horizontal rows and M vertical columns.\nDetermine if we can place A 1 \\times 2 tiles (1 vertical, 2 horizontal) and B 2 \\times 1 tiles (2 vertical, 1 horizontal) satisfying the following conditions, and construct one arrangement of the tiles if it is possible:\n\nAll the tiles must be placed on the grid.\n\nTiles must not stick out of the grid, and no two different tiles may intersect.\n\nNeither the grid nor the tiles may be rotated.\n\nEvery tile completely covers exactly two squares.\n\nConstraints\n\n1 \\leq N,M \\leq 1000\n\n0 \\leq A,B \\leq 500000\n\nN, M, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M A B\n\nOutput\n\nIf it is impossible to place all the tiles, print NO.\nOtherwise, print the following:\n\nYES\nc_{11}...c_{1M}\n:\nc_{N1}...c_{NM}\n\nHere, c_{ij} must be one of the following characters: ., <, >, ^ and v. Represent an arrangement by using each of these characters as follows:\n\nWhen c_{ij} is ., it indicates that the square at the i-th row and j-th column is empty;\n\nWhen c_{ij} is <, it indicates that the square at the i-th row and j-th column is covered by the left half of a 1 \\times 2 tile;\n\nWhen c_{ij} is >, it indicates that the square at the i-th row and j-th column is covered by the right half of a 1 \\times 2 tile;\n\nWhen c_{ij} is ^, it indicates that the square at the i-th row and j-th column is covered by the top half of a 2 \\times 1 tile;\n\nWhen c_{ij} is v, it indicates that the square at the i-th row and j-th column is covered by the bottom half of a 2 \\times 1 tile.\n\nSample Input 1\n\n3 4 4 2\n\nSample Output 1\n\nYES\n<><>\n^<>^\nv<>v\n\nThis is one example of a way to place four 1 \\times 2 tiles and three 2 \\times 1 tiles on a 3 \\times 4 grid.\n\nSample Input 2\n\n4 5 5 3\n\nSample Output 2\n\nYES\n<>..^\n^.<>v\nv<>.^\n<><>v\n\nSample Input 3\n\n7 9 20 20\n\nSample Output 3\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 876, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s686169697", "group_id": "codeNet:p03433", "input_text": "sub main{\n my $N = ;\n my $A = ;\n $N % 500 <= $A ? print \"Yes\\n\" : print \"No\\n\";\n}\n\nmain", "language": "Perl", "metadata": {"date": 1522965316, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03433.html", "problem_id": "p03433", "resource_group": "low_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/Perl/s686169697.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s686169697", "user_id": "u240502040"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "sub main{\n my $N = ;\n my $A = ;\n $N % 500 <= $A ? print \"Yes\\n\" : print \"No\\n\";\n}\n\nmain", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s368567447", "group_id": "codeNet:p03433", "input_text": "my $N = <>;\nmy $A = <>;\nif ($A >= $N % 500) {\n print \"Yes\";\n} else {\n print \"No\";\n}", "language": "Perl", "metadata": {"date": 1519060887, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03433.html", "problem_id": "p03433", "resource_group": "low_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/Perl/s368567447.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s368567447", "user_id": "u379702654"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $N = <>;\nmy $A = <>;\nif ($A >= $N % 500) {\n print \"Yes\";\n} else {\n print \"No\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 85, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s037073360", "group_id": "codeNet:p03433", "input_text": "print<>%500><>?Yes:No", "language": "Perl", "metadata": {"date": 1519010220, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03433.html", "problem_id": "p03433", "resource_group": "low_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/Perl/s037073360.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s037073360", "user_id": "u280667879"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print<>%500><>?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 21, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s292056362", "group_id": "codeNet:p03434", "input_text": "get;say [+] (-<>*>>(-1,1)", "language": "Perl", "metadata": {"date": 1571762939, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03434.html", "problem_id": "p03434", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03434/input.txt", "sample_output_relpath": "derived/input_output/data/p03434/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03434/Perl/s292056362.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s292056362", "user_id": "u832039789"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get;say [+] (-<>*>>(-1,1)", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "sample_input": "2\n3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03434", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 326, "memory_kb": 63472}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s905970381", "group_id": "codeNet:p03434", "input_text": "my @As = shift <>;\nmy $R = 0;\nmy $S = 1;\n\nfor @As {\n $R += $S * $_;\n $S *= -1;\n}\n\nprint $R;", "language": "Perl", "metadata": {"date": 1519062145, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03434.html", "problem_id": "p03434", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03434/input.txt", "sample_output_relpath": "derived/input_output/data/p03434/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03434/Perl/s905970381.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s905970381", "user_id": "u379702654"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my @As = shift <>;\nmy $R = 0;\nmy $S = 1;\n\nfor @As {\n $R += $S * $_;\n $S *= -1;\n}\n\nprint $R;", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "sample_input": "2\n3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03434", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s079366289", "group_id": "codeNet:p03435", "input_text": "say (\"No\",\"Yes\")[2>()∪map {~.words.map: *-.words[0]},lines]", "language": "Perl", "metadata": {"date": 1519265489, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03435.html", "problem_id": "p03435", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03435/input.txt", "sample_output_relpath": "derived/input_output/data/p03435/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03435/Perl/s079366289.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s079366289", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "say (\"No\",\"Yes\")[2>()∪map {~.words.map: *-.words[0]},lines]", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "sample_input": "1 0 1\n2 1 2\n1 0 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03435", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 154, "memory_kb": 53144}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s610983075", "group_id": "codeNet:p03435", "input_text": "my ($a, $b, $c) = split(/ /, <>);\nmy ($d, $e, $f) = split(/ /, <>);\nmy ($g, $h, $i) = split(/ /, <>);\n($a, $b, $c) = ($a - $g, $b - $h, $c - $i);\n($d, $e, $f) = ($d - $g, $e - $h, $f - $i);\n($a, $b) = ($a - $c, $b - $c);\n($d, $e) = ($d - $c, $e - $c);\nmy $r = $a * $e - $b * $d;\nif ($r) {\n print \"Yes\";\nelse {\n print \"No\";\n}\n", "language": "Perl", "metadata": {"date": 1519087528, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03435.html", "problem_id": "p03435", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03435/input.txt", "sample_output_relpath": "derived/input_output/data/p03435/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03435/Perl/s610983075.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s610983075", "user_id": "u379702654"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my ($a, $b, $c) = split(/ /, <>);\nmy ($d, $e, $f) = split(/ /, <>);\nmy ($g, $h, $i) = split(/ /, <>);\n($a, $b, $c) = ($a - $g, $b - $h, $c - $i);\n($d, $e, $f) = ($d - $g, $e - $h, $f - $i);\n($a, $b) = ($a - $c, $b - $c);\n($d, $e) = ($d - $c, $e - $c);\nmy $r = $a * $e - $b * $d;\nif ($r) {\n print \"Yes\";\nelse {\n print \"No\";\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "sample_input": "1 0 1\n2 1 2\n1 0 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03435", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 327, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s652947131", "group_id": "codeNet:p03435", "input_text": "my $c;\nmy $i = 1;\nwhile (my $l = ) {\n chomp $l;\n if ($l =~ m/^(\\d*?) (\\d*?) (\\d*?)$/) {\n $c->{$i}->{1} = $1;\n $c->{$i}->{2} = $2;\n $c->{$i}->{3} = $3;\n }\n $i++;\n}\n\nmy ($A, $B);\nmy $flag = 1;\n $A->{1}->{2} = $c->{1}->{1}-$c->{2}->{1};\nif (($A->{1}->{2} == $c->{1}->{2}-$c->{2}->{2})\n && ($A->{1}->{2} == $c->{1}->{3}-$c->{2}->{3})){\n} else {\n $flag = 0;\n}\n $A->{1}->{3} = $c->{1}->{1}-$c->{3}->{1};\nif (($A->{1}->{3} == $c->{1}->{2}-$c->{3}->{2})\n && ($A->{1}->{3} == $c->{1}->{3}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\n $A->{2}->{3} = $c->{2}->{1}-$c->{3}->{1};\nif (($A->{2}->{3} == $c->{2}->{2}-$c->{3}->{2})\n && ($A->{2}->{3} == $c->{2}->{3}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\n $B->{1}->{2} = $c->{1}->{1}-$c->{1}->{2};\nif (($B->{1}->{2} == $c->{2}->{1}-$c->{2}->{2})\n && ($B->{1}->{2} == $c->{3}->{1}-$c->{3}->{2})){\n} else {\n $flag = 0;\n}\n $B->{1}->{3} = $c->{1}->{1}-$c->{1}->{3};\nif (($B->{1}->{3} == $c->{2}->{1}-$c->{2}->{3})\n && ($B->{1}->{3} == $c->{3}->{1}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\n $B->{2}->{3} = $c->{1}->{2}-$c->{1}->{3};\nif (($B->{2}->{3} == $c->{2}->{2}-$c->{2}->{3})\n && ($B->{2}->{3} == $c->{3}->{2}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\nif ($flag) {\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\n}", "language": "Perl", "metadata": {"date": 1519007771, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03435.html", "problem_id": "p03435", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03435/input.txt", "sample_output_relpath": "derived/input_output/data/p03435/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03435/Perl/s652947131.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s652947131", "user_id": "u807948625"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $c;\nmy $i = 1;\nwhile (my $l = ) {\n chomp $l;\n if ($l =~ m/^(\\d*?) (\\d*?) (\\d*?)$/) {\n $c->{$i}->{1} = $1;\n $c->{$i}->{2} = $2;\n $c->{$i}->{3} = $3;\n }\n $i++;\n}\n\nmy ($A, $B);\nmy $flag = 1;\n $A->{1}->{2} = $c->{1}->{1}-$c->{2}->{1};\nif (($A->{1}->{2} == $c->{1}->{2}-$c->{2}->{2})\n && ($A->{1}->{2} == $c->{1}->{3}-$c->{2}->{3})){\n} else {\n $flag = 0;\n}\n $A->{1}->{3} = $c->{1}->{1}-$c->{3}->{1};\nif (($A->{1}->{3} == $c->{1}->{2}-$c->{3}->{2})\n && ($A->{1}->{3} == $c->{1}->{3}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\n $A->{2}->{3} = $c->{2}->{1}-$c->{3}->{1};\nif (($A->{2}->{3} == $c->{2}->{2}-$c->{3}->{2})\n && ($A->{2}->{3} == $c->{2}->{3}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\n $B->{1}->{2} = $c->{1}->{1}-$c->{1}->{2};\nif (($B->{1}->{2} == $c->{2}->{1}-$c->{2}->{2})\n && ($B->{1}->{2} == $c->{3}->{1}-$c->{3}->{2})){\n} else {\n $flag = 0;\n}\n $B->{1}->{3} = $c->{1}->{1}-$c->{1}->{3};\nif (($B->{1}->{3} == $c->{2}->{1}-$c->{2}->{3})\n && ($B->{1}->{3} == $c->{3}->{1}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\n $B->{2}->{3} = $c->{1}->{2}-$c->{1}->{3};\nif (($B->{2}->{3} == $c->{2}->{2}-$c->{2}->{3})\n && ($B->{2}->{3} == $c->{3}->{2}-$c->{3}->{3})){\n} else {\n $flag = 0;\n}\nif ($flag) {\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "sample_input": "1 0 1\n2 1 2\n1 0 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03435", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1395, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s890762764", "group_id": "codeNet:p03437", "input_text": "_1?rd3R%1+Rrp", "language": "Perl", "metadata": {"date": 1595680535, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03437.html", "problem_id": "p03437", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03437/input.txt", "sample_output_relpath": "derived/input_output/data/p03437/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03437/Perl/s890762764.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s890762764", "user_id": "u657913472"}, "prompt_components": {"gold_output": "16\n", "input_to_evaluate": "_1?rd3R%1+Rrp", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers X and Y.\nIf there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it.\nIf it does not exist, print -1.\n\nConstraints\n\n1 ≤ X,Y ≤ 10^9\n\nX and Y are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\n16\n\nFor example, 16 is a multiple of 8 but not a multiple of 6.\n\nSample Input 2\n\n3 3\n\nSample Output 2\n\n-1\n\nA multiple of 3 is a multiple of 3.", "sample_input": "8 6\n"}, "reference_outputs": ["16\n"], "source_document_id": "p03437", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers X and Y.\nIf there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it.\nIf it does not exist, print -1.\n\nConstraints\n\n1 ≤ X,Y ≤ 10^9\n\nX and Y are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\n16\n\nFor example, 16 is a multiple of 8 but not a multiple of 6.\n\nSample Input 2\n\n3 3\n\nSample Output 2\n\n-1\n\nA multiple of 3 is a multiple of 3.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 13, "cpu_time_ms": 167, "memory_kb": 82772}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s512645413", "group_id": "codeNet:p03438", "input_text": "<>;@a=glob<>;$=+=($_-$a[0])/($_;print$=<0?No:Yes", "language": "Perl", "metadata": {"date": 1517741559, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03438.html", "problem_id": "p03438", "resource_group": "low_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/Perl/s512645413.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s512645413", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "<>;@a=glob<>;$=+=($_-$a[0])/($_;print$=<0?No:Yes", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 62, "memory_kb": 3584}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s490074488", "group_id": "codeNet:p03447", "input_text": "main();\n\n\nsub main{\n\tmy $A = ;\n\tmy $B = ;\n\tmy $C = ;\n\tmy $X = ;\n\n\tmy $total = 500*$A + 100*$B + 50*$C;\n\t\n\tif($total < $X){ print \"0\\n\"; last; }\n\n\tmy $cnt = 0;\n\n\tfor(my $a=0; $a<=$A; $a++){\n\t\tfor(my $b=0; $b<=$B; $b++){\n\t\t\tfor($c=0; $c<=$C; $c++){\n\t\t\t\t$total = 500*$a + 100*$b + 50*$c;\n\t\t\t\tif($total == $X){ $cnt++;}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprint \"$cnt\\n\" ;\n\t1;\n}\n", "language": "Perl", "metadata": {"date": 1523052492, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03447.html", "problem_id": "p03447", "resource_group": "low_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/Perl/s490074488.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s490074488", "user_id": "u720014456"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "main();\n\n\nsub main{\n\tmy $A = ;\n\tmy $B = ;\n\tmy $C = ;\n\tmy $X = ;\n\n\tmy $total = 500*$A + 100*$B + 50*$C;\n\t\n\tif($total < $X){ print \"0\\n\"; last; }\n\n\tmy $cnt = 0;\n\n\tfor(my $a=0; $a<=$A; $a++){\n\t\tfor(my $b=0; $b<=$B; $b++){\n\t\t\tfor($c=0; $c<=$C; $c++){\n\t\t\t\t$total = 500*$a + 100*$b + 50*$c;\n\t\t\t\tif($total == $X){ $cnt++;}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprint \"$cnt\\n\" ;\n\t1;\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2103, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s466779467", "group_id": "codeNet:p03449", "input_text": "#!/usr/bin/perl\n#abc087_c.pl\n#Sun Jan 28 20:20:21 2018\n#\n\nuse warnings;\nuse strict;\n\nmy $temp = ;\nchomp $temp;\nmy $n = $temp;\n\nmy $temp1 = ;\nchomp $temp1;\nmy @a1 = split(\" \",$temp1);\n\nmy $temp2 = ;\nchomp $temp2;\nmy @a2 = split(\" \",$temp2);\n\nmy @a1accum;\n$a1accum[0] = $a1[0];\nmy $num = 1;\n\nwhile ($num<=$#a1){\n\tpush (@a1accum, $a1[$num]+$a1accum[$num-1]);\n\t$num++;\n}\n\nmy @a2accum;\nmy $a2total = 0;\nforeach (@a2){\n\t$a2total = $a2total + $_;\n}\n\n$a2accum[0] = $a2total;\n$num = 1;\n\nwhile ($num<=$#a2){\n\tpush (@a2accum, $a2accum[$num-1]-$a2[$num-1]);\n\t$num++;\n}\n\n$num = 0;\n\nmy $ans = 0;\n\nwhile ($num < $n){\n\tmy $total = $a1accum[$num]+$a2accum[$num];\n\tif ($total > $ans){\n\t\t$ans = $total;\n\t}\n\t$num++;\n}\n\nprint $ans,\"\\n\";", "language": "Perl", "metadata": {"date": 1517192543, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03449.html", "problem_id": "p03449", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03449/input.txt", "sample_output_relpath": "derived/input_output/data/p03449/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03449/Perl/s466779467.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s466779467", "user_id": "u628871447"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "#!/usr/bin/perl\n#abc087_c.pl\n#Sun Jan 28 20:20:21 2018\n#\n\nuse warnings;\nuse strict;\n\nmy $temp = ;\nchomp $temp;\nmy $n = $temp;\n\nmy $temp1 = ;\nchomp $temp1;\nmy @a1 = split(\" \",$temp1);\n\nmy $temp2 = ;\nchomp $temp2;\nmy @a2 = split(\" \",$temp2);\n\nmy @a1accum;\n$a1accum[0] = $a1[0];\nmy $num = 1;\n\nwhile ($num<=$#a1){\n\tpush (@a1accum, $a1[$num]+$a1accum[$num-1]);\n\t$num++;\n}\n\nmy @a2accum;\nmy $a2total = 0;\nforeach (@a2){\n\t$a2total = $a2total + $_;\n}\n\n$a2accum[0] = $a2total;\n$num = 1;\n\nwhile ($num<=$#a2){\n\tpush (@a2accum, $a2accum[$num-1]-$a2[$num-1]);\n\t$num++;\n}\n\n$num = 0;\n\nmy $ans = 0;\n\nwhile ($num < $n){\n\tmy $total = $a1accum[$num]+$a2accum[$num];\n\tif ($total > $ans){\n\t\t$ans = $total;\n\t}\n\t$num++;\n}\n\nprint $ans,\"\\n\";", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a 2 \\times N grid. We will denote the square at the i-th row and j-th column (1 \\leq i \\leq 2, 1 \\leq j \\leq N) as (i, j).\n\nYou are initially in the top-left square, (1, 1).\nYou will travel to the bottom-right square, (2, N), by repeatedly moving right or down.\n\nThe square (i, j) contains A_{i, j} candies.\nYou will collect all the candies you visit during the travel.\nThe top-left and bottom-right squares also contain candies, and you will also collect them.\n\nAt most how many candies can you collect when you choose the best way to travel?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq A_{i, j} \\leq 100 (1 \\leq i \\leq 2, 1 \\leq j \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n\nOutput\n\nPrint the maximum number of candies that can be collected.\n\nSample Input 1\n\n5\n3 2 2 4 1\n1 2 2 2 1\n\nSample Output 1\n\n14\n\nThe number of collected candies will be maximized when you:\n\nmove right three times, then move down once, then move right once.\n\nSample Input 2\n\n4\n1 1 1 1\n1 1 1 1\n\nSample Output 2\n\n5\n\nYou will always collect the same number of candies, regardless of how you travel.\n\nSample Input 3\n\n7\n3 3 4 5 4 5 3\n5 3 4 4 2 3 2\n\nSample Output 3\n\n29\n\nSample Input 4\n\n1\n2\n3\n\nSample Output 4\n\n5", "sample_input": "5\n3 2 2 4 1\n1 2 2 2 1\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03449", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a 2 \\times N grid. We will denote the square at the i-th row and j-th column (1 \\leq i \\leq 2, 1 \\leq j \\leq N) as (i, j).\n\nYou are initially in the top-left square, (1, 1).\nYou will travel to the bottom-right square, (2, N), by repeatedly moving right or down.\n\nThe square (i, j) contains A_{i, j} candies.\nYou will collect all the candies you visit during the travel.\nThe top-left and bottom-right squares also contain candies, and you will also collect them.\n\nAt most how many candies can you collect when you choose the best way to travel?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq A_{i, j} \\leq 100 (1 \\leq i \\leq 2, 1 \\leq j \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n\nOutput\n\nPrint the maximum number of candies that can be collected.\n\nSample Input 1\n\n5\n3 2 2 4 1\n1 2 2 2 1\n\nSample Output 1\n\n14\n\nThe number of collected candies will be maximized when you:\n\nmove right three times, then move down once, then move right once.\n\nSample Input 2\n\n4\n1 1 1 1\n1 1 1 1\n\nSample Output 2\n\n5\n\nYou will always collect the same number of candies, regardless of how you travel.\n\nSample Input 3\n\n7\n3 3 4 5 4 5 3\n5 3 4 4 2 3 2\n\nSample Output 3\n\n29\n\nSample Input 4\n\n1\n2\n3\n\nSample Output 4\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 736, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s997785965", "group_id": "codeNet:p03451", "input_text": "my$n=+get;\nmy$a=+<);\n($S,$T) =split(\" \",);\n$S--;$T--;\nfor($i=$N-1;$i>=0;$i--) { @{$CC[$i]}=(); }\nfor($i=0;$i<$M;$i++) {\n\t$l=;\n\t$j=index($l,\" \");\n\t$U=int($l)-1;\n\t$V=int(substr($l,$j ))-1;\n\t$D=int(substr($l,index($l,\" \",$j+1)))*2;\n\t\n\tpush @UV,($U,$V,$D);\n\tpush @{$CC[$U]},($V,$D);\n\tpush @{$CC[$V]},($U,$D);\n}\n\nfor($i=$N-1;$i>=0;$i--) { $DS[$i]=-1;$DT[$i]=-1; }\n@QS1=($S);@QS2=(0);$DS[$S]=0;\n@QT1=($T);@QT2=(0);$DT[$T]=0;\n@PK=();\n\nwhile ($#QS1>=0 || $#QT1>=0) {\n\t#from S\n\t@p=();\n\tdo {\n\t\t#binary heap deque >\n\t\tpush @p,$QS1[0];\n\t\t$pd=$QS2[0];\n\t\t$q=pop(@QS1);\n\t\t$d=pop(@QS2);\n\t\tif ($#QS1>=0) {\n\t\t\t$j=0;$i=1;\n\t\t\twhile ( $i<=$#QS1 ) {\n\t\t\t\t$i=$i+1 if ($i<$#QS1 && ( $QS2[$i]>$QS2[$i+1] ));\n\t\t\t\tlast if ( $QS2[$i] >= $d );\n\t\t\t\t$QS1[$j]=$QS1[$i];\n\t\t\t\t$QS2[$j]=$QS2[$i];\n\t\t\t\t$j=$i;\n\t\t\t\t$i=$j*2+1;\n\t\t\t}\n\t\t\t$QS1[$j]=$q;\n\t\t\t$QS2[$j]=$d;\n\t\t}\n\t\t#< binary heap deque\n\t} while ( $#QS1>=0 && $pd == $QS2[0] && $PK[$p[$#p]]==0 );\n\tlast if ($PK[$p[$#p]]!=0);\n\tfor ($k=0;$k<=$#p;$k++) {\n\t\t$p=$p[$k];\n\t\tnext if ($DS[$p]<$pd);\n\t\t$a=$CC[$p];\n\t\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t\t$q=${$a}[$x];\n\t\t\tnext if ($PK[$q]==1);\n\t\t\tif ($DS[$q]<0 || $DS[$q]>$pd+${$a}[$x+1]) {\n\t\t\t\t$d=$DS[$q]=$pd+${$a}[$x+1];\n\t\t\t\t#binary heap enque >\n\t\t\t\t$j=$#QS1+1;\n\t\t\t\twhile ( $j>0 ) {\n\t\t\t\t\t$i=int(($j-1)/2);\n\t\t\t\t\tlast if ( $QS2[$i]<=$d );\n\t\t\t\t\t$QS1[$j]=$QS1[$i];\n\t\t\t\t\t$QS2[$j]=$QS2[$i];\n\t\t\t\t\t$j=$i;\n\t\t\t\t}\n\t\t\t\t$QS1[$j]=$q;\n\t\t\t\t$QS2[$j]=$d;\n\t\t\t\t#< binary heap enque\n\t\t\t}\n\t\t}\n\t\t$PK[$p]=1;\n\t}\n\t\n\t#from T\n\t@r=();\n\tdo {\n\t\t#binary heap deque >\n\t\tpush @r,$QT1[0];\n\t\t$rd=$QT2[0];\n\t\t$q=pop(@QT1);\n\t\t$d=pop(@QT2);\n\t\tif ($#QT1>=0) {\n\t\t\t$j=0;$i=1;\n\t\t\twhile ( $i<=$#QT1 ) {\n\t\t\t\t$i=$i+1 if ($i<$#QT1 && ( $QT2[$i]>$QT2[$i+1] ));\n\t\t\t\tlast if ( $QT2[$i] >= $d );\n\t\t\t\t$QT1[$j]=$QT1[$i];\n\t\t\t\t$QT2[$j]=$QT2[$i];\n\t\t\t\t$j=$i;\n\t\t\t\t$i=$j*2+1;\n\t\t\t}\n\t\t\t$QT1[$j]=$q;\n\t\t\t$QT2[$j]=$d;\n\t\t}\n\t\t#< binary heap deque\n\t} while ( $#QT1>=0 && $rd == $QT2[0] && $PK[$r[$#r]]==0);\n\tlast if ($PK[$r[$#r]]!=0);\n\tfor ($k=0;$k<=$#r;$k++) {\n\t\t$r=$r[$k];\n\t\tnext if ($DT[$r]<$rd);\n\t\t$a=$CC[$r];\n\t\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t\t$q=${$a}[$x];\n\t\t\tnext if ($PK[$q]==2);\n\t\t\tif ($DT[$q]<0 || $DT[$q]>$rd+${$a}[$x+1]) {\n\t\t\t\t$d=$DT[$q]=$rd+${$a}[$x+1];\n\t\t\t\t#binary heap enque >\n\t\t\t\t$j=$#QT1+1;\n\t\t\t\twhile ( $j>0 ) {\n\t\t\t\t\t$i=int(($j-1)/2);\n\t\t\t\t\tlast if ( $QT2[$i]<=$d );\n\t\t\t\t\t$QT1[$j]=$QT1[$i];\n\t\t\t\t\t$QT2[$j]=$QT2[$i];\n\t\t\t\t\t$j=$i;\n\t\t\t\t}\n\t\t\t\t$QT1[$j]=$q;\n\t\t\t\t$QT2[$j]=$d;\n\t\t\t\t#< binary heap enque\n\t\t\t}\n\t\t}\n\t\t$PK[$r]=2;\n\t}\n}\n\n$da=-1;@OS=();@OT=();\nfor($i=$N-1;$i>=0;$i--) {\n\tnext if ($PK[$i]==0);\n\tpush @OS,$i if ($PK[$i]==1);\n\tpush @OT,$i if ($PK[$i]==2);\n\tnext if ( $DS[$i]<0 || $DT[$i]<0 );\n\tif ( $da<0 || $DS[$i]+$DT[$i] < $da ) {\n\t\t$da = $DS[$i]+$DT[$i];\n\t}\n}\n$coltime=$da/2;\n@OS=sort { $DS[$a]<=>$DS[$b]; } @OS;\n@OT=sort { $DT[$a]<=>$DT[$b]; } @OT;\n\n@FS=();$FS[$S]=1;@FT=();\nfor ($o=0;$o<=$#OS;$o++) {\n\tnext if ( $FS[$OS[$o]]==0 );\n\t$p=$OS[$o];$ds=$DS[$p];$a=$CC[$p];\n\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t$q=${$a}[$x];\n\t\tnext if ($DS[$q]!=$ds+${$a}[$x+1]);\n\t\t$FS[$q]=($FS[$q]+$FS[$p])%$mod;\n\t\tif ($DT[$q]+$DS[$q]==$da) {\n\t\t\t$FT[$q]=$FS[$q];\n\t\t}\n\t}\n}\nfor ($o=$#OT;$o>=0;$o--) {\n\tnext if ( $FT[$OT[$o]]==0 );\n\t$p=$OT[$o];$dt=$DT[$p];$a=$CC[$p];\n\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t$q=${$a}[$x];\n\t\tnext if ($dt!=$DT[$q]+${$a}[$x+1]);\n\t\t$FT[$q]=($FT[$q]+$FT[$p])%$mod;\n\t\t$DS[$q]=$DS[$p]+${$a}[$x+1];\n\t}\n}\nfor ($o=0;$o<=$#OT;$o++) {\n\t$p=$OT[$o];$FS[$p]=$FT[$p];\n}\n\n@O = sort { $DS[$a]<=>$DS[$b]; } grep { $DS[$_]>=0 } 0..$#DS;\n\n@FT=();$FT[$T]=1;\nfor ($o=$#O;$o>=0;$o--) {\n\tnext if ( $FT[$O[$o]]==0 );\n\t$p=$O[$o];$ds=$DS[$p];$a=$CC[$p];\n\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t$q=${$a}[$x];\n\t\tnext if ($ds!=$DS[$q]+${$a}[$x+1]);\n\t\t$FT[$q]=($FT[$q]+$FT[$p])%$mod;\n\t}\n}\n\n@B=();\nfor ($o=0;$o<$#O && $DS[$O[$o]]< $coltime;$o++) {}\nfor ( ;$o<$#O && $DS[$O[$o]]==$coltime;$o++) {\n\t$p=$O[$o];\n\tpush @B, $FS[$p]*$FT[$p];\n}\nfor ($i=$#UV-2;$i>=0;$i-=3) {\n\t$U=$UV[$i];$V=$UV[$i+1];\n\tif($DS[$U]+$UV[$i+2]==$DS[$V]) {\n\t\tif($DS[$U]<$coltime && $DS[$V]>$coltime) {\n\t\t\t$b=( $FS[$U]*$FT[$V] )%$mod;\n\t\t\tpush @B, $b if ($b>0);\n\t\t}\n\t} elsif ( $DS[$V]+$UV[$i+2]==$DS[$U]) {\n\t\tif($DS[$U]>$coltime && $DS[$V]<$coltime) {\n\t\t\t$b=( $FS[$V]*$FT[$U] )%$mod;\n\t\t\tpush @B, $b if ($b>0);\n\t\t}\n\t}\n}\n\n$t=0;\nfor($i=0;$i<$#B;$i++){\nfor($j=$i+1;$j<=$#B;$j++){\n\t$t=($t+$B[$i]*$B[$j]*2)%$mod;\n}}\nprint $t;\n", "language": "Perl", "metadata": {"date": 1517798442, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03453.html", "problem_id": "p03453", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03453/input.txt", "sample_output_relpath": "derived/input_output/data/p03453/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03453/Perl/s061170786.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s061170786", "user_id": "u420702888"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$mod=1000000007;\n@CC=();@UV=();\n($N,$M) =split(\" \",);\n($S,$T) =split(\" \",);\n$S--;$T--;\nfor($i=$N-1;$i>=0;$i--) { @{$CC[$i]}=(); }\nfor($i=0;$i<$M;$i++) {\n\t$l=;\n\t$j=index($l,\" \");\n\t$U=int($l)-1;\n\t$V=int(substr($l,$j ))-1;\n\t$D=int(substr($l,index($l,\" \",$j+1)))*2;\n\t\n\tpush @UV,($U,$V,$D);\n\tpush @{$CC[$U]},($V,$D);\n\tpush @{$CC[$V]},($U,$D);\n}\n\nfor($i=$N-1;$i>=0;$i--) { $DS[$i]=-1;$DT[$i]=-1; }\n@QS1=($S);@QS2=(0);$DS[$S]=0;\n@QT1=($T);@QT2=(0);$DT[$T]=0;\n@PK=();\n\nwhile ($#QS1>=0 || $#QT1>=0) {\n\t#from S\n\t@p=();\n\tdo {\n\t\t#binary heap deque >\n\t\tpush @p,$QS1[0];\n\t\t$pd=$QS2[0];\n\t\t$q=pop(@QS1);\n\t\t$d=pop(@QS2);\n\t\tif ($#QS1>=0) {\n\t\t\t$j=0;$i=1;\n\t\t\twhile ( $i<=$#QS1 ) {\n\t\t\t\t$i=$i+1 if ($i<$#QS1 && ( $QS2[$i]>$QS2[$i+1] ));\n\t\t\t\tlast if ( $QS2[$i] >= $d );\n\t\t\t\t$QS1[$j]=$QS1[$i];\n\t\t\t\t$QS2[$j]=$QS2[$i];\n\t\t\t\t$j=$i;\n\t\t\t\t$i=$j*2+1;\n\t\t\t}\n\t\t\t$QS1[$j]=$q;\n\t\t\t$QS2[$j]=$d;\n\t\t}\n\t\t#< binary heap deque\n\t} while ( $#QS1>=0 && $pd == $QS2[0] && $PK[$p[$#p]]==0 );\n\tlast if ($PK[$p[$#p]]!=0);\n\tfor ($k=0;$k<=$#p;$k++) {\n\t\t$p=$p[$k];\n\t\tnext if ($DS[$p]<$pd);\n\t\t$a=$CC[$p];\n\t\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t\t$q=${$a}[$x];\n\t\t\tnext if ($PK[$q]==1);\n\t\t\tif ($DS[$q]<0 || $DS[$q]>$pd+${$a}[$x+1]) {\n\t\t\t\t$d=$DS[$q]=$pd+${$a}[$x+1];\n\t\t\t\t#binary heap enque >\n\t\t\t\t$j=$#QS1+1;\n\t\t\t\twhile ( $j>0 ) {\n\t\t\t\t\t$i=int(($j-1)/2);\n\t\t\t\t\tlast if ( $QS2[$i]<=$d );\n\t\t\t\t\t$QS1[$j]=$QS1[$i];\n\t\t\t\t\t$QS2[$j]=$QS2[$i];\n\t\t\t\t\t$j=$i;\n\t\t\t\t}\n\t\t\t\t$QS1[$j]=$q;\n\t\t\t\t$QS2[$j]=$d;\n\t\t\t\t#< binary heap enque\n\t\t\t}\n\t\t}\n\t\t$PK[$p]=1;\n\t}\n\t\n\t#from T\n\t@r=();\n\tdo {\n\t\t#binary heap deque >\n\t\tpush @r,$QT1[0];\n\t\t$rd=$QT2[0];\n\t\t$q=pop(@QT1);\n\t\t$d=pop(@QT2);\n\t\tif ($#QT1>=0) {\n\t\t\t$j=0;$i=1;\n\t\t\twhile ( $i<=$#QT1 ) {\n\t\t\t\t$i=$i+1 if ($i<$#QT1 && ( $QT2[$i]>$QT2[$i+1] ));\n\t\t\t\tlast if ( $QT2[$i] >= $d );\n\t\t\t\t$QT1[$j]=$QT1[$i];\n\t\t\t\t$QT2[$j]=$QT2[$i];\n\t\t\t\t$j=$i;\n\t\t\t\t$i=$j*2+1;\n\t\t\t}\n\t\t\t$QT1[$j]=$q;\n\t\t\t$QT2[$j]=$d;\n\t\t}\n\t\t#< binary heap deque\n\t} while ( $#QT1>=0 && $rd == $QT2[0] && $PK[$r[$#r]]==0);\n\tlast if ($PK[$r[$#r]]!=0);\n\tfor ($k=0;$k<=$#r;$k++) {\n\t\t$r=$r[$k];\n\t\tnext if ($DT[$r]<$rd);\n\t\t$a=$CC[$r];\n\t\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t\t$q=${$a}[$x];\n\t\t\tnext if ($PK[$q]==2);\n\t\t\tif ($DT[$q]<0 || $DT[$q]>$rd+${$a}[$x+1]) {\n\t\t\t\t$d=$DT[$q]=$rd+${$a}[$x+1];\n\t\t\t\t#binary heap enque >\n\t\t\t\t$j=$#QT1+1;\n\t\t\t\twhile ( $j>0 ) {\n\t\t\t\t\t$i=int(($j-1)/2);\n\t\t\t\t\tlast if ( $QT2[$i]<=$d );\n\t\t\t\t\t$QT1[$j]=$QT1[$i];\n\t\t\t\t\t$QT2[$j]=$QT2[$i];\n\t\t\t\t\t$j=$i;\n\t\t\t\t}\n\t\t\t\t$QT1[$j]=$q;\n\t\t\t\t$QT2[$j]=$d;\n\t\t\t\t#< binary heap enque\n\t\t\t}\n\t\t}\n\t\t$PK[$r]=2;\n\t}\n}\n\n$da=-1;@OS=();@OT=();\nfor($i=$N-1;$i>=0;$i--) {\n\tnext if ($PK[$i]==0);\n\tpush @OS,$i if ($PK[$i]==1);\n\tpush @OT,$i if ($PK[$i]==2);\n\tnext if ( $DS[$i]<0 || $DT[$i]<0 );\n\tif ( $da<0 || $DS[$i]+$DT[$i] < $da ) {\n\t\t$da = $DS[$i]+$DT[$i];\n\t}\n}\n$coltime=$da/2;\n@OS=sort { $DS[$a]<=>$DS[$b]; } @OS;\n@OT=sort { $DT[$a]<=>$DT[$b]; } @OT;\n\n@FS=();$FS[$S]=1;@FT=();\nfor ($o=0;$o<=$#OS;$o++) {\n\tnext if ( $FS[$OS[$o]]==0 );\n\t$p=$OS[$o];$ds=$DS[$p];$a=$CC[$p];\n\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t$q=${$a}[$x];\n\t\tnext if ($DS[$q]!=$ds+${$a}[$x+1]);\n\t\t$FS[$q]=($FS[$q]+$FS[$p])%$mod;\n\t\tif ($DT[$q]+$DS[$q]==$da) {\n\t\t\t$FT[$q]=$FS[$q];\n\t\t}\n\t}\n}\nfor ($o=$#OT;$o>=0;$o--) {\n\tnext if ( $FT[$OT[$o]]==0 );\n\t$p=$OT[$o];$dt=$DT[$p];$a=$CC[$p];\n\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t$q=${$a}[$x];\n\t\tnext if ($dt!=$DT[$q]+${$a}[$x+1]);\n\t\t$FT[$q]=($FT[$q]+$FT[$p])%$mod;\n\t\t$DS[$q]=$DS[$p]+${$a}[$x+1];\n\t}\n}\nfor ($o=0;$o<=$#OT;$o++) {\n\t$p=$OT[$o];$FS[$p]=$FT[$p];\n}\n\n@O = sort { $DS[$a]<=>$DS[$b]; } grep { $DS[$_]>=0 } 0..$#DS;\n\n@FT=();$FT[$T]=1;\nfor ($o=$#O;$o>=0;$o--) {\n\tnext if ( $FT[$O[$o]]==0 );\n\t$p=$O[$o];$ds=$DS[$p];$a=$CC[$p];\n\tfor($x=$#{$a}-1;$x>=0;$x-=2) {\n\t\t$q=${$a}[$x];\n\t\tnext if ($ds!=$DS[$q]+${$a}[$x+1]);\n\t\t$FT[$q]=($FT[$q]+$FT[$p])%$mod;\n\t}\n}\n\n@B=();\nfor ($o=0;$o<$#O && $DS[$O[$o]]< $coltime;$o++) {}\nfor ( ;$o<$#O && $DS[$O[$o]]==$coltime;$o++) {\n\t$p=$O[$o];\n\tpush @B, $FS[$p]*$FT[$p];\n}\nfor ($i=$#UV-2;$i>=0;$i-=3) {\n\t$U=$UV[$i];$V=$UV[$i+1];\n\tif($DS[$U]+$UV[$i+2]==$DS[$V]) {\n\t\tif($DS[$U]<$coltime && $DS[$V]>$coltime) {\n\t\t\t$b=( $FS[$U]*$FT[$V] )%$mod;\n\t\t\tpush @B, $b if ($b>0);\n\t\t}\n\t} elsif ( $DS[$V]+$UV[$i+2]==$DS[$U]) {\n\t\tif($DS[$U]>$coltime && $DS[$V]<$coltime) {\n\t\t\t$b=( $FS[$V]*$FT[$U] )%$mod;\n\t\t\tpush @B, $b if ($b>0);\n\t\t}\n\t}\n}\n\n$t=0;\nfor($i=0;$i<$#B;$i++){\nfor($j=$i+1;$j<=$#B;$j++){\n\t$t=($t+$B[$i]*$B[$j]*2)%$mod;\n}}\nprint $t;\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a graph with N vertices and M edges, and there are two people on the graph: Takahashi and Aoki.\n\nThe i-th edge connects Vertex U_i and Vertex V_i.\nThe time it takes to traverse this edge is D_i minutes, regardless of direction and who traverses the edge (Takahashi or Aoki).\n\nTakahashi departs Vertex S and Aoki departs Vertex T at the same time. Takahashi travels to Vertex T and Aoki travels to Vertex S, both in the shortest time possible.\nFind the number of the pairs of ways for Takahashi and Aoki to choose their shortest paths such that they never meet (at a vertex or on an edge) during the travel, modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 100 000\n\n1 \\leq M \\leq 200 000\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\n1 \\leq U_i, V_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq D_i \\leq 10^9 (1 \\leq i \\leq M)\n\nIf i \\neq j, then (U_i, V_i) \\neq (U_j, V_j) and (U_i, V_i) \\neq (V_j, U_j).\n\nU_i \\neq V_i (1 \\leq i \\leq M)\n\nD_i are integers.\n\nThe given graph is connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS T\nU_1 V_1 D_1\nU_2 V_2 D_2\n:\nU_M V_M D_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n\nSample Output 1\n\n2\n\nThere are two ways to choose shortest paths that satisfies the condition:\n\nTakahashi chooses the path 1 \\rightarrow 2 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 4 \\rightarrow 1.\n\nTakahashi chooses the path 1 \\rightarrow 4 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 2 \\rightarrow 1.\n\nSample Input 2\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n8 13\n4 2\n7 3 9\n6 2 3\n1 6 4\n7 6 9\n3 8 9\n1 2 2\n2 8 12\n8 6 9\n2 5 5\n4 2 18\n5 3 7\n5 1 515371567\n4 8 6\n\nSample Output 4\n\n6", "sample_input": "4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03453", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a graph with N vertices and M edges, and there are two people on the graph: Takahashi and Aoki.\n\nThe i-th edge connects Vertex U_i and Vertex V_i.\nThe time it takes to traverse this edge is D_i minutes, regardless of direction and who traverses the edge (Takahashi or Aoki).\n\nTakahashi departs Vertex S and Aoki departs Vertex T at the same time. Takahashi travels to Vertex T and Aoki travels to Vertex S, both in the shortest time possible.\nFind the number of the pairs of ways for Takahashi and Aoki to choose their shortest paths such that they never meet (at a vertex or on an edge) during the travel, modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 100 000\n\n1 \\leq M \\leq 200 000\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\n1 \\leq U_i, V_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq D_i \\leq 10^9 (1 \\leq i \\leq M)\n\nIf i \\neq j, then (U_i, V_i) \\neq (U_j, V_j) and (U_i, V_i) \\neq (V_j, U_j).\n\nU_i \\neq V_i (1 \\leq i \\leq M)\n\nD_i are integers.\n\nThe given graph is connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS T\nU_1 V_1 D_1\nU_2 V_2 D_2\n:\nU_M V_M D_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n\nSample Output 1\n\n2\n\nThere are two ways to choose shortest paths that satisfies the condition:\n\nTakahashi chooses the path 1 \\rightarrow 2 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 4 \\rightarrow 1.\n\nTakahashi chooses the path 1 \\rightarrow 4 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 2 \\rightarrow 1.\n\nSample Input 2\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n8 13\n4 2\n7 3 9\n6 2 3\n1 6 4\n7 6 9\n3 8 9\n1 2 2\n2 8 12\n8 6 9\n2 5 5\n4 2 18\n5 3 7\n5 1 515371567\n4 8 6\n\nSample Output 4\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4320, "cpu_time_ms": 1728, "memory_kb": 84592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s094643783", "group_id": "codeNet:p03453", "input_text": "$mod=1000000007;\n($N,$M) =split(\" \",);\n($S,$T) =split(\" \",);\n$S--;$T--;\n$U[$M-1]=0;$V[$M]=0;$D[$M]=0;\nfor($i=$N-1;$i>=0;$i--) { %{$C[$N]}=(); }\n\nfor($i=0;$i<$M;$i++) {\n\t$l=;\n\t$j=index($l,\" \");\n\t$U=int($l)-1;\n\t$V=int(substr($l,$j ))-1;\n\t$D=int(substr($l,index($l,\" \",$j+1)))*2;\n\t\n\t$U[$i]=$U;\n\t$V[$i]=$V;\n\t$D[$i]=$D;\n\t$C[$U]{$V}=$D;\n\t$C[$V]{$U}=$D;\n}\n\nfor($i=$N-1;$i>=0;$i--) { $DD[$i]=-1;$F[$i]=0;$F2[$i]=0; }\n$DD[$S]=0;$F[$S]=1;$F2[$T]=1;\n\npush @K,$S;\nwhile ($#K>=0){\n\t$p=pop(@K);\n\t$dd=$DD[$p];\n\t$a=$C[$p];\n\tforeach $q ( keys %{$a} ) {\n\t\tif ($DD[$q]<0 || $DD[$q]>$dd+$a->{$q}) {\n\t\t\t$d=$dd+$a->{$q};\n\t\t\t$DD[$q]=$d;\n\t\t\tfor($i=0;$i<=$#K && $d<$DD[$K[$i]];$i++) {}\n\t\t\tnext if ($q==$K[$i]);\n\t\t\tsplice @K,$i,0,$q;\n\t\t}\n\t}\n}\n@O=sort { $DD[$a]<=>$DD[$b]; } 0..$#DD;\n$coltime=$DD[$T]/2;\n\nfor ($o=$#O;$o>=0;$o--) {\n\tnext if ( $F2[$O[$o]]==0 );\n\t$p=$O[$o]; $dd=$DD[$p]; $a=$C[$p];\n\t$f=0;\n\tforeach $q ( keys %{$a} ) {\n\t\tnext if ($DD[$q]+$a->{$q}!=$dd);\n\t\t$F2[$q]=($F2[$q]+$F2[$p])%$mod;\n\t\t$f=1;\n\t}\n\tpush @O2,$p if ($f==1);\n}\npush @O2,$S;\n\nfor ($o=$#O2;$o>=0;$o--) {\n\t$p=$O2[$o];\n\t$dd=$DD[$p];\n\t$a=$C[$p];\n\tforeach $q ( keys %{$a} ) {\n\t\tnext if ($F2[$q] == 0);\n\t\tnext if ($DD[$q]!=$dd+$a->{$q});\n\t\t$F[$q]=($F[$q]+$F[$p])%$mod;\n\t}\n}\n\nfor ($o=$#O2;$DD[$O2[$o]]<$coltime;$o--) {}\nif ( $DD[$O2[$o]]==$coltime ) {\n\t$p=$O2[$o];\n\tpush @B,($F[$p]*$F2[$p])%$mod if ($F[$p]!=0 && $F2[$p]!=0);\n}\n\nfor ($i=$#U;$i>=0;$i--) {\n\t$U=$U[$i];\n\tnext if($F[$U]==0);\n\t$V=$V[$i];\n\tnext if($F[$V]==0);\n\t\n\tif($DD[$U]>$coltime) {\n\t\tif ($DD[$V]<$coltime) {\n\t\t\tpush @B,($F[$V]*$F2[$U])%$mod;\n\t\t}\n\t} elsif($DD[$U]<$coltime && $DD[$V]>$coltime) {\n\t\tpush @B,($F[$U]*$F2[$V])%$mod;\n\t}\n}\n\n$t=0;\nfor($i=0;$i<$#B;$i++){\nfor($j=$i+1;$j<=$#B;$j++){\n\t$t=($t+$B[$i]*$B[$j]*2)%$mod;\n}}\n\nprint $t;\n\n", "language": "Perl", "metadata": {"date": 1517581604, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03453.html", "problem_id": "p03453", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03453/input.txt", "sample_output_relpath": "derived/input_output/data/p03453/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03453/Perl/s094643783.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s094643783", "user_id": "u420702888"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$mod=1000000007;\n($N,$M) =split(\" \",);\n($S,$T) =split(\" \",);\n$S--;$T--;\n$U[$M-1]=0;$V[$M]=0;$D[$M]=0;\nfor($i=$N-1;$i>=0;$i--) { %{$C[$N]}=(); }\n\nfor($i=0;$i<$M;$i++) {\n\t$l=;\n\t$j=index($l,\" \");\n\t$U=int($l)-1;\n\t$V=int(substr($l,$j ))-1;\n\t$D=int(substr($l,index($l,\" \",$j+1)))*2;\n\t\n\t$U[$i]=$U;\n\t$V[$i]=$V;\n\t$D[$i]=$D;\n\t$C[$U]{$V}=$D;\n\t$C[$V]{$U}=$D;\n}\n\nfor($i=$N-1;$i>=0;$i--) { $DD[$i]=-1;$F[$i]=0;$F2[$i]=0; }\n$DD[$S]=0;$F[$S]=1;$F2[$T]=1;\n\npush @K,$S;\nwhile ($#K>=0){\n\t$p=pop(@K);\n\t$dd=$DD[$p];\n\t$a=$C[$p];\n\tforeach $q ( keys %{$a} ) {\n\t\tif ($DD[$q]<0 || $DD[$q]>$dd+$a->{$q}) {\n\t\t\t$d=$dd+$a->{$q};\n\t\t\t$DD[$q]=$d;\n\t\t\tfor($i=0;$i<=$#K && $d<$DD[$K[$i]];$i++) {}\n\t\t\tnext if ($q==$K[$i]);\n\t\t\tsplice @K,$i,0,$q;\n\t\t}\n\t}\n}\n@O=sort { $DD[$a]<=>$DD[$b]; } 0..$#DD;\n$coltime=$DD[$T]/2;\n\nfor ($o=$#O;$o>=0;$o--) {\n\tnext if ( $F2[$O[$o]]==0 );\n\t$p=$O[$o]; $dd=$DD[$p]; $a=$C[$p];\n\t$f=0;\n\tforeach $q ( keys %{$a} ) {\n\t\tnext if ($DD[$q]+$a->{$q}!=$dd);\n\t\t$F2[$q]=($F2[$q]+$F2[$p])%$mod;\n\t\t$f=1;\n\t}\n\tpush @O2,$p if ($f==1);\n}\npush @O2,$S;\n\nfor ($o=$#O2;$o>=0;$o--) {\n\t$p=$O2[$o];\n\t$dd=$DD[$p];\n\t$a=$C[$p];\n\tforeach $q ( keys %{$a} ) {\n\t\tnext if ($F2[$q] == 0);\n\t\tnext if ($DD[$q]!=$dd+$a->{$q});\n\t\t$F[$q]=($F[$q]+$F[$p])%$mod;\n\t}\n}\n\nfor ($o=$#O2;$DD[$O2[$o]]<$coltime;$o--) {}\nif ( $DD[$O2[$o]]==$coltime ) {\n\t$p=$O2[$o];\n\tpush @B,($F[$p]*$F2[$p])%$mod if ($F[$p]!=0 && $F2[$p]!=0);\n}\n\nfor ($i=$#U;$i>=0;$i--) {\n\t$U=$U[$i];\n\tnext if($F[$U]==0);\n\t$V=$V[$i];\n\tnext if($F[$V]==0);\n\t\n\tif($DD[$U]>$coltime) {\n\t\tif ($DD[$V]<$coltime) {\n\t\t\tpush @B,($F[$V]*$F2[$U])%$mod;\n\t\t}\n\t} elsif($DD[$U]<$coltime && $DD[$V]>$coltime) {\n\t\tpush @B,($F[$U]*$F2[$V])%$mod;\n\t}\n}\n\n$t=0;\nfor($i=0;$i<$#B;$i++){\nfor($j=$i+1;$j<=$#B;$j++){\n\t$t=($t+$B[$i]*$B[$j]*2)%$mod;\n}}\n\nprint $t;\n\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a graph with N vertices and M edges, and there are two people on the graph: Takahashi and Aoki.\n\nThe i-th edge connects Vertex U_i and Vertex V_i.\nThe time it takes to traverse this edge is D_i minutes, regardless of direction and who traverses the edge (Takahashi or Aoki).\n\nTakahashi departs Vertex S and Aoki departs Vertex T at the same time. Takahashi travels to Vertex T and Aoki travels to Vertex S, both in the shortest time possible.\nFind the number of the pairs of ways for Takahashi and Aoki to choose their shortest paths such that they never meet (at a vertex or on an edge) during the travel, modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 100 000\n\n1 \\leq M \\leq 200 000\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\n1 \\leq U_i, V_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq D_i \\leq 10^9 (1 \\leq i \\leq M)\n\nIf i \\neq j, then (U_i, V_i) \\neq (U_j, V_j) and (U_i, V_i) \\neq (V_j, U_j).\n\nU_i \\neq V_i (1 \\leq i \\leq M)\n\nD_i are integers.\n\nThe given graph is connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS T\nU_1 V_1 D_1\nU_2 V_2 D_2\n:\nU_M V_M D_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n\nSample Output 1\n\n2\n\nThere are two ways to choose shortest paths that satisfies the condition:\n\nTakahashi chooses the path 1 \\rightarrow 2 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 4 \\rightarrow 1.\n\nTakahashi chooses the path 1 \\rightarrow 4 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 2 \\rightarrow 1.\n\nSample Input 2\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n8 13\n4 2\n7 3 9\n6 2 3\n1 6 4\n7 6 9\n3 8 9\n1 2 2\n2 8 12\n8 6 9\n2 5 5\n4 2 18\n5 3 7\n5 1 515371567\n4 8 6\n\nSample Output 4\n\n6", "sample_input": "4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03453", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a graph with N vertices and M edges, and there are two people on the graph: Takahashi and Aoki.\n\nThe i-th edge connects Vertex U_i and Vertex V_i.\nThe time it takes to traverse this edge is D_i minutes, regardless of direction and who traverses the edge (Takahashi or Aoki).\n\nTakahashi departs Vertex S and Aoki departs Vertex T at the same time. Takahashi travels to Vertex T and Aoki travels to Vertex S, both in the shortest time possible.\nFind the number of the pairs of ways for Takahashi and Aoki to choose their shortest paths such that they never meet (at a vertex or on an edge) during the travel, modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 100 000\n\n1 \\leq M \\leq 200 000\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\n1 \\leq U_i, V_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq D_i \\leq 10^9 (1 \\leq i \\leq M)\n\nIf i \\neq j, then (U_i, V_i) \\neq (U_j, V_j) and (U_i, V_i) \\neq (V_j, U_j).\n\nU_i \\neq V_i (1 \\leq i \\leq M)\n\nD_i are integers.\n\nThe given graph is connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS T\nU_1 V_1 D_1\nU_2 V_2 D_2\n:\nU_M V_M D_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n\nSample Output 1\n\n2\n\nThere are two ways to choose shortest paths that satisfies the condition:\n\nTakahashi chooses the path 1 \\rightarrow 2 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 4 \\rightarrow 1.\n\nTakahashi chooses the path 1 \\rightarrow 4 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 2 \\rightarrow 1.\n\nSample Input 2\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n8 13\n4 2\n7 3 9\n6 2 3\n1 6 4\n7 6 9\n3 8 9\n1 2 2\n2 8 12\n8 6 9\n2 5 5\n4 2 18\n5 3 7\n5 1 515371567\n4 8 6\n\nSample Output 4\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1780, "cpu_time_ms": 2109, "memory_kb": 86656}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s285396111", "group_id": "codeNet:p03456", "input_text": "chomp($n=<>);\n@a=split/ /,$n;\n$num=join\"\",@a;\n\n$val=sqrt($num);\nif($val-int($val)==0){\n print \"Yes\";\n}else{\n print \"No\";\n}", "language": "Perl", "metadata": {"date": 1570502935, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03456.html", "problem_id": "p03456", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03456/input.txt", "sample_output_relpath": "derived/input_output/data/p03456/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03456/Perl/s285396111.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s285396111", "user_id": "u124498235"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "chomp($n=<>);\n@a=split/ /,$n;\n$num=join\"\",@a;\n\n$val=sqrt($num);\nif($val-int($val)==0){\n print \"Yes\";\n}else{\n print \"No\";\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer has found two positive integers, a and b.\nDetermine whether the concatenation of a and b in this order is a square number.\n\nConstraints\n\n1 ≤ a,b ≤ 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 the concatenation of a and b in this order is a square number, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 21\n\nSample Output 1\n\nYes\n\nAs 121 = 11 × 11, it is a square number.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\nNo\n\n100100 is not a square number.\n\nSample Input 3\n\n12 10\n\nSample Output 3\n\nNo", "sample_input": "1 21\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03456", "source_text": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer has found two positive integers, a and b.\nDetermine whether the concatenation of a and b in this order is a square number.\n\nConstraints\n\n1 ≤ a,b ≤ 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 the concatenation of a and b in this order is a square number, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 21\n\nSample Output 1\n\nYes\n\nAs 121 = 11 × 11, it is a square number.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\nNo\n\n100100 is not a square number.\n\nSample Input 3\n\n12 10\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s535193556", "group_id": "codeNet:p03456", "input_text": "#!/usr/bin/perl\n\nmy ($a,$b) = map {$_ - 0} split(/\\s+/o,);\n\nmy $x = sprintf(\"%d%d\",$a,$b);\n\nmy $r = sqrt($x - 0);\n\nif( $r == int($r) ){\n print \"Yes\\n\";\n} else {\n print \"no\\n\";\n}\n\nexit(0);\n\n", "language": "Perl", "metadata": {"date": 1516586650, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03456.html", "problem_id": "p03456", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03456/input.txt", "sample_output_relpath": "derived/input_output/data/p03456/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03456/Perl/s535193556.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s535193556", "user_id": "u750383873"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy ($a,$b) = map {$_ - 0} split(/\\s+/o,);\n\nmy $x = sprintf(\"%d%d\",$a,$b);\n\nmy $r = sqrt($x - 0);\n\nif( $r == int($r) ){\n print \"Yes\\n\";\n} else {\n print \"no\\n\";\n}\n\nexit(0);\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer has found two positive integers, a and b.\nDetermine whether the concatenation of a and b in this order is a square number.\n\nConstraints\n\n1 ≤ a,b ≤ 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 the concatenation of a and b in this order is a square number, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 21\n\nSample Output 1\n\nYes\n\nAs 121 = 11 × 11, it is a square number.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\nNo\n\n100100 is not a square number.\n\nSample Input 3\n\n12 10\n\nSample Output 3\n\nNo", "sample_input": "1 21\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03456", "source_text": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer has found two positive integers, a and b.\nDetermine whether the concatenation of a and b in this order is a square number.\n\nConstraints\n\n1 ≤ a,b ≤ 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 the concatenation of a and b in this order is a square number, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 21\n\nSample Output 1\n\nYes\n\nAs 121 = 11 × 11, it is a square number.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\nNo\n\n100100 is not a square number.\n\nSample Input 3\n\n12 10\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s892602812", "group_id": "codeNet:p03457", "input_text": "for ($n=<>;$n--;){\n @a=glob<>;\n $dt=$a[0]-$t;\n $dx=$a[1]-$x;\n $dy=$a[2]-$y;\n if ($dx+$dy>$dt || ($dt-$dx-$dy)%2) {\n print \"No\";\n exit;\n }\n $t = $a[0];\n $x = $a[1];\n $y = $a[2];\n}\nprint \"Yes\"", "language": "Perl", "metadata": {"date": 1599580111, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p03457.html", "problem_id": "p03457", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03457/input.txt", "sample_output_relpath": "derived/input_output/data/p03457/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03457/Perl/s892602812.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s892602812", "user_id": "u636683284"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "for ($n=<>;$n--;){\n @a=glob<>;\n $dt=$a[0]-$t;\n $dx=$a[1]-$x;\n $dy=$a[2]-$y;\n if ($dx+$dy>$dt || ($dt-$dx-$dy)%2) {\n print \"No\";\n exit;\n }\n $t = $a[0];\n $x = $a[1];\n $y = $a[2];\n}\nprint \"Yes\"", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is going on a trip in a two-dimensional plane.\nIn his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.\n\nIf AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).\nNote that he cannot stay at his place.\nDetermine whether he can carry out his plan.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n0 ≤ x_i ≤ 10^5\n\n0 ≤ y_i ≤ 10^5\n\n1 ≤ t_i ≤ 10^5\n\nt_i < t_{i+1} (1 ≤ i ≤ N-1)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 x_1 y_1\nt_2 x_2 y_2\n:\nt_N x_N y_N\n\nOutput\n\nIf AtCoDeer can carry out his plan, print Yes; if he cannot, print No.\n\nSample Input 1\n\n2\n3 1 2\n6 1 1\n\nSample Output 1\n\nYes\n\nFor example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).\n\nSample Input 2\n\n1\n2 100 100\n\nSample Output 2\n\nNo\n\nIt is impossible to be at (100,100) two seconds after being at (0,0).\n\nSample Input 3\n\n2\n5 1 1\n100 1 1\n\nSample Output 3\n\nNo", "sample_input": "2\n3 1 2\n6 1 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03457", "source_text": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is going on a trip in a two-dimensional plane.\nIn his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.\n\nIf AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).\nNote that he cannot stay at his place.\nDetermine whether he can carry out his plan.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n0 ≤ x_i ≤ 10^5\n\n0 ≤ y_i ≤ 10^5\n\n1 ≤ t_i ≤ 10^5\n\nt_i < t_{i+1} (1 ≤ i ≤ N-1)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 x_1 y_1\nt_2 x_2 y_2\n:\nt_N x_N y_N\n\nOutput\n\nIf AtCoDeer can carry out his plan, print Yes; if he cannot, print No.\n\nSample Input 1\n\n2\n3 1 2\n6 1 1\n\nSample Output 1\n\nYes\n\nFor example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).\n\nSample Input 2\n\n1\n2 100 100\n\nSample Output 2\n\nNo\n\nIt is impossible to be at (100,100) two seconds after being at (0,0).\n\nSample Input 3\n\n2\n5 1 1\n100 1 1\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 231, "cpu_time_ms": 616, "memory_kb": 58188}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s859259024", "group_id": "codeNet:p03457", "input_text": "$N=int();\n$t=0;$x=0;$y=0;\nfor($i=0;$i<$N;$i++){\n\t($t1,$x1,$y1)=split \" \",;\n\t$d=$t1-$t-abs($x1-$x)-abs($y1-$y);\n\tif($d<$0 || $d%2>0) { print \"No\"; exit; }\n\t$t=$t1;$x=$x1;$y=$y1;\n}\nprint \"Yes\";\n", "language": "Perl", "metadata": {"date": 1516979515, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03457.html", "problem_id": "p03457", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03457/input.txt", "sample_output_relpath": "derived/input_output/data/p03457/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03457/Perl/s859259024.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s859259024", "user_id": "u420702888"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$N=int();\n$t=0;$x=0;$y=0;\nfor($i=0;$i<$N;$i++){\n\t($t1,$x1,$y1)=split \" \",;\n\t$d=$t1-$t-abs($x1-$x)-abs($y1-$y);\n\tif($d<$0 || $d%2>0) { print \"No\"; exit; }\n\t$t=$t1;$x=$x1;$y=$y1;\n}\nprint \"Yes\";\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is going on a trip in a two-dimensional plane.\nIn his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.\n\nIf AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).\nNote that he cannot stay at his place.\nDetermine whether he can carry out his plan.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n0 ≤ x_i ≤ 10^5\n\n0 ≤ y_i ≤ 10^5\n\n1 ≤ t_i ≤ 10^5\n\nt_i < t_{i+1} (1 ≤ i ≤ N-1)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 x_1 y_1\nt_2 x_2 y_2\n:\nt_N x_N y_N\n\nOutput\n\nIf AtCoDeer can carry out his plan, print Yes; if he cannot, print No.\n\nSample Input 1\n\n2\n3 1 2\n6 1 1\n\nSample Output 1\n\nYes\n\nFor example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).\n\nSample Input 2\n\n1\n2 100 100\n\nSample Output 2\n\nNo\n\nIt is impossible to be at (100,100) two seconds after being at (0,0).\n\nSample Input 3\n\n2\n5 1 1\n100 1 1\n\nSample Output 3\n\nNo", "sample_input": "2\n3 1 2\n6 1 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03457", "source_text": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is going on a trip in a two-dimensional plane.\nIn his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.\n\nIf AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).\nNote that he cannot stay at his place.\nDetermine whether he can carry out his plan.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n0 ≤ x_i ≤ 10^5\n\n0 ≤ y_i ≤ 10^5\n\n1 ≤ t_i ≤ 10^5\n\nt_i < t_{i+1} (1 ≤ i ≤ N-1)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 x_1 y_1\nt_2 x_2 y_2\n:\nt_N x_N y_N\n\nOutput\n\nIf AtCoDeer can carry out his plan, print Yes; if he cannot, print No.\n\nSample Input 1\n\n2\n3 1 2\n6 1 1\n\nSample Output 1\n\nYes\n\nFor example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).\n\nSample Input 2\n\n1\n2 100 100\n\nSample Output 2\n\nNo\n\nIt is impossible to be at (100,100) two seconds after being at (0,0).\n\nSample Input 3\n\n2\n5 1 1\n100 1 1\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 154, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s470975708", "group_id": "codeNet:p03464", "input_text": "<>;$L=$R=2;$L=(~-$L/$_+1|0)*$_,$R=($R/$_+1|0)*$_-1 for sort{1}glob<>;print$L<$R?$L.$/.$R:-1", "language": "Perl", "metadata": {"date": 1570053952, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03464.html", "problem_id": "p03464", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03464/input.txt", "sample_output_relpath": "derived/input_output/data/p03464/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03464/Perl/s470975708.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s470975708", "user_id": "u843175622"}, "prompt_components": {"gold_output": "6 8\n", "input_to_evaluate": "<>;$L=$R=2;$L=(~-$L/$_+1|0)*$_,$R=($R/$_+1|0)*$_-1 for sort{1}glob<>;print$L<$R?$L.$/.$R:-1", "problem_context": "Score : 500 points\n\nProblem Statement\n\nAn adult game master and N children are playing a game on an ice rink.\nThe game consists of K rounds.\nIn the i-th round, the game master announces:\n\nForm groups consisting of A_i children each!\n\nThen the children who are still in the game form as many groups of A_i children as possible.\nOne child may belong to at most one group.\nThose who are left without a group leave the game. The others proceed to the next round.\nNote that it's possible that nobody leaves the game in some round.\n\nIn the end, after the K-th round, there are exactly two children left, and they are declared the winners.\n\nYou have heard the values of A_1, A_2, ..., A_K. You don't know N, but you want to estimate it.\n\nFind the smallest and the largest possible number of children in the game before the start, or determine that no valid values of N exist.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\n2 \\leq A_i \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA_1 A_2 ... A_K\n\nOutput\n\nPrint two integers representing the smallest and the largest possible value of N, respectively,\nor a single integer -1 if the described situation is impossible.\n\nSample Input 1\n\n4\n3 4 3 2\n\nSample Output 1\n\n6 8\n\nFor example, if the game starts with 6 children, then it proceeds as follows:\n\nIn the first round, 6 children form 2 groups of 3 children, and nobody leaves the game.\n\nIn the second round, 6 children form 1 group of 4 children, and 2 children leave the game.\n\nIn the third round, 4 children form 1 group of 3 children, and 1 child leaves the game.\n\nIn the fourth round, 3 children form 1 group of 2 children, and 1 child leaves the game.\n\nThe last 2 children are declared the winners.\n\nSample Input 2\n\n5\n3 4 100 3 2\n\nSample Output 2\n\n-1\n\nThis situation is impossible.\nIn particular, if the game starts with less than 100 children, everyone leaves after the third round.\n\nSample Input 3\n\n10\n2 2 2 2 2 2 2 2 2 2\n\nSample Output 3\n\n2 3", "sample_input": "4\n3 4 3 2\n"}, "reference_outputs": ["6 8\n"], "source_document_id": "p03464", "source_text": "Score : 500 points\n\nProblem Statement\n\nAn adult game master and N children are playing a game on an ice rink.\nThe game consists of K rounds.\nIn the i-th round, the game master announces:\n\nForm groups consisting of A_i children each!\n\nThen the children who are still in the game form as many groups of A_i children as possible.\nOne child may belong to at most one group.\nThose who are left without a group leave the game. The others proceed to the next round.\nNote that it's possible that nobody leaves the game in some round.\n\nIn the end, after the K-th round, there are exactly two children left, and they are declared the winners.\n\nYou have heard the values of A_1, A_2, ..., A_K. You don't know N, but you want to estimate it.\n\nFind the smallest and the largest possible number of children in the game before the start, or determine that no valid values of N exist.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\n2 \\leq A_i \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA_1 A_2 ... A_K\n\nOutput\n\nPrint two integers representing the smallest and the largest possible value of N, respectively,\nor a single integer -1 if the described situation is impossible.\n\nSample Input 1\n\n4\n3 4 3 2\n\nSample Output 1\n\n6 8\n\nFor example, if the game starts with 6 children, then it proceeds as follows:\n\nIn the first round, 6 children form 2 groups of 3 children, and nobody leaves the game.\n\nIn the second round, 6 children form 1 group of 4 children, and 2 children leave the game.\n\nIn the third round, 4 children form 1 group of 3 children, and 1 child leaves the game.\n\nIn the fourth round, 3 children form 1 group of 2 children, and 1 child leaves the game.\n\nThe last 2 children are declared the winners.\n\nSample Input 2\n\n5\n3 4 100 3 2\n\nSample Output 2\n\n-1\n\nThis situation is impossible.\nIn particular, if the game starts with less than 100 children, everyone leaves after the third round.\n\nSample Input 3\n\n10\n2 2 2 2 2 2 2 2 2 2\n\nSample Output 3\n\n2 3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 301, "memory_kb": 22396}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s663936811", "group_id": "codeNet:p03469", "input_text": "use strict;\nuse warnings;\n\nmy ($yyyy, $mm, $dd) = split(\"/\", );\n\nprint (join(\"/\", 2018, $mm, $dd));\n", "language": "Perl", "metadata": {"date": 1571368846, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03469.html", "problem_id": "p03469", "resource_group": "low_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/Perl/s663936811.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s663936811", "user_id": "u356726575"}, "prompt_components": {"gold_output": "2018/01/07\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy ($yyyy, $mm, $dd) = split(\"/\", );\n\nprint (join(\"/\", 2018, $mm, $dd));\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s741884440", "group_id": "codeNet:p03470", "input_text": "<>;print~~grep!$_[$_]++,<>", "language": "Perl", "metadata": {"date": 1515377904, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03470.html", "problem_id": "p03470", "resource_group": "low_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/Perl/s741884440.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s741884440", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;print~~grep!$_[$_]++,<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 26, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s697871525", "group_id": "codeNet:p03473", "input_text": "chomp (my $m = readline ARGV);\nprint 48 - $m, \"\\n\";", "language": "Perl", "metadata": {"date": 1517533113, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03473.html", "problem_id": "p03473", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03473/input.txt", "sample_output_relpath": "derived/input_output/data/p03473/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03473/Perl/s697871525.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s697871525", "user_id": "u411250001"}, "prompt_components": {"gold_output": "27\n", "input_to_evaluate": "chomp (my $m = readline ARGV);\nprint 48 - $m, \"\\n\";", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?\n\nConstraints\n\n1≤M≤23\n\nM is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\n\nOutput\n\nIf we have x hours until New Year at M o'clock on 30th, December, print x.\n\nSample Input 1\n\n21\n\nSample Output 1\n\n27\n\nWe have 27 hours until New Year at 21 o'clock on 30th, December.\n\nSample Input 2\n\n12\n\nSample Output 2\n\n36", "sample_input": "21\n"}, "reference_outputs": ["27\n"], "source_document_id": "p03473", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?\n\nConstraints\n\n1≤M≤23\n\nM is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\n\nOutput\n\nIf we have x hours until New Year at M o'clock on 30th, December, print x.\n\nSample Input 1\n\n21\n\nSample Output 1\n\n27\n\nWe have 27 hours until New Year at 21 o'clock on 30th, December.\n\nSample Input 2\n\n12\n\nSample Output 2\n\n36", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 51, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s867829727", "group_id": "codeNet:p03474", "input_text": "print<>!~$\",<>=~/^\\d{$`}-\\d+$/?Yes:No", "language": "Perl", "metadata": {"date": 1560872845, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03474.html", "problem_id": "p03474", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03474/input.txt", "sample_output_relpath": "derived/input_output/data/p03474/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03474/Perl/s867829727.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s867829727", "user_id": "u573154728"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print<>!~$\",<>=~/^\\d{$`}-\\d+$/?Yes:No", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "sample_input": "3 4\n269-6650\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03474", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s410765044", "group_id": "codeNet:p03474", "input_text": "#!/usr/bin/perl\n\nmy $l1 = ;\n\n$l1 =~ /^(\\d+)\\s+(\\d+)/o;\n\nmy $a = $1;\nmy $b = $2;\n\nmy $l2 = ;\n$l2 =~ s/[\\x00-\\x20]+$//o;\n\nif( $l2 =~ /^(\\d*)-(\\d*)$/o ){\n my $al = $1;\n my $bl = $2;\n if( length($al) == ($a - 0) and length($bl)== ($b - 0) ){\n print \"Yes\\n\";\n } else {\n print \"No\\n\";\n }\n} else {\n print \"No\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1514686541, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03474.html", "problem_id": "p03474", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03474/input.txt", "sample_output_relpath": "derived/input_output/data/p03474/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03474/Perl/s410765044.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s410765044", "user_id": "u750383873"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "#!/usr/bin/perl\n\nmy $l1 = ;\n\n$l1 =~ /^(\\d+)\\s+(\\d+)/o;\n\nmy $a = $1;\nmy $b = $2;\n\nmy $l2 = ;\n$l2 =~ s/[\\x00-\\x20]+$//o;\n\nif( $l2 =~ /^(\\d*)-(\\d*)$/o ){\n my $al = $1;\n my $bl = $2;\n if( length($al) == ($a - 0) and length($bl)== ($b - 0) ){\n print \"Yes\\n\";\n } else {\n print \"No\\n\";\n }\n} else {\n print \"No\\n\";\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "sample_input": "3 4\n269-6650\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03474", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s002871148", "group_id": "codeNet:p03474", "input_text": "<>=~$\";say<>=~('\\d'x$`.'-'.'\\d'x$')?Yes:No", "language": "Perl", "metadata": {"date": 1514686224, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03474.html", "problem_id": "p03474", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03474/input.txt", "sample_output_relpath": "derived/input_output/data/p03474/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03474/Perl/s002871148.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s002871148", "user_id": "u207056619"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "<>=~$\";say<>=~('\\d'x$`.'-'.'\\d'x$')?Yes:No", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "sample_input": "3 4\n269-6650\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03474", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1790, "memory_kb": 62376}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s099504907", "group_id": "codeNet:p03475", "input_text": "map{$%=!shift@_;$%=($-=/ .* /+(--$%-$&)/$')*$'+$&+$`for@_;print$%,$/}@_=<>", "language": "Perl", "metadata": {"date": 1538113197, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03475.html", "problem_id": "p03475", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03475/input.txt", "sample_output_relpath": "derived/input_output/data/p03475/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03475/Perl/s099504907.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s099504907", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n11\n0\n", "input_to_evaluate": "map{$%=!shift@_;$%=($-=/ .* /+(--$%-$&)/$')*$'+$&+$`for@_;print$%,$/}@_=<>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA railroad running from west to east in Atcoder Kingdom is now complete.\n\nThere are N stations on the railroad, numbered 1 through N from west to east.\n\nTomorrow, the opening ceremony of the railroad will take place.\n\nOn this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i to Station i+1 in C_i seconds. No other trains will be operated.\n\nThe first train from Station i to Station i+1 will depart Station i S_i seconds after the ceremony begins. Thereafter, there will be a train that departs Station i every F_i seconds.\n\nHere, it is guaranteed that F_i divides S_i.\n\nThat is, for each Time t satisfying S_i≤t and t%F_i=0, there will be a train that departs Station i t seconds after the ceremony begins and arrives at Station i+1 t+C_i seconds after the ceremony begins, where A%B denotes A modulo B, and there will be no other trains.\n\nFor each i, find the earliest possible time we can reach Station N if we are at Station i when the ceremony begins, ignoring the time needed to change trains.\n\nConstraints\n\n1≤N≤500\n\n1≤C_i≤100\n\n1≤S_i≤10^5\n\n1≤F_i≤10\n\nS_i%F_i=0\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nC_1 S_1 F_1\n:\nC_{N-1} S_{N-1} F_{N-1}\n\nOutput\n\nPrint N lines. Assuming that we are at Station i (1≤i≤N) when the ceremony begins, if the earliest possible time we can reach Station N is x seconds after the ceremony begins, the i-th line should contain x.\n\nSample Input 1\n\n3\n6 5 1\n1 10 1\n\nSample Output 1\n\n12\n11\n0\n\nWe will travel from Station 1 as follows:\n\n5 seconds after the beginning: take the train to Station 2.\n\n11 seconds: arrive at Station 2.\n\n11 seconds: take the train to Station 3.\n\n12 seconds: arrive at Station 3.\n\nWe will travel from Station 2 as follows:\n\n10 seconds: take the train to Station 3.\n\n11 seconds: arrive at Station 3.\n\nNote that we should print 0 for Station 3.\n\nSample Input 2\n\n4\n12 24 6\n52 16 4\n99 2 2\n\nSample Output 2\n\n187\n167\n101\n0\n\nSample Input 3\n\n4\n12 13 1\n44 17 17\n66 4096 64\n\nSample Output 3\n\n4162\n4162\n4162\n0", "sample_input": "3\n6 5 1\n1 10 1\n"}, "reference_outputs": ["12\n11\n0\n"], "source_document_id": "p03475", "source_text": "Score : 300 points\n\nProblem Statement\n\nA railroad running from west to east in Atcoder Kingdom is now complete.\n\nThere are N stations on the railroad, numbered 1 through N from west to east.\n\nTomorrow, the opening ceremony of the railroad will take place.\n\nOn this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i to Station i+1 in C_i seconds. No other trains will be operated.\n\nThe first train from Station i to Station i+1 will depart Station i S_i seconds after the ceremony begins. Thereafter, there will be a train that departs Station i every F_i seconds.\n\nHere, it is guaranteed that F_i divides S_i.\n\nThat is, for each Time t satisfying S_i≤t and t%F_i=0, there will be a train that departs Station i t seconds after the ceremony begins and arrives at Station i+1 t+C_i seconds after the ceremony begins, where A%B denotes A modulo B, and there will be no other trains.\n\nFor each i, find the earliest possible time we can reach Station N if we are at Station i when the ceremony begins, ignoring the time needed to change trains.\n\nConstraints\n\n1≤N≤500\n\n1≤C_i≤100\n\n1≤S_i≤10^5\n\n1≤F_i≤10\n\nS_i%F_i=0\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nC_1 S_1 F_1\n:\nC_{N-1} S_{N-1} F_{N-1}\n\nOutput\n\nPrint N lines. Assuming that we are at Station i (1≤i≤N) when the ceremony begins, if the earliest possible time we can reach Station N is x seconds after the ceremony begins, the i-th line should contain x.\n\nSample Input 1\n\n3\n6 5 1\n1 10 1\n\nSample Output 1\n\n12\n11\n0\n\nWe will travel from Station 1 as follows:\n\n5 seconds after the beginning: take the train to Station 2.\n\n11 seconds: arrive at Station 2.\n\n11 seconds: take the train to Station 3.\n\n12 seconds: arrive at Station 3.\n\nWe will travel from Station 2 as follows:\n\n10 seconds: take the train to Station 3.\n\n11 seconds: arrive at Station 3.\n\nNote that we should print 0 for Station 3.\n\nSample Input 2\n\n4\n12 24 6\n52 16 4\n99 2 2\n\nSample Output 2\n\n187\n167\n101\n0\n\nSample Input 3\n\n4\n12 13 1\n44 17 17\n66 4096 64\n\nSample Output 3\n\n4162\n4162\n4162\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 228, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s641750214", "group_id": "codeNet:p03475", "input_text": "map{$p=0;shift@_;/ .* /,$p=$p<$&?$&+$`:(0|~-$p/$'+1)*$'+$`for@_;print$p,$/}@_=<>", "language": "Perl", "metadata": {"date": 1514692871, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03475.html", "problem_id": "p03475", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03475/input.txt", "sample_output_relpath": "derived/input_output/data/p03475/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03475/Perl/s641750214.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s641750214", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n11\n0\n", "input_to_evaluate": "map{$p=0;shift@_;/ .* /,$p=$p<$&?$&+$`:(0|~-$p/$'+1)*$'+$`for@_;print$p,$/}@_=<>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA railroad running from west to east in Atcoder Kingdom is now complete.\n\nThere are N stations on the railroad, numbered 1 through N from west to east.\n\nTomorrow, the opening ceremony of the railroad will take place.\n\nOn this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i to Station i+1 in C_i seconds. No other trains will be operated.\n\nThe first train from Station i to Station i+1 will depart Station i S_i seconds after the ceremony begins. Thereafter, there will be a train that departs Station i every F_i seconds.\n\nHere, it is guaranteed that F_i divides S_i.\n\nThat is, for each Time t satisfying S_i≤t and t%F_i=0, there will be a train that departs Station i t seconds after the ceremony begins and arrives at Station i+1 t+C_i seconds after the ceremony begins, where A%B denotes A modulo B, and there will be no other trains.\n\nFor each i, find the earliest possible time we can reach Station N if we are at Station i when the ceremony begins, ignoring the time needed to change trains.\n\nConstraints\n\n1≤N≤500\n\n1≤C_i≤100\n\n1≤S_i≤10^5\n\n1≤F_i≤10\n\nS_i%F_i=0\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nC_1 S_1 F_1\n:\nC_{N-1} S_{N-1} F_{N-1}\n\nOutput\n\nPrint N lines. Assuming that we are at Station i (1≤i≤N) when the ceremony begins, if the earliest possible time we can reach Station N is x seconds after the ceremony begins, the i-th line should contain x.\n\nSample Input 1\n\n3\n6 5 1\n1 10 1\n\nSample Output 1\n\n12\n11\n0\n\nWe will travel from Station 1 as follows:\n\n5 seconds after the beginning: take the train to Station 2.\n\n11 seconds: arrive at Station 2.\n\n11 seconds: take the train to Station 3.\n\n12 seconds: arrive at Station 3.\n\nWe will travel from Station 2 as follows:\n\n10 seconds: take the train to Station 3.\n\n11 seconds: arrive at Station 3.\n\nNote that we should print 0 for Station 3.\n\nSample Input 2\n\n4\n12 24 6\n52 16 4\n99 2 2\n\nSample Output 2\n\n187\n167\n101\n0\n\nSample Input 3\n\n4\n12 13 1\n44 17 17\n66 4096 64\n\nSample Output 3\n\n4162\n4162\n4162\n0", "sample_input": "3\n6 5 1\n1 10 1\n"}, "reference_outputs": ["12\n11\n0\n"], "source_document_id": "p03475", "source_text": "Score : 300 points\n\nProblem Statement\n\nA railroad running from west to east in Atcoder Kingdom is now complete.\n\nThere are N stations on the railroad, numbered 1 through N from west to east.\n\nTomorrow, the opening ceremony of the railroad will take place.\n\nOn this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i to Station i+1 in C_i seconds. No other trains will be operated.\n\nThe first train from Station i to Station i+1 will depart Station i S_i seconds after the ceremony begins. Thereafter, there will be a train that departs Station i every F_i seconds.\n\nHere, it is guaranteed that F_i divides S_i.\n\nThat is, for each Time t satisfying S_i≤t and t%F_i=0, there will be a train that departs Station i t seconds after the ceremony begins and arrives at Station i+1 t+C_i seconds after the ceremony begins, where A%B denotes A modulo B, and there will be no other trains.\n\nFor each i, find the earliest possible time we can reach Station N if we are at Station i when the ceremony begins, ignoring the time needed to change trains.\n\nConstraints\n\n1≤N≤500\n\n1≤C_i≤100\n\n1≤S_i≤10^5\n\n1≤F_i≤10\n\nS_i%F_i=0\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nC_1 S_1 F_1\n:\nC_{N-1} S_{N-1} F_{N-1}\n\nOutput\n\nPrint N lines. Assuming that we are at Station i (1≤i≤N) when the ceremony begins, if the earliest possible time we can reach Station N is x seconds after the ceremony begins, the i-th line should contain x.\n\nSample Input 1\n\n3\n6 5 1\n1 10 1\n\nSample Output 1\n\n12\n11\n0\n\nWe will travel from Station 1 as follows:\n\n5 seconds after the beginning: take the train to Station 2.\n\n11 seconds: arrive at Station 2.\n\n11 seconds: take the train to Station 3.\n\n12 seconds: arrive at Station 3.\n\nWe will travel from Station 2 as follows:\n\n10 seconds: take the train to Station 3.\n\n11 seconds: arrive at Station 3.\n\nNote that we should print 0 for Station 3.\n\nSample Input 2\n\n4\n12 24 6\n52 16 4\n99 2 2\n\nSample Output 2\n\n187\n167\n101\n0\n\nSample Input 3\n\n4\n12 13 1\n44 17 17\n66 4096 64\n\nSample Output 3\n\n4162\n4162\n4162\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 170, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s665505111", "group_id": "codeNet:p03476", "input_text": "$Q = scalar();\n@P=(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317);\n$S[3]=1;$s=1;\nfor($i=5;$i<=100000;$i+=4){\n\t$f=1;\n\t$ii=($i+1)/2;\n\tfor($j=0;$P[$j]*$P[$j]<=$ii;$j++){\n\t\tif($ii%$P[$j]==0) { $f=0; last; }\n\t\tif($i%$P[$j]==0) { $f=0; last;}\n\t}\n\tif ($f) {\n\t\tfor(;$P[$j]*$P[$j]<=$i;$j++){\n\t\t\tif($i%$P[$j]==0) { $f=0; last;}\n\t\t}\n\t\t$s=$s+1 if ($f);\n\t}\n\t$S[$i]=$s;\n\t$S[$i+2]=$s;\n}\n\nfor($i=$Q;$i>0;$i--){\n\t($l,$r)=split \" \",;\n\tprint $S[$r]-$S[$l-2],\"\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1516096906, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03476.html", "problem_id": "p03476", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03476/input.txt", "sample_output_relpath": "derived/input_output/data/p03476/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03476/Perl/s665505111.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s665505111", "user_id": "u420702888"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$Q = scalar();\n@P=(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317);\n$S[3]=1;$s=1;\nfor($i=5;$i<=100000;$i+=4){\n\t$f=1;\n\t$ii=($i+1)/2;\n\tfor($j=0;$P[$j]*$P[$j]<=$ii;$j++){\n\t\tif($ii%$P[$j]==0) { $f=0; last; }\n\t\tif($i%$P[$j]==0) { $f=0; last;}\n\t}\n\tif ($f) {\n\t\tfor(;$P[$j]*$P[$j]<=$i;$j++){\n\t\t\tif($i%$P[$j]==0) { $f=0; last;}\n\t\t}\n\t\t$s=$s+1 if ($f);\n\t}\n\t$S[$i]=$s;\n\t$S[$i+2]=$s;\n}\n\nfor($i=$Q;$i>0;$i--){\n\t($l,$r)=split \" \",;\n\tprint $S[$r]-$S[$l-2],\"\\n\";\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "sample_input": "1\n3 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03476", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 260, "memory_kb": 2816}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s728591615", "group_id": "codeNet:p03476", "input_text": "$Q = ;chomp $Q;\n@P=(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317);\n$s=0;\nfor($i=3;$i<=100000;$i++){\n\t$f=1;\n\t$ii=($i+1)/2;\n\tfor($j=0;$P[$j]*$P[$j]<=$ii;$j++){\n\t\tif($ii%$P[$j]==0) { $f=0; last; }\n\t}\n\tif ($f) {\n\t\tfor($j=0;$P[$j]*$P[$j]<=$i;$j++){\n\t\t\tif($i%$P[$j]==0) { $f=0; last;}\n\t\t}\n\t\t$s=$s+1 if ($f);\n\t}\n\t$S[$i]=$s;\n}\nfor($i=$Q;$i>0;$i--){\n\t($l,$r)=split \" \",;\n\t$c=$S[$r]-$S[$l-1];\n\tprint \"$c\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1516095010, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03476.html", "problem_id": "p03476", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03476/input.txt", "sample_output_relpath": "derived/input_output/data/p03476/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03476/Perl/s728591615.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s728591615", "user_id": "u420702888"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$Q = ;chomp $Q;\n@P=(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317);\n$s=0;\nfor($i=3;$i<=100000;$i++){\n\t$f=1;\n\t$ii=($i+1)/2;\n\tfor($j=0;$P[$j]*$P[$j]<=$ii;$j++){\n\t\tif($ii%$P[$j]==0) { $f=0; last; }\n\t}\n\tif ($f) {\n\t\tfor($j=0;$P[$j]*$P[$j]<=$i;$j++){\n\t\t\tif($i%$P[$j]==0) { $f=0; last;}\n\t\t}\n\t\t$s=$s+1 if ($f);\n\t}\n\t$S[$i]=$s;\n}\nfor($i=$Q;$i>0;$i--){\n\t($l,$r)=split \" \",;\n\t$c=$S[$r]-$S[$l-1];\n\tprint \"$c\\n\";\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "sample_input": "1\n3 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03476", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 483, "memory_kb": 4096}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s154529456", "group_id": "codeNet:p03476", "input_text": "my @r = (3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253, 3313, 3517, 3733, 4021, 4057, 4177, 4261, 4273, 4357, 4441, 4561, 4621, 4933, 5077, 5101, 5113, 5233, 5413, 5437, 5581, 5701, 6037, 6073, 6121, 6133, 6217, 6337, 6361, 6373, 6637, 6661, 6781, 6997, 7057, 7213, 7393, 7417, 7477, 7537, 7753, 7933, 8053, 8101, 8221, 8317, 8353, 8461, 8521, 8677, 8713, 8893, 9013, 9133, 9181, 9241, 9277, 9601, 9661, 9721, 9817, 9901, 9973, 10333, 10357, 10453, 10837, 10861, 10957, 11113, 11161, 11317, 11497, 11677, 11701, 12073, 12157, 12241, 12301, 12421, 12433, 12457, 12541, 12553, 12601, 12721, 12757, 12841, 12853, 13093, 13381, 13417, 13681, 13921, 13933, 14437, 14593, 14737, 14821, 15013, 15073, 15121, 15241, 15277, 15361, 15373, 15733, 15901, 16033, 16333, 16381, 16417, 16573, 16633, 16657, 16921, 17041, 17053, 17077, 17257, 17293, 17377, 17881, 18013, 18097, 18133, 18181, 18217, 18253, 18301, 18313, 18397, 18481, 18553, 18637, 18793, 19237, 19441, 19477, 19717, 19801, 19813, 19861, 20353, 20533, 20641, 20857, 21001, 21061, 21193, 21277, 21313, 21577, 21661, 21673, 21817, 22093, 22501, 22573, 22621, 22993, 23053, 23173, 23557, 23677, 23773, 23917, 24097, 24421, 24481, 24781, 24841, 25033, 25153, 25237, 25561, 25657, 25933, 26017, 26293, 26317, 26437, 26497, 26821, 26833, 26881, 26953, 27073, 27253, 27337, 27361, 27457, 27997, 28057, 28297, 28393, 28813, 28837, 28921, 29101, 29473, 29641, 30181, 30241, 30517, 30553, 30577, 30637, 30661, 30697, 30781, 30853, 31081, 31237, 31321, 31333, 31357, 31477, 31573, 31873, 31981, 32173, 32377, 32497, 32533, 32833, 33037, 33301, 33457, 33493, 33757, 33961, 34057, 34213, 34273, 34381, 34513, 34897, 34981, 35317, 35521, 35677, 35977, 36097, 36241, 36433, 36457, 36793, 36877, 36901, 36913, 37273, 37321, 37357, 37573, 37717, 37957, 38281, 38461, 38833, 38953, 38977, 39217, 39373, 39397, 39733, 40093, 40177, 40213, 40693, 40813, 41017, 41221, 41281, 41413, 41617, 41893, 42061, 42337, 42373, 42793, 42961, 43117, 43177, 43201, 43321, 43573, 43597, 43633, 43717, 44053, 44101, 44221, 44257, 44293, 44893, 45061, 45337, 45433, 45481, 45553, 45613, 45841, 46021, 46141, 46261, 46861, 46993, 47017, 47161, 47353, 47521, 47533, 47653, 47713, 47737, 47797, 47857, 48121, 48193, 48337, 48673, 48757, 48781, 49033, 49261, 49393, 49417, 49597, 49681, 49957, 50221, 50341, 50377, 50821, 50893, 51157, 51217, 51241, 51481, 51517, 51637, 52057, 52081, 52237, 52321, 52453, 52501, 52813, 52861, 52957, 53077, 53113, 53281, 53401, 53917, 54121, 54133, 54181, 54217, 54421, 54517, 54541, 54673, 54721, 54973, 55057, 55381, 55501, 55633, 55837, 55921, 55933, 56053, 56101, 56113, 56197, 56401, 56437, 56701, 56773, 56821, 56857, 56893, 57073, 57097, 57193, 57241, 57373, 57457, 57853, 58153, 58417, 58441, 58537, 58573, 58693, 59053, 59197, 59221, 59281, 59341, 59833, 60217, 60337, 60373, 60637, 60733, 60937, 61057, 61153, 61261, 61297, 61561, 61657, 61681, 61717, 61861, 62137, 62473, 62497, 62533, 62653, 62773, 63313, 63397, 63541, 63697, 63781, 63913, 64153, 64237, 64381, 64513, 64717, 65173, 65293, 65413, 65437, 65497, 65557, 65677, 65881, 66301, 66361, 66601, 66697, 66853, 66973, 67057, 67153, 67273, 67477, 67537, 67741, 67777, 67933, 67993, 68113, 68281, 68521, 68737, 69001, 69073, 69457, 69493, 69697, 69877, 70117, 70177, 70297, 70501, 70621, 70921, 70981, 71233, 71341, 71353, 71593, 71821, 72073, 72481, 72613, 72901, 72937, 73141, 73417, 73477, 73561, 73693, 74077, 74317, 74377, 74713, 75013, 75133, 75181, 75721, 75793, 75913, 76333, 76561, 76597, 76753, 77137, 77641, 78157, 78193, 78277, 78877, 78901, 79333, 79357, 79537, 79657, 79693, 79801, 79873, 80077, 80173, 80221, 80473, 80701, 80713, 80917, 81013, 81181, 81517, 81637, 81853, 82021, 82153, 82261, 82561, 82981, 83077, 83221, 83233, 83437, 83617, 83701, 83773, 84121, 84313, 84673, 84697, 84793, 84913, 85297, 85333, 85453, 85717, 85933, 86353, 86413, 87181, 87253, 87337, 87421, 87433, 87517, 87553, 87973, 88117, 88177, 88237, 88261, 88513, 88741, 88897, 88993, 89293, 89833, 89917, 90121, 91081, 91381, 91393, 91513, 91957, 92041, 92557, 92761, 92821, 92893, 92941, 93097, 93133, 93493, 93637, 93913, 94033, 94117, 94273, 94321, 94441, 94573, 94777, 94837, 94993, 95257, 95317, 95401, 95581, 95617, 95713, 95737, 96097, 96157, 96181, 96493, 96517, 96973, 97081, 97177, 97501, 97561, 97777, 97813, 98017, 98737, 98953, 99277, 99577, 99661, 99877);\nmy $k = {};\n$k->{$_} = 1 foreach (@r);\nmy $h = {};\nmy $c = 0;\nfor(my $i = 0; $i < 100000; $i++) {\n $h->{$i} = $c;\n if($k->{$i}) {\n $c++;\n }\n}\nmy $q = - 0;\nforeach(1 ... $q) {\n my ($low, $high) = map { $_ - 0 } split / /,;\n print $h->{$high} - $h->{$low}, \"\\n\";\n}", "language": "Perl", "metadata": {"date": 1514694032, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03476.html", "problem_id": "p03476", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03476/input.txt", "sample_output_relpath": "derived/input_output/data/p03476/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03476/Perl/s154529456.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s154529456", "user_id": "u170302265"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my @r = (3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253, 3313, 3517, 3733, 4021, 4057, 4177, 4261, 4273, 4357, 4441, 4561, 4621, 4933, 5077, 5101, 5113, 5233, 5413, 5437, 5581, 5701, 6037, 6073, 6121, 6133, 6217, 6337, 6361, 6373, 6637, 6661, 6781, 6997, 7057, 7213, 7393, 7417, 7477, 7537, 7753, 7933, 8053, 8101, 8221, 8317, 8353, 8461, 8521, 8677, 8713, 8893, 9013, 9133, 9181, 9241, 9277, 9601, 9661, 9721, 9817, 9901, 9973, 10333, 10357, 10453, 10837, 10861, 10957, 11113, 11161, 11317, 11497, 11677, 11701, 12073, 12157, 12241, 12301, 12421, 12433, 12457, 12541, 12553, 12601, 12721, 12757, 12841, 12853, 13093, 13381, 13417, 13681, 13921, 13933, 14437, 14593, 14737, 14821, 15013, 15073, 15121, 15241, 15277, 15361, 15373, 15733, 15901, 16033, 16333, 16381, 16417, 16573, 16633, 16657, 16921, 17041, 17053, 17077, 17257, 17293, 17377, 17881, 18013, 18097, 18133, 18181, 18217, 18253, 18301, 18313, 18397, 18481, 18553, 18637, 18793, 19237, 19441, 19477, 19717, 19801, 19813, 19861, 20353, 20533, 20641, 20857, 21001, 21061, 21193, 21277, 21313, 21577, 21661, 21673, 21817, 22093, 22501, 22573, 22621, 22993, 23053, 23173, 23557, 23677, 23773, 23917, 24097, 24421, 24481, 24781, 24841, 25033, 25153, 25237, 25561, 25657, 25933, 26017, 26293, 26317, 26437, 26497, 26821, 26833, 26881, 26953, 27073, 27253, 27337, 27361, 27457, 27997, 28057, 28297, 28393, 28813, 28837, 28921, 29101, 29473, 29641, 30181, 30241, 30517, 30553, 30577, 30637, 30661, 30697, 30781, 30853, 31081, 31237, 31321, 31333, 31357, 31477, 31573, 31873, 31981, 32173, 32377, 32497, 32533, 32833, 33037, 33301, 33457, 33493, 33757, 33961, 34057, 34213, 34273, 34381, 34513, 34897, 34981, 35317, 35521, 35677, 35977, 36097, 36241, 36433, 36457, 36793, 36877, 36901, 36913, 37273, 37321, 37357, 37573, 37717, 37957, 38281, 38461, 38833, 38953, 38977, 39217, 39373, 39397, 39733, 40093, 40177, 40213, 40693, 40813, 41017, 41221, 41281, 41413, 41617, 41893, 42061, 42337, 42373, 42793, 42961, 43117, 43177, 43201, 43321, 43573, 43597, 43633, 43717, 44053, 44101, 44221, 44257, 44293, 44893, 45061, 45337, 45433, 45481, 45553, 45613, 45841, 46021, 46141, 46261, 46861, 46993, 47017, 47161, 47353, 47521, 47533, 47653, 47713, 47737, 47797, 47857, 48121, 48193, 48337, 48673, 48757, 48781, 49033, 49261, 49393, 49417, 49597, 49681, 49957, 50221, 50341, 50377, 50821, 50893, 51157, 51217, 51241, 51481, 51517, 51637, 52057, 52081, 52237, 52321, 52453, 52501, 52813, 52861, 52957, 53077, 53113, 53281, 53401, 53917, 54121, 54133, 54181, 54217, 54421, 54517, 54541, 54673, 54721, 54973, 55057, 55381, 55501, 55633, 55837, 55921, 55933, 56053, 56101, 56113, 56197, 56401, 56437, 56701, 56773, 56821, 56857, 56893, 57073, 57097, 57193, 57241, 57373, 57457, 57853, 58153, 58417, 58441, 58537, 58573, 58693, 59053, 59197, 59221, 59281, 59341, 59833, 60217, 60337, 60373, 60637, 60733, 60937, 61057, 61153, 61261, 61297, 61561, 61657, 61681, 61717, 61861, 62137, 62473, 62497, 62533, 62653, 62773, 63313, 63397, 63541, 63697, 63781, 63913, 64153, 64237, 64381, 64513, 64717, 65173, 65293, 65413, 65437, 65497, 65557, 65677, 65881, 66301, 66361, 66601, 66697, 66853, 66973, 67057, 67153, 67273, 67477, 67537, 67741, 67777, 67933, 67993, 68113, 68281, 68521, 68737, 69001, 69073, 69457, 69493, 69697, 69877, 70117, 70177, 70297, 70501, 70621, 70921, 70981, 71233, 71341, 71353, 71593, 71821, 72073, 72481, 72613, 72901, 72937, 73141, 73417, 73477, 73561, 73693, 74077, 74317, 74377, 74713, 75013, 75133, 75181, 75721, 75793, 75913, 76333, 76561, 76597, 76753, 77137, 77641, 78157, 78193, 78277, 78877, 78901, 79333, 79357, 79537, 79657, 79693, 79801, 79873, 80077, 80173, 80221, 80473, 80701, 80713, 80917, 81013, 81181, 81517, 81637, 81853, 82021, 82153, 82261, 82561, 82981, 83077, 83221, 83233, 83437, 83617, 83701, 83773, 84121, 84313, 84673, 84697, 84793, 84913, 85297, 85333, 85453, 85717, 85933, 86353, 86413, 87181, 87253, 87337, 87421, 87433, 87517, 87553, 87973, 88117, 88177, 88237, 88261, 88513, 88741, 88897, 88993, 89293, 89833, 89917, 90121, 91081, 91381, 91393, 91513, 91957, 92041, 92557, 92761, 92821, 92893, 92941, 93097, 93133, 93493, 93637, 93913, 94033, 94117, 94273, 94321, 94441, 94573, 94777, 94837, 94993, 95257, 95317, 95401, 95581, 95617, 95713, 95737, 96097, 96157, 96181, 96493, 96517, 96973, 97081, 97177, 97501, 97561, 97777, 97813, 98017, 98737, 98953, 99277, 99577, 99661, 99877);\nmy $k = {};\n$k->{$_} = 1 foreach (@r);\nmy $h = {};\nmy $c = 0;\nfor(my $i = 0; $i < 100000; $i++) {\n $h->{$i} = $c;\n if($k->{$i}) {\n $c++;\n }\n}\nmy $q = - 0;\nforeach(1 ... $q) {\n my ($low, $high) = map { $_ - 0 } split / /,;\n print $h->{$high} - $h->{$low}, \"\\n\";\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "sample_input": "1\n3 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03476", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4875, "cpu_time_ms": 331, "memory_kb": 14592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s572882228", "group_id": "codeNet:p03476", "input_text": "my @r = (3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253, 3313, 3517, 3733, 4021, 4057, 4177, 4261, 4273, 4357, 4441, 4561, 4621, 4933, 5077, 5101, 5113, 5233, 5413, 5437, 5581, 5701, 6037, 6073, 6121, 6133, 6217, 6337, 6361, 6373, 6637, 6661, 6781, 6997, 7057, 7213, 7393, 7417, 7477, 7537, 7753, 7933, 8053, 8101, 8221, 8317, 8353, 8461, 8521, 8677, 8713, 8893, 9013, 9133, 9181, 9241, 9277, 9601, 9661, 9721, 9817, 9901, 9973, 10333, 10357, 10453, 10837, 10861, 10957, 11113, 11161, 11317, 11497, 11677, 11701, 12073, 12157, 12241, 12301, 12421, 12433, 12457, 12541, 12553, 12601, 12721, 12757, 12841, 12853, 13093, 13381, 13417, 13681, 13921, 13933, 14437, 14593, 14737, 14821, 15013, 15073, 15121, 15241, 15277, 15361, 15373, 15733, 15901, 16033, 16333, 16381, 16417, 16573, 16633, 16657, 16921, 17041, 17053, 17077, 17257, 17293, 17377, 17881, 18013, 18097, 18133, 18181, 18217, 18253, 18301, 18313, 18397, 18481, 18553, 18637, 18793, 19237, 19441, 19477, 19717, 19801, 19813, 19861, 20353, 20533, 20641, 20857, 21001, 21061, 21193, 21277, 21313, 21577, 21661, 21673, 21817, 22093, 22501, 22573, 22621, 22993, 23053, 23173, 23557, 23677, 23773, 23917, 24097, 24421, 24481, 24781, 24841, 25033, 25153, 25237, 25561, 25657, 25933, 26017, 26293, 26317, 26437, 26497, 26821, 26833, 26881, 26953, 27073, 27253, 27337, 27361, 27457, 27997, 28057, 28297, 28393, 28813, 28837, 28921, 29101, 29473, 29641, 30181, 30241, 30517, 30553, 30577, 30637, 30661, 30697, 30781, 30853, 31081, 31237, 31321, 31333, 31357, 31477, 31573, 31873, 31981, 32173, 32377, 32497, 32533, 32833, 33037, 33301, 33457, 33493, 33757, 33961, 34057, 34213, 34273, 34381, 34513, 34897, 34981, 35317, 35521, 35677, 35977, 36097, 36241, 36433, 36457, 36793, 36877, 36901, 36913, 37273, 37321, 37357, 37573, 37717, 37957, 38281, 38461, 38833, 38953, 38977, 39217, 39373, 39397, 39733, 40093, 40177, 40213, 40693, 40813, 41017, 41221, 41281, 41413, 41617, 41893, 42061, 42337, 42373, 42793, 42961, 43117, 43177, 43201, 43321, 43573, 43597, 43633, 43717, 44053, 44101, 44221, 44257, 44293, 44893, 45061, 45337, 45433, 45481, 45553, 45613, 45841, 46021, 46141, 46261, 46861, 46993, 47017, 47161, 47353, 47521, 47533, 47653, 47713, 47737, 47797, 47857, 48121, 48193, 48337, 48673, 48757, 48781, 49033, 49261, 49393, 49417, 49597, 49681, 49957, 50221, 50341, 50377, 50821, 50893, 51157, 51217, 51241, 51481, 51517, 51637, 52057, 52081, 52237, 52321, 52453, 52501, 52813, 52861, 52957, 53077, 53113, 53281, 53401, 53917, 54121, 54133, 54181, 54217, 54421, 54517, 54541, 54673, 54721, 54973, 55057, 55381, 55501, 55633, 55837, 55921, 55933, 56053, 56101, 56113, 56197, 56401, 56437, 56701, 56773, 56821, 56857, 56893, 57073, 57097, 57193, 57241, 57373, 57457, 57853, 58153, 58417, 58441, 58537, 58573, 58693, 59053, 59197, 59221, 59281, 59341, 59833, 60217, 60337, 60373, 60637, 60733, 60937, 61057, 61153, 61261, 61297, 61561, 61657, 61681, 61717, 61861, 62137, 62473, 62497, 62533, 62653, 62773, 63313, 63397, 63541, 63697, 63781, 63913, 64153, 64237, 64381, 64513, 64717, 65173, 65293, 65413, 65437, 65497, 65557, 65677, 65881, 66301, 66361, 66601, 66697, 66853, 66973, 67057, 67153, 67273, 67477, 67537, 67741, 67777, 67933, 67993, 68113, 68281, 68521, 68737, 69001, 69073, 69457, 69493, 69697, 69877, 70117, 70177, 70297, 70501, 70621, 70921, 70981, 71233, 71341, 71353, 71593, 71821, 72073, 72481, 72613, 72901, 72937, 73141, 73417, 73477, 73561, 73693, 74077, 74317, 74377, 74713, 75013, 75133, 75181, 75721, 75793, 75913, 76333, 76561, 76597, 76753, 77137, 77641, 78157, 78193, 78277, 78877, 78901, 79333, 79357, 79537, 79657, 79693, 79801, 79873, 80077, 80173, 80221, 80473, 80701, 80713, 80917, 81013, 81181, 81517, 81637, 81853, 82021, 82153, 82261, 82561, 82981, 83077, 83221, 83233, 83437, 83617, 83701, 83773, 84121, 84313, 84673, 84697, 84793, 84913, 85297, 85333, 85453, 85717, 85933, 86353, 86413, 87181, 87253, 87337, 87421, 87433, 87517, 87553, 87973, 88117, 88177, 88237, 88261, 88513, 88741, 88897, 88993, 89293, 89833, 89917, 90121, 91081, 91381, 91393, 91513, 91957, 92041, 92557, 92761, 92821, 92893, 92941, 93097, 93133, 93493, 93637, 93913, 94033, 94117, 94273, 94321, 94441, 94573, 94777, 94837, 94993, 95257, 95317, 95401, 95581, 95617, 95713, 95737, 96097, 96157, 96181, 96493, 96517, 96973, 97081, 97177, 97501, 97561, 97777, 97813, 98017, 98737, 98953, 99277, 99577, 99661, 99877);\nmy $q = - 0;\nforeach(1 ... $q) {\n my ($low, $high) = map { $_ - 0 } split / /,;\n my $c = 0;\n foreach(@r) {\n if($_ >= $low and $_ <= $high) {\n $c++;\n } elsif($_ > $high) {\n last;\n }\n }\n print $c, \"\\n\";\n}", "language": "Perl", "metadata": {"date": 1514693615, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03476.html", "problem_id": "p03476", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03476/input.txt", "sample_output_relpath": "derived/input_output/data/p03476/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03476/Perl/s572882228.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s572882228", "user_id": "u170302265"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "my @r = (3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253, 3313, 3517, 3733, 4021, 4057, 4177, 4261, 4273, 4357, 4441, 4561, 4621, 4933, 5077, 5101, 5113, 5233, 5413, 5437, 5581, 5701, 6037, 6073, 6121, 6133, 6217, 6337, 6361, 6373, 6637, 6661, 6781, 6997, 7057, 7213, 7393, 7417, 7477, 7537, 7753, 7933, 8053, 8101, 8221, 8317, 8353, 8461, 8521, 8677, 8713, 8893, 9013, 9133, 9181, 9241, 9277, 9601, 9661, 9721, 9817, 9901, 9973, 10333, 10357, 10453, 10837, 10861, 10957, 11113, 11161, 11317, 11497, 11677, 11701, 12073, 12157, 12241, 12301, 12421, 12433, 12457, 12541, 12553, 12601, 12721, 12757, 12841, 12853, 13093, 13381, 13417, 13681, 13921, 13933, 14437, 14593, 14737, 14821, 15013, 15073, 15121, 15241, 15277, 15361, 15373, 15733, 15901, 16033, 16333, 16381, 16417, 16573, 16633, 16657, 16921, 17041, 17053, 17077, 17257, 17293, 17377, 17881, 18013, 18097, 18133, 18181, 18217, 18253, 18301, 18313, 18397, 18481, 18553, 18637, 18793, 19237, 19441, 19477, 19717, 19801, 19813, 19861, 20353, 20533, 20641, 20857, 21001, 21061, 21193, 21277, 21313, 21577, 21661, 21673, 21817, 22093, 22501, 22573, 22621, 22993, 23053, 23173, 23557, 23677, 23773, 23917, 24097, 24421, 24481, 24781, 24841, 25033, 25153, 25237, 25561, 25657, 25933, 26017, 26293, 26317, 26437, 26497, 26821, 26833, 26881, 26953, 27073, 27253, 27337, 27361, 27457, 27997, 28057, 28297, 28393, 28813, 28837, 28921, 29101, 29473, 29641, 30181, 30241, 30517, 30553, 30577, 30637, 30661, 30697, 30781, 30853, 31081, 31237, 31321, 31333, 31357, 31477, 31573, 31873, 31981, 32173, 32377, 32497, 32533, 32833, 33037, 33301, 33457, 33493, 33757, 33961, 34057, 34213, 34273, 34381, 34513, 34897, 34981, 35317, 35521, 35677, 35977, 36097, 36241, 36433, 36457, 36793, 36877, 36901, 36913, 37273, 37321, 37357, 37573, 37717, 37957, 38281, 38461, 38833, 38953, 38977, 39217, 39373, 39397, 39733, 40093, 40177, 40213, 40693, 40813, 41017, 41221, 41281, 41413, 41617, 41893, 42061, 42337, 42373, 42793, 42961, 43117, 43177, 43201, 43321, 43573, 43597, 43633, 43717, 44053, 44101, 44221, 44257, 44293, 44893, 45061, 45337, 45433, 45481, 45553, 45613, 45841, 46021, 46141, 46261, 46861, 46993, 47017, 47161, 47353, 47521, 47533, 47653, 47713, 47737, 47797, 47857, 48121, 48193, 48337, 48673, 48757, 48781, 49033, 49261, 49393, 49417, 49597, 49681, 49957, 50221, 50341, 50377, 50821, 50893, 51157, 51217, 51241, 51481, 51517, 51637, 52057, 52081, 52237, 52321, 52453, 52501, 52813, 52861, 52957, 53077, 53113, 53281, 53401, 53917, 54121, 54133, 54181, 54217, 54421, 54517, 54541, 54673, 54721, 54973, 55057, 55381, 55501, 55633, 55837, 55921, 55933, 56053, 56101, 56113, 56197, 56401, 56437, 56701, 56773, 56821, 56857, 56893, 57073, 57097, 57193, 57241, 57373, 57457, 57853, 58153, 58417, 58441, 58537, 58573, 58693, 59053, 59197, 59221, 59281, 59341, 59833, 60217, 60337, 60373, 60637, 60733, 60937, 61057, 61153, 61261, 61297, 61561, 61657, 61681, 61717, 61861, 62137, 62473, 62497, 62533, 62653, 62773, 63313, 63397, 63541, 63697, 63781, 63913, 64153, 64237, 64381, 64513, 64717, 65173, 65293, 65413, 65437, 65497, 65557, 65677, 65881, 66301, 66361, 66601, 66697, 66853, 66973, 67057, 67153, 67273, 67477, 67537, 67741, 67777, 67933, 67993, 68113, 68281, 68521, 68737, 69001, 69073, 69457, 69493, 69697, 69877, 70117, 70177, 70297, 70501, 70621, 70921, 70981, 71233, 71341, 71353, 71593, 71821, 72073, 72481, 72613, 72901, 72937, 73141, 73417, 73477, 73561, 73693, 74077, 74317, 74377, 74713, 75013, 75133, 75181, 75721, 75793, 75913, 76333, 76561, 76597, 76753, 77137, 77641, 78157, 78193, 78277, 78877, 78901, 79333, 79357, 79537, 79657, 79693, 79801, 79873, 80077, 80173, 80221, 80473, 80701, 80713, 80917, 81013, 81181, 81517, 81637, 81853, 82021, 82153, 82261, 82561, 82981, 83077, 83221, 83233, 83437, 83617, 83701, 83773, 84121, 84313, 84673, 84697, 84793, 84913, 85297, 85333, 85453, 85717, 85933, 86353, 86413, 87181, 87253, 87337, 87421, 87433, 87517, 87553, 87973, 88117, 88177, 88237, 88261, 88513, 88741, 88897, 88993, 89293, 89833, 89917, 90121, 91081, 91381, 91393, 91513, 91957, 92041, 92557, 92761, 92821, 92893, 92941, 93097, 93133, 93493, 93637, 93913, 94033, 94117, 94273, 94321, 94441, 94573, 94777, 94837, 94993, 95257, 95317, 95401, 95581, 95617, 95713, 95737, 96097, 96157, 96181, 96493, 96517, 96973, 97081, 97177, 97501, 97561, 97777, 97813, 98017, 98737, 98953, 99277, 99577, 99661, 99877);\nmy $q = - 0;\nforeach(1 ... $q) {\n my ($low, $high) = map { $_ - 0 } split / /,;\n my $c = 0;\n foreach(@r) {\n if($_ >= $low and $_ <= $high) {\n $c++;\n } elsif($_ > $high) {\n last;\n }\n }\n print $c, \"\\n\";\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "sample_input": "1\n3 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03476", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4851, "cpu_time_ms": 2103, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s312874597", "group_id": "codeNet:p03477", "input_text": "#!/usr/bin/perl\n#abc083_a.pl\n#Wed Jan 10 20:22:50 2018\n#\n\nuse warnings;\nuse strict;\n\nmy $temp = ;\nchomp $temp;\n\nmy @temps = split(\" \",$temp);\n\nmy $a = $temps[0];\nmy $b = $temps[1];\nmy $c = $temps[2];\nmy $d = $temps[3];\n\nif ($a+$b > $c+$d){\n\tprint \"Left\\n\";\n}elsif ($a+$b == $c+$d){\n\tprint \"Balanced\\n\";\n}else{\n\tprint \"Right\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1515633950, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03477.html", "problem_id": "p03477", "resource_group": "low_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/Perl/s312874597.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s312874597", "user_id": "u628871447"}, "prompt_components": {"gold_output": "Left\n", "input_to_evaluate": "#!/usr/bin/perl\n#abc083_a.pl\n#Wed Jan 10 20:22:50 2018\n#\n\nuse warnings;\nuse strict;\n\nmy $temp = ;\nchomp $temp;\n\nmy @temps = split(\" \",$temp);\n\nmy $a = $temps[0];\nmy $b = $temps[1];\nmy $c = $temps[2];\nmy $d = $temps[3];\n\nif ($a+$b > $c+$d){\n\tprint \"Left\\n\";\n}elsif ($a+$b == $c+$d){\n\tprint \"Balanced\\n\";\n}else{\n\tprint \"Right\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 337, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s002896789", "group_id": "codeNet:p03477", "input_text": "my @d=split / /,;\nmy $l = $d[0]+$d[1];\nmy $r=$d[2]+$d[3];\nprint 'Left' if $l > $r;\nprint 'Balanced' if $l == $r;\nprint 'Right' if $l < $r;", "language": "Perl", "metadata": {"date": 1514080900, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03477.html", "problem_id": "p03477", "resource_group": "low_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/Perl/s002896789.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s002896789", "user_id": "u170302265"}, "prompt_components": {"gold_output": "Left\n", "input_to_evaluate": "my @d=split / /,;\nmy $l = $d[0]+$d[1];\nmy $r=$d[2]+$d[3];\nprint 'Left' if $l > $r;\nprint 'Balanced' if $l == $r;\nprint 'Right' if $l < $r;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s549460838", "group_id": "codeNet:p03479", "input_text": "<>=~$\";++$\\while$`<<$\\<=$';print", "language": "Perl", "metadata": {"date": 1561643636, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03479.html", "problem_id": "p03479", "resource_group": "low_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/Perl/s549460838.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s549460838", "user_id": "u573154728"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>=~$\";++$\\while$`<<$\\<=$';print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s733951834", "group_id": "codeNet:p03481", "input_text": "($n,$m)=glob<>;\n$i++,$n*=2 until($m<$n);\nprint$i", "language": "Perl", "metadata": {"date": 1559230884, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03481.html", "problem_id": "p03481", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03481/input.txt", "sample_output_relpath": "derived/input_output/data/p03481/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03481/Perl/s733951834.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s733951834", "user_id": "u573154728"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "($n,$m)=glob<>;\n$i++,$n*=2 until($m<$n);\nprint$i", "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": "p03481", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 48, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s710602865", "group_id": "codeNet:p03481", "input_text": "use bigint;<>=~$\";$\\++until$'<$`*2**$\\;print", "language": "Perl", "metadata": {"date": 1514081663, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03481.html", "problem_id": "p03481", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03481/input.txt", "sample_output_relpath": "derived/input_output/data/p03481/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03481/Perl/s710602865.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s710602865", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use bigint;<>=~$\";$\\++until$'<$`*2**$\\;print", "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": "p03481", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 44, "cpu_time_ms": 31, "memory_kb": 4992}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s052690723", "group_id": "codeNet:p03482", "input_text": "$S=;chomp $S;\n\n$L=length($S);\n\nif($L % 2==0) {\n\t$r=$L/2;\n\t$i=int($L/2);$j=1;\n\t$c=substr($S,$i,1);\n\twhile ( $r<$L && substr($S, $i-$j,1) eq $c && substr($S,$i+$j-1,1) eq $c ) {\n\t\t$j+=1;\n\t\t$r+=1;\n\t}\n} else {\n\t$r=($L+1)/2;\n\t$i=int($L/2);$j=1;\n\t$c=substr($S,$i,1);\n\twhile ( $r<$L && substr($S, $i-$j,1) eq $c && substr($S,$i+$j,1) eq $c ) {\n\t\t$j+=1;\n\t\t$r+=1;\n\t}\n}\nprint $r;\n", "language": "Perl", "metadata": {"date": 1516270570, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03482.html", "problem_id": "p03482", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03482/input.txt", "sample_output_relpath": "derived/input_output/data/p03482/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03482/Perl/s052690723.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s052690723", "user_id": "u420702888"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$S=;chomp $S;\n\n$L=length($S);\n\nif($L % 2==0) {\n\t$r=$L/2;\n\t$i=int($L/2);$j=1;\n\t$c=substr($S,$i,1);\n\twhile ( $r<$L && substr($S, $i-$j,1) eq $c && substr($S,$i+$j-1,1) eq $c ) {\n\t\t$j+=1;\n\t\t$r+=1;\n\t}\n} else {\n\t$r=($L+1)/2;\n\t$i=int($L/2);$j=1;\n\t$c=substr($S,$i,1);\n\twhile ( $r<$L && substr($S, $i-$j,1) eq $c && substr($S,$i+$j,1) eq $c ) {\n\t\t$j+=1;\n\t\t$r+=1;\n\t}\n}\nprint $r;\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S consisting of 0 and 1.\nFind the maximum integer K not greater than |S| such that we can turn all the characters of S into 0 by repeating the following operation some number of times.\n\nChoose a contiguous segment [l,r] in S whose length is at least K (that is, r-l+1\\geq K must be satisfied). For each integer i such that l\\leq i\\leq r, do the following: if S_i is 0, replace it with 1; if S_i is 1, replace it with 0.\n\nConstraints\n\n1\\leq |S|\\leq 10^5\n\nS_i(1\\leq i\\leq N) is either 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum integer K such that we can turn all the characters of S into 0 by repeating the operation some number of times.\n\nSample Input 1\n\n010\n\nSample Output 1\n\n2\n\nWe can turn all the characters of S into 0 by the following operations:\n\nPerform the operation on the segment S[1,3] with length 3. S is now 101.\n\nPerform the operation on the segment S[1,2] with length 2. S is now 011.\n\nPerform the operation on the segment S[2,3] with length 2. S is now 000.\n\nSample Input 2\n\n100000000\n\nSample Output 2\n\n8\n\nSample Input 3\n\n00001111\n\nSample Output 3\n\n4", "sample_input": "010\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03482", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S consisting of 0 and 1.\nFind the maximum integer K not greater than |S| such that we can turn all the characters of S into 0 by repeating the following operation some number of times.\n\nChoose a contiguous segment [l,r] in S whose length is at least K (that is, r-l+1\\geq K must be satisfied). For each integer i such that l\\leq i\\leq r, do the following: if S_i is 0, replace it with 1; if S_i is 1, replace it with 0.\n\nConstraints\n\n1\\leq |S|\\leq 10^5\n\nS_i(1\\leq i\\leq N) is either 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum integer K such that we can turn all the characters of S into 0 by repeating the operation some number of times.\n\nSample Input 1\n\n010\n\nSample Output 1\n\n2\n\nWe can turn all the characters of S into 0 by the following operations:\n\nPerform the operation on the segment S[1,3] with length 3. S is now 101.\n\nPerform the operation on the segment S[1,2] with length 2. S is now 011.\n\nPerform the operation on the segment S[2,3] with length 2. S is now 000.\n\nSample Input 2\n\n100000000\n\nSample Output 2\n\n8\n\nSample Input 3\n\n00001111\n\nSample Output 3\n\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 377, "cpu_time_ms": 21, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s671942961", "group_id": "codeNet:p03485", "input_text": "#!/usr/bin/perl\n#abc082_a.pl\n#Thu Jan 11 23:07:27 2018\n#\n\nuse warnings;\nuse strict;\n\nmy $temp = ;\nchomp $temp;\n\nmy @temps = split(\" \",$temp);\n\nmy $a = $temps[0];\nmy $b = $temps[1];\n\nif (($a+$b)%2>0){\n\tprint int(($a+$b)/2)+1,\"\\n\";\n}else{\n\tprint int(($a+$b)/2),\"\\n\";\n}", "language": "Perl", "metadata": {"date": 1515730188, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03485.html", "problem_id": "p03485", "resource_group": "low_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/Perl/s671942961.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s671942961", "user_id": "u628871447"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n#abc082_a.pl\n#Thu Jan 11 23:07:27 2018\n#\n\nuse warnings;\nuse strict;\n\nmy $temp = ;\nchomp $temp;\n\nmy @temps = split(\" \",$temp);\n\nmy $a = $temps[0];\nmy $b = $temps[1];\n\nif (($a+$b)%2>0){\n\tprint int(($a+$b)/2)+1,\"\\n\";\n}else{\n\tprint int(($a+$b)/2),\"\\n\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s132071005", "group_id": "codeNet:p03485", "input_text": "say 2 Rdiv sum words get", "language": "Perl", "metadata": {"date": 1513492297, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03485.html", "problem_id": "p03485", "resource_group": "low_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/Perl/s132071005.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s132071005", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "say 2 Rdiv sum words get", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 24, "cpu_time_ms": 126, "memory_kb": 48500}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s495727657", "group_id": "codeNet:p03485", "input_text": "use v5.18;\nuse warnings;\nuse utf8;\n\nsub line {\n chomp(my $str = <>);\n $str;\n}\n\nsub split_line {\n (split / /, line);\n}\n\nmy ($l, $r) = split_line;\nsay( int( ($l + $r) / 2 + 0.5) );\n", "language": "Perl", "metadata": {"date": 1513479019, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03485.html", "problem_id": "p03485", "resource_group": "low_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/Perl/s495727657.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s495727657", "user_id": "u376692089"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nuse utf8;\n\nsub line {\n chomp(my $str = <>);\n $str;\n}\n\nsub split_line {\n (split / /, line);\n}\n\nmy ($l, $r) = split_line;\nsay( int( ($l + $r) / 2 + 0.5) );\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s470048168", "group_id": "codeNet:p03486", "input_text": "print\"@{[sort{$a cmp$b}<>=~/./g]}\"lt\"@{[sort{$b cmp$a}<>=~/./g]}\"?Yes:No", "language": "Perl", "metadata": {"date": 1513482910, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03486.html", "problem_id": "p03486", "resource_group": "low_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/Perl/s470048168.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s470048168", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print\"@{[sort{$a cmp$b}<>=~/./g]}\"lt\"@{[sort{$b cmp$a}<>=~/./g]}\"?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s888241490", "group_id": "codeNet:p03486", "input_text": "use v5.18;\nuse warnings;\nuse utf8;\nuse Data::Dumper;\nuse List::Util qw( sum );\nuse Test::More;\n\nsub line { chomp(my $str = <>); $str; }\nsub split_line { (split / /, line) }\n\nmain();\n\nsub main {\n my ($str1, $str2) = split_line;\n say solve($str1, $str2) ? 'Yes' : 'No';\n}\n\nsub ord_sum_sort_small {\n my ($str, $len) = @_;\n my @ords = ( sort { $a <=> $b } map { ord $_ } split //, $str )[0 .. $len - 1];\n sum @ords;\n}\n\nsub ord_sum_sort_big {\n my ($str, $len) = @_;\n my @ords = ( sort { $b <=> $a } map { ord $_ } split //, $str )[0 .. $len - 1];\n sum @ords;\n}\n\nsub solve {\n my ($str1, $str2) = @_;\n my $len = length($str1) < length($str2) ? length($str1) : length($str2);\n my $s1_ord_sum = ord_sum_sort_small($str1, $len);\n my $s2_ord_sum = ord_sum_sort_big($str2, $len);\n if ($s1_ord_sum < $s2_ord_sum) {\n 1;\n }\n elsif ($s1_ord_sum == $s2_ord_sum) {\n length $str1 < length $str2;\n }\n else {\n 0;\n }\n}\n", "language": "Perl", "metadata": {"date": 1513481256, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03486.html", "problem_id": "p03486", "resource_group": "low_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/Perl/s888241490.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s888241490", "user_id": "u376692089"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nuse utf8;\nuse Data::Dumper;\nuse List::Util qw( sum );\nuse Test::More;\n\nsub line { chomp(my $str = <>); $str; }\nsub split_line { (split / /, line) }\n\nmain();\n\nsub main {\n my ($str1, $str2) = split_line;\n say solve($str1, $str2) ? 'Yes' : 'No';\n}\n\nsub ord_sum_sort_small {\n my ($str, $len) = @_;\n my @ords = ( sort { $a <=> $b } map { ord $_ } split //, $str )[0 .. $len - 1];\n sum @ords;\n}\n\nsub ord_sum_sort_big {\n my ($str, $len) = @_;\n my @ords = ( sort { $b <=> $a } map { ord $_ } split //, $str )[0 .. $len - 1];\n sum @ords;\n}\n\nsub solve {\n my ($str1, $str2) = @_;\n my $len = length($str1) < length($str2) ? length($str1) : length($str2);\n my $s1_ord_sum = ord_sum_sort_small($str1, $len);\n my $s2_ord_sum = ord_sum_sort_big($str2, $len);\n if ($s1_ord_sum < $s2_ord_sum) {\n 1;\n }\n elsif ($s1_ord_sum == $s2_ord_sum) {\n length $str1 < length $str2;\n }\n else {\n 0;\n }\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 924, "cpu_time_ms": 25, "memory_kb": 3452}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s031700866", "group_id": "codeNet:p03490", "input_text": "<>=~s#F+#push@{$`=~y/T//&1},length$&#ger;\n($x,$y)=glob<>;$x-=shift@0;\n@$_=sort{$a-$b}@$_ for 0,1;\n$x>0?$x-=$_:($x+=$_)for@0;\n$y>0?$y-=$_:($y+=$_)for@1;\nprint$x|$y?No:Yes", "language": "Perl", "metadata": {"date": 1539842669, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03490.html", "problem_id": "p03490", "resource_group": "low_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/Perl/s031700866.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s031700866", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "<>=~s#F+#push@{$`=~y/T//&1},length$&#ger;\n($x,$y)=glob<>;$x-=shift@0;\n@$_=sort{$a-$b}@$_ for 0,1;\n$x>0?$x-=$_:($x+=$_)for@0;\n$y>0?$y-=$_:($y+=$_)for@1;\nprint$x|$y?No:Yes", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 21, "memory_kb": 1152}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s152772173", "group_id": "codeNet:p03490", "input_text": "$_=<>;\n($x,$y)=glob<>;\n/^F*/;\n@0=length$&;\n@1=0;\nfor(/TF*/g){\n\t$l=-1+length;\n\t--$|;\n\t%h=();\n\t++$h{$_+$l},++$h{$_-$l}for@{$|};\n\t@{$|}=keys%h;\n}\nprint grep($_==$x,@0)&&grep($_==$y,@1)?Yes:No\n", "language": "Perl", "metadata": {"date": 1513481052, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03490.html", "problem_id": "p03490", "resource_group": "low_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/Perl/s152772173.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s152772173", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$_=<>;\n($x,$y)=glob<>;\n/^F*/;\n@0=length$&;\n@1=0;\nfor(/TF*/g){\n\t$l=-1+length;\n\t--$|;\n\t%h=();\n\t++$h{$_+$l},++$h{$_-$l}for@{$|};\n\t@{$|}=keys%h;\n}\nprint grep($_==$x,@0)&&grep($_==$y,@1)?Yes:No\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2103, "memory_kb": 2560}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s245249586", "group_id": "codeNet:p03491", "input_text": "$t=0,/ /?$%=$':map$t=$$_[$t]||=++$k,/./g for<>;sub f{$z^=$%--*($_?&f:1)&-++$%for$0[$_],$1[$_]}f;print$z?Alice:Bob", "language": "Perl", "metadata": {"date": 1568502317, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03491.html", "problem_id": "p03491", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03491/input.txt", "sample_output_relpath": "derived/input_output/data/p03491/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03491/Perl/s245249586.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s245249586", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": "$t=0,/ /?$%=$':map$t=$$_[$t]||=++$k,/./g for<>;sub f{$z^=$%--*($_?&f:1)&-++$%for$0[$_],$1[$_]}f;print$z?Alice:Bob", "problem_context": "Score : 700 points\n\nProblem Statement\n\nFor strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other.\n\nLet L be a positive integer. A set of strings S is a good string set when the following conditions hold true:\n\nEach string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1.\n\nAny two distinct strings in S are prefix-free.\n\nWe have a good string set S = \\{ s_1, s_2, ..., s_N \\}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice:\n\nAdd a new string to S. After addition, S must still be a good string set.\n\nThe first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq L \\leq 10^{18}\n\ns_1, s_2, ..., s_N are all distinct.\n\n{ s_1, s_2, ..., s_N } is a good string set.\n\n|s_1| + |s_2| + ... + |s_N| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf Alice will win, print Alice; if Bob will win, print Bob.\n\nSample Input 1\n\n2 2\n00\n01\n\nSample Output 1\n\nAlice\n\nIf Alice adds 1, Bob will be unable to add a new string.\n\nSample Input 2\n\n2 2\n00\n11\n\nSample Output 2\n\nBob\n\nThere are two strings that Alice can add on the first turn: 01 and 10.\nIn case she adds 01, if Bob add 10, she will be unable to add a new string.\nAlso, in case she adds 10, if Bob add 01, she will be unable to add a new string.\n\nSample Input 3\n\n3 3\n0\n10\n110\n\nSample Output 3\n\nAlice\n\nIf Alice adds 111, Bob will be unable to add a new string.\n\nSample Input 4\n\n2 1\n0\n1\n\nSample Output 4\n\nBob\n\nAlice is unable to add a new string on the first turn.\n\nSample Input 5\n\n1 2\n11\n\nSample Output 5\n\nAlice\n\nSample Input 6\n\n2 3\n101\n11\n\nSample Output 6\n\nBob", "sample_input": "2 2\n00\n01\n"}, "reference_outputs": ["Alice\n"], "source_document_id": "p03491", "source_text": "Score : 700 points\n\nProblem Statement\n\nFor strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other.\n\nLet L be a positive integer. A set of strings S is a good string set when the following conditions hold true:\n\nEach string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1.\n\nAny two distinct strings in S are prefix-free.\n\nWe have a good string set S = \\{ s_1, s_2, ..., s_N \\}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice:\n\nAdd a new string to S. After addition, S must still be a good string set.\n\nThe first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq L \\leq 10^{18}\n\ns_1, s_2, ..., s_N are all distinct.\n\n{ s_1, s_2, ..., s_N } is a good string set.\n\n|s_1| + |s_2| + ... + |s_N| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf Alice will win, print Alice; if Bob will win, print Bob.\n\nSample Input 1\n\n2 2\n00\n01\n\nSample Output 1\n\nAlice\n\nIf Alice adds 1, Bob will be unable to add a new string.\n\nSample Input 2\n\n2 2\n00\n11\n\nSample Output 2\n\nBob\n\nThere are two strings that Alice can add on the first turn: 01 and 10.\nIn case she adds 01, if Bob add 10, she will be unable to add a new string.\nAlso, in case she adds 10, if Bob add 01, she will be unable to add a new string.\n\nSample Input 3\n\n3 3\n0\n10\n110\n\nSample Output 3\n\nAlice\n\nIf Alice adds 111, Bob will be unable to add a new string.\n\nSample Input 4\n\n2 1\n0\n1\n\nSample Output 4\n\nBob\n\nAlice is unable to add a new string on the first turn.\n\nSample Input 5\n\n1 2\n11\n\nSample Output 5\n\nAlice\n\nSample Input 6\n\n2 3\n101\n11\n\nSample Output 6\n\nBob", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 113, "cpu_time_ms": 253, "memory_kb": 87008}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s559624271", "group_id": "codeNet:p03491", "input_text": "($N,$L)=glob<>;\nfor(<>){\n\t$t=-1;\n\tfor(/./g){\n\t\t++${$t=$t*2-$_}\n\t}\n}\nsub f{my($t,$x)=@_;\n\tfor$i(0,1){\n\t\tif(${$t*2-$i}){\n\t\t\tf($t*2-$i,$x-1)\n\t\t}else{\n\t\t\t$z^=$x&-$x\n\t\t}\n\t}\n}\nf-1,$L;\nprint$z?Alice:Bob\n", "language": "Perl", "metadata": {"date": 1568470071, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03491.html", "problem_id": "p03491", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03491/input.txt", "sample_output_relpath": "derived/input_output/data/p03491/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03491/Perl/s559624271.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s559624271", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": "($N,$L)=glob<>;\nfor(<>){\n\t$t=-1;\n\tfor(/./g){\n\t\t++${$t=$t*2-$_}\n\t}\n}\nsub f{my($t,$x)=@_;\n\tfor$i(0,1){\n\t\tif(${$t*2-$i}){\n\t\t\tf($t*2-$i,$x-1)\n\t\t}else{\n\t\t\t$z^=$x&-$x\n\t\t}\n\t}\n}\nf-1,$L;\nprint$z?Alice:Bob\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nFor strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other.\n\nLet L be a positive integer. A set of strings S is a good string set when the following conditions hold true:\n\nEach string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1.\n\nAny two distinct strings in S are prefix-free.\n\nWe have a good string set S = \\{ s_1, s_2, ..., s_N \\}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice:\n\nAdd a new string to S. After addition, S must still be a good string set.\n\nThe first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq L \\leq 10^{18}\n\ns_1, s_2, ..., s_N are all distinct.\n\n{ s_1, s_2, ..., s_N } is a good string set.\n\n|s_1| + |s_2| + ... + |s_N| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf Alice will win, print Alice; if Bob will win, print Bob.\n\nSample Input 1\n\n2 2\n00\n01\n\nSample Output 1\n\nAlice\n\nIf Alice adds 1, Bob will be unable to add a new string.\n\nSample Input 2\n\n2 2\n00\n11\n\nSample Output 2\n\nBob\n\nThere are two strings that Alice can add on the first turn: 01 and 10.\nIn case she adds 01, if Bob add 10, she will be unable to add a new string.\nAlso, in case she adds 10, if Bob add 01, she will be unable to add a new string.\n\nSample Input 3\n\n3 3\n0\n10\n110\n\nSample Output 3\n\nAlice\n\nIf Alice adds 111, Bob will be unable to add a new string.\n\nSample Input 4\n\n2 1\n0\n1\n\nSample Output 4\n\nBob\n\nAlice is unable to add a new string on the first turn.\n\nSample Input 5\n\n1 2\n11\n\nSample Output 5\n\nAlice\n\nSample Input 6\n\n2 3\n101\n11\n\nSample Output 6\n\nBob", "sample_input": "2 2\n00\n01\n"}, "reference_outputs": ["Alice\n"], "source_document_id": "p03491", "source_text": "Score : 700 points\n\nProblem Statement\n\nFor strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other.\n\nLet L be a positive integer. A set of strings S is a good string set when the following conditions hold true:\n\nEach string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1.\n\nAny two distinct strings in S are prefix-free.\n\nWe have a good string set S = \\{ s_1, s_2, ..., s_N \\}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice:\n\nAdd a new string to S. After addition, S must still be a good string set.\n\nThe first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq L \\leq 10^{18}\n\ns_1, s_2, ..., s_N are all distinct.\n\n{ s_1, s_2, ..., s_N } is a good string set.\n\n|s_1| + |s_2| + ... + |s_N| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf Alice will win, print Alice; if Bob will win, print Bob.\n\nSample Input 1\n\n2 2\n00\n01\n\nSample Output 1\n\nAlice\n\nIf Alice adds 1, Bob will be unable to add a new string.\n\nSample Input 2\n\n2 2\n00\n11\n\nSample Output 2\n\nBob\n\nThere are two strings that Alice can add on the first turn: 01 and 10.\nIn case she adds 01, if Bob add 10, she will be unable to add a new string.\nAlso, in case she adds 10, if Bob add 01, she will be unable to add a new string.\n\nSample Input 3\n\n3 3\n0\n10\n110\n\nSample Output 3\n\nAlice\n\nIf Alice adds 111, Bob will be unable to add a new string.\n\nSample Input 4\n\n2 1\n0\n1\n\nSample Output 4\n\nBob\n\nAlice is unable to add a new string on the first turn.\n\nSample Input 5\n\n1 2\n11\n\nSample Output 5\n\nAlice\n\nSample Input 6\n\n2 3\n101\n11\n\nSample Output 6\n\nBob", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2187, "memory_kb": 1285588}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s738184444", "group_id": "codeNet:p03494", "input_text": "$n = <>;\n@a = glob<>;\n$ans = 1<<29;\nfor (@a){\n $cnt=0;\n while ($_%2==0){\n $_/=2;\n $cnt++;\n }\n $ans=$cnt if $ans > $cnt\n}\nprint $ans", "language": "Perl", "metadata": {"date": 1599491653, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p03494.html", "problem_id": "p03494", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03494/input.txt", "sample_output_relpath": "derived/input_output/data/p03494/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03494/Perl/s738184444.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s738184444", "user_id": "u636683284"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$n = <>;\n@a = glob<>;\n$ans = 1<<29;\nfor (@a){\n $cnt=0;\n while ($_%2==0){\n $_/=2;\n $cnt++;\n }\n $ans=$cnt if $ans > $cnt\n}\nprint $ans", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\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 maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "sample_input": "3\n8 12 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03494", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\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 maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 12, "memory_kb": 5348}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s181570671", "group_id": "codeNet:p03494", "input_text": "get;say lsb [+|] words", "language": "Perl", "metadata": {"date": 1589426628, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03494.html", "problem_id": "p03494", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03494/input.txt", "sample_output_relpath": "derived/input_output/data/p03494/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03494/Perl/s181570671.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s181570671", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get;say lsb [+|] words", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\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 maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "sample_input": "3\n8 12 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03494", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\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 maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 22, "cpu_time_ms": 178, "memory_kb": 83292}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s351629815", "group_id": "codeNet:p03494", "input_text": "use strict;\nuse warnings;\n \nchomp(my $input_text = <>);\nmy @text = split / /, $input_text;\n\nmy $j=1;\n\nwhile(){\n my $i =0;\n while($i <= $#text){\n if($text[$i] % (2**$j) != 0 ){\n $j--;\n print $j;\n exit(0);\n }\n $i++;\n }\n $j++;\n}\n", "language": "Perl", "metadata": {"date": 1581938289, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03494.html", "problem_id": "p03494", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03494/input.txt", "sample_output_relpath": "derived/input_output/data/p03494/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03494/Perl/s351629815.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s351629815", "user_id": "u783415940"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use strict;\nuse warnings;\n \nchomp(my $input_text = <>);\nmy @text = split / /, $input_text;\n\nmy $j=1;\n\nwhile(){\n my $i =0;\n while($i <= $#text){\n if($text[$i] % (2**$j) != 0 ){\n $j--;\n print $j;\n exit(0);\n }\n $i++;\n }\n $j++;\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\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 maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "sample_input": "3\n8 12 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03494", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\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 maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s769261698", "group_id": "codeNet:p03495", "input_text": "my($n,$k)=split/ /,;\nmy@p=split/ /,;\nmy%s=();\n$s{$_}++foreach@p;\nmy@l=sort{$s{$b}-$s{$a}}keys(%s);\nsplice @l,0,$k;\n$n=0;\n$n+=$s{$_}foreach@l;\nprint $n;", "language": "Perl", "metadata": {"date": 1514144910, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03495.html", "problem_id": "p03495", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03495/input.txt", "sample_output_relpath": "derived/input_output/data/p03495/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03495/Perl/s769261698.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s769261698", "user_id": "u170302265"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "my($n,$k)=split/ /,;\nmy@p=split/ /,;\nmy%s=();\n$s{$_}++foreach@p;\nmy@l=sort{$s{$b}-$s{$a}}keys(%s);\nsplice @l,0,$k;\n$n=0;\n$n+=$s{$_}foreach@l;\nprint $n;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi has N balls. Initially, an integer A_i is written on the i-th ball.\n\nHe would like to rewrite the integer on some balls so that there are at most K different integers written on the N balls.\n\nFind the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 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 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nSample Input 1\n\n5 2\n1 1 2 2 5\n\nSample Output 1\n\n1\n\nFor example, if we rewrite the integer on the fifth ball to 2, there are two different integers written on the balls: 1 and 2.\nOn the other hand, it is not possible to rewrite the integers on zero balls so that there are at most two different integers written on the balls, so we should print 1.\n\nSample Input 2\n\n4 4\n1 1 2 2\n\nSample Output 2\n\n0\n\nAlready in the beginning, there are two different integers written on the balls, so we do not need to rewrite anything.\n\nSample Input 3\n\n10 3\n5 1 3 2 4 1 1 2 3 4\n\nSample Output 3\n\n3", "sample_input": "5 2\n1 1 2 2 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03495", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi has N balls. Initially, an integer A_i is written on the i-th ball.\n\nHe would like to rewrite the integer on some balls so that there are at most K different integers written on the N balls.\n\nFind the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 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 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nSample Input 1\n\n5 2\n1 1 2 2 5\n\nSample Output 1\n\n1\n\nFor example, if we rewrite the integer on the fifth ball to 2, there are two different integers written on the balls: 1 and 2.\nOn the other hand, it is not possible to rewrite the integers on zero balls so that there are at most two different integers written on the balls, so we should print 1.\n\nSample Input 2\n\n4 4\n1 1 2 2\n\nSample Output 2\n\n0\n\nAlready in the beginning, there are two different integers written on the balls, so we do not need to rewrite anything.\n\nSample Input 3\n\n10 3\n5 1 3 2 4 1 1 2 3 4\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 415, "memory_kb": 60872}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s142085157", "group_id": "codeNet:p03496", "input_text": "$n=<>;@A=glob<>;$M=-1e7;$m=1e7;\nfor(0..$n-1){\n if($A[$_]>$M){\n $M=$A[$_];$Mi=$_;\n }\n if($A[$_]<$m){\n $m=$A[$_];$mi=$_;\n }\n}\nif($M*$m<0){\nprint $n*2-1,$/;\n$i=($M+$m>=0)?$Mi+1:$mi+1;\nprint\"$i $_\\n\"for 1..$n;\n}else{print $n-1,$/}\nif($M+$m<0){\n print $n-$_,$\",$n-$_-1,$/ for 0..$n-2\n}\nelse{\n print $_,$\",$_+1,$/ for 1..$n-1\n}", "language": "Perl", "metadata": {"date": 1562160969, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03496.html", "problem_id": "p03496", "resource_group": "low_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/Perl/s142085157.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s142085157", "user_id": "u573154728"}, "prompt_components": {"gold_output": "2\n2 3\n3 3\n", "input_to_evaluate": "$n=<>;@A=glob<>;$M=-1e7;$m=1e7;\nfor(0..$n-1){\n if($A[$_]>$M){\n $M=$A[$_];$Mi=$_;\n }\n if($A[$_]<$m){\n $m=$A[$_];$mi=$_;\n }\n}\nif($M*$m<0){\nprint $n*2-1,$/;\n$i=($M+$m>=0)?$Mi+1:$mi+1;\nprint\"$i $_\\n\"for 1..$n;\n}else{print $n-1,$/}\nif($M+$m<0){\n print $n-$_,$\",$n-$_-1,$/ for 0..$n-2\n}\nelse{\n print $_,$\",$_+1,$/ for 1..$n-1\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 353, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s575913944", "group_id": "codeNet:p03497", "input_text": "$/=get.words;say (+<-.min],:k),++$).put xx($_=+<-.min],:k),++$).put xx($_=+<+0;\n@P=split \" \",;\n\nunshift @P,-1;\nfor($i=1;$i<=$N;$i++) {\n\tpush @{$IP[$P[$i]]},$i;\n}\n$m=1000000007;\n$sum=0;\nfor($i=0;$i<=$N;$i++) { $A[$i]=1;$B[$i]=1;$C[$i]=1; }\nwhile($C[0]!=0) {\n\t$sum=($sum + $A[0]*&pow($N+1-$C[0])) % $m;\n\tfor($i=0;$i<=$N;$i++) {\n\t\t$A[$i]=0;$B[$i]=0;$C[$i]=0;\n\t\tfor($j=0;$j<=$#{$IP[$i]};$j++) {\n\t\t\t$C[$i]+=$C[$IP[$i][$j]];\n\t\t\t$p=$A[$IP[$i][$j]];\n\t\t\tfor($k=0;$k<=$#{$IP[$i]};$k++) {\n\t\t\t\tnext if($j==$k);\n\t\t\t\t$p=($p*$B[$IP[$i][$k]) % $m;\n\t\t\t}\n\t\t\t$A[$i]+=$p;\n\t\t}\n\t\t$A[$i] = $A[$i] % $m;\n\t\t$B[$i] = (&pow($C[$i]) - $A[$i] + $m) % $m;\n\t}\n}\nprint $sum;\n\nsub pow() {\n\tmy $pp=1;\n\tmy $i;\n\tfor($i=0;$i<$_[0];$i++) { $pp=($pp*2) % $m; }\n\treturn $pp;\n}\n", "language": "Perl", "metadata": {"date": 1516140630, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03499.html", "problem_id": "p03499", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03499/input.txt", "sample_output_relpath": "derived/input_output/data/p03499/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03499/Perl/s617769186.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s617769186", "user_id": "u420702888"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "$N = +0;\n@P=split \" \",;\n\nunshift @P,-1;\nfor($i=1;$i<=$N;$i++) {\n\tpush @{$IP[$P[$i]]},$i;\n}\n$m=1000000007;\n$sum=0;\nfor($i=0;$i<=$N;$i++) { $A[$i]=1;$B[$i]=1;$C[$i]=1; }\nwhile($C[0]!=0) {\n\t$sum=($sum + $A[0]*&pow($N+1-$C[0])) % $m;\n\tfor($i=0;$i<=$N;$i++) {\n\t\t$A[$i]=0;$B[$i]=0;$C[$i]=0;\n\t\tfor($j=0;$j<=$#{$IP[$i]};$j++) {\n\t\t\t$C[$i]+=$C[$IP[$i][$j]];\n\t\t\t$p=$A[$IP[$i][$j]];\n\t\t\tfor($k=0;$k<=$#{$IP[$i]};$k++) {\n\t\t\t\tnext if($j==$k);\n\t\t\t\t$p=($p*$B[$IP[$i][$k]) % $m;\n\t\t\t}\n\t\t\t$A[$i]+=$p;\n\t\t}\n\t\t$A[$i] = $A[$i] % $m;\n\t\t$B[$i] = (&pow($C[$i]) - $A[$i] + $m) % $m;\n\t}\n}\nprint $sum;\n\nsub pow() {\n\tmy $pp=1;\n\tmy $i;\n\tfor($i=0;$i<$_[0];$i++) { $pp=($pp*2) % $m; }\n\treturn $pp;\n}\n", "problem_context": "Score : 1000 points\n\nProblem Statement\n\nSnuke has a rooted tree with N+1 vertices.\nThe vertices are numbered 0 through N, and Vertex 0 is the root of the tree.\nThe parent of Vertex i (1 \\leq i \\leq N) is Vertex p_i.\n\nBesides this tree, Snuke also has an box which is initially empty and many marbles, and playing with them.\nThe play begins with placing one marble on some of the vertices, then proceeds as follows:\n\nIf there is a marble on Vertex 0, move the marble into the box.\n\nMove each marble from the vertex to its parent (all at once).\n\nFor each vertex occupied by two or more marbles, remove all the marbles from the vertex.\n\nIf there exists a vertex with some marbles, go to Step 1. Otherwise, end the play.\n\nThere are 2^{N+1} ways to place marbles on some of the vertices.\nFor each of them, find the number of marbles that will be in the box at the end of the play, and compute the sum of all those numbers modulo 1,000,000,007.\n\nConstraints\n\n1 \\leq N < 2 \\times 10^{5}\n\n0 \\leq p_i < i\n\nPartial Scores\n\nIn the test set worth 400 points, N < 2{,}000.\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 answer.\n\nSample Input 1\n\n2\n0 0\n\nSample Output 1\n\n8\n\nWhen we place a marble on both Vertex 1 and 2, there will be multiple marbles on Vertex 0 by step 2. In such a case, these marbles will be removed instead of being moved to the box.\n\nSample Input 2\n\n5\n0 1 1 0 4\n\nSample Output 2\n\n96\n\nSample Input 3\n\n31\n0 1 0 2 4 0 4 1 6 4 3 9 7 3 7 2 15 6 12 10 12 16 5 3 20 1 25 20 23 24 23\n\nSample Output 3\n\n730395550\n\nBe sure to compute the sum modulo 1,000,000,007.", "sample_input": "2\n0 0\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03499", "source_text": "Score : 1000 points\n\nProblem Statement\n\nSnuke has a rooted tree with N+1 vertices.\nThe vertices are numbered 0 through N, and Vertex 0 is the root of the tree.\nThe parent of Vertex i (1 \\leq i \\leq N) is Vertex p_i.\n\nBesides this tree, Snuke also has an box which is initially empty and many marbles, and playing with them.\nThe play begins with placing one marble on some of the vertices, then proceeds as follows:\n\nIf there is a marble on Vertex 0, move the marble into the box.\n\nMove each marble from the vertex to its parent (all at once).\n\nFor each vertex occupied by two or more marbles, remove all the marbles from the vertex.\n\nIf there exists a vertex with some marbles, go to Step 1. Otherwise, end the play.\n\nThere are 2^{N+1} ways to place marbles on some of the vertices.\nFor each of them, find the number of marbles that will be in the box at the end of the play, and compute the sum of all those numbers modulo 1,000,000,007.\n\nConstraints\n\n1 \\leq N < 2 \\times 10^{5}\n\n0 \\leq p_i < i\n\nPartial Scores\n\nIn the test set worth 400 points, N < 2{,}000.\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 answer.\n\nSample Input 1\n\n2\n0 0\n\nSample Output 1\n\n8\n\nWhen we place a marble on both Vertex 1 and 2, there will be multiple marbles on Vertex 0 by step 2. In such a case, these marbles will be removed instead of being moved to the box.\n\nSample Input 2\n\n5\n0 1 1 0 4\n\nSample Output 2\n\n96\n\nSample Input 3\n\n31\n0 1 0 2 4 0 4 1 6 4 3 9 7 3 7 2 15 6 12 10 12 16 5 3 20 1 25 20 23 24 23\n\nSample Output 3\n\n730395550\n\nBe sure to compute the sum modulo 1,000,000,007.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 680, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s840851741", "group_id": "codeNet:p03501", "input_text": "print<>!~/ .* /,($`*$&,$')[$`*$&>$']", "language": "Perl", "metadata": {"date": 1550872706, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03501.html", "problem_id": "p03501", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03501/input.txt", "sample_output_relpath": "derived/input_output/data/p03501/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03501/Perl/s840851741.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s840851741", "user_id": "u832039789"}, "prompt_components": {"gold_output": "119\n", "input_to_evaluate": "print<>!~/ .* /,($`*$&,$')[$`*$&>$']", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are parking at a parking lot. You can choose from the following two fee plans:\n\nPlan 1: The fee will be A×T yen (the currency of Japan) when you park for T hours.\n\nPlan 2: The fee will be B yen, regardless of the duration.\n\nFind the minimum fee when you park for N hours.\n\nConstraints\n\n1≤N≤20\n\n1≤A≤100\n\n1≤B≤2000\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\nWhen the minimum fee is x yen, print the value of x.\n\nSample Input 1\n\n7 17 120\n\nSample Output 1\n\n119\n\nIf you choose Plan 1, the fee will be 7×17=119 yen.\n\nIf you choose Plan 2, the fee will be 120 yen.\n\nThus, the minimum fee is 119 yen.\n\nSample Input 2\n\n5 20 100\n\nSample Output 2\n\n100\n\nThe fee might be the same in the two plans.\n\nSample Input 3\n\n6 18 100\n\nSample Output 3\n\n100", "sample_input": "7 17 120\n"}, "reference_outputs": ["119\n"], "source_document_id": "p03501", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are parking at a parking lot. You can choose from the following two fee plans:\n\nPlan 1: The fee will be A×T yen (the currency of Japan) when you park for T hours.\n\nPlan 2: The fee will be B yen, regardless of the duration.\n\nFind the minimum fee when you park for N hours.\n\nConstraints\n\n1≤N≤20\n\n1≤A≤100\n\n1≤B≤2000\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\nWhen the minimum fee is x yen, print the value of x.\n\nSample Input 1\n\n7 17 120\n\nSample Output 1\n\n119\n\nIf you choose Plan 1, the fee will be 7×17=119 yen.\n\nIf you choose Plan 2, the fee will be 120 yen.\n\nThus, the minimum fee is 119 yen.\n\nSample Input 2\n\n5 20 100\n\nSample Output 2\n\n100\n\nThe fee might be the same in the two plans.\n\nSample Input 3\n\n6 18 100\n\nSample Output 3\n\n100", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s261136962", "group_id": "codeNet:p03503", "input_text": "@$_[@=]=map[glob<>],@=for 0,@==1..<>;$\\=-~0;for$i(1..1023){$c=0;$c+=$1[$j=$_][grep$0[$j][$_]&$i>>$_,0..9]for@=;$\\+=$-=$c-$\\}print", "language": "Perl", "metadata": {"date": 1512764438, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03503.html", "problem_id": "p03503", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03503/input.txt", "sample_output_relpath": "derived/input_output/data/p03503/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03503/Perl/s261136962.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s261136962", "user_id": "u657913472"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "@$_[@=]=map[glob<>],@=for 0,@==1..<>;$\\=-~0;for$i(1..1023){$c=0;$c+=$1[$j=$_][grep$0[$j][$_]&$i>>$_,0..9]for@=;$\\+=$-=$c-$\\}print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nJoisino is planning to open a shop in a shopping street.\n\nEach of the five weekdays is divided into two periods, the morning and the evening. For each of those ten periods, a shop must be either open during the whole period, or closed during the whole period. Naturally, a shop must be open during at least one of those periods.\n\nThere are already N stores in the street, numbered 1 through N.\n\nYou are given information of the business hours of those shops, F_{i,j,k}. If F_{i,j,k}=1, Shop i is open during Period k on Day j (this notation is explained below); if F_{i,j,k}=0, Shop i is closed during that period. Here, the days of the week are denoted as follows. Monday: Day 1, Tuesday: Day 2, Wednesday: Day 3, Thursday: Day 4, Friday: Day 5. Also, the morning is denoted as Period 1, and the afternoon is denoted as Period 2.\n\nLet c_i be the number of periods during which both Shop i and Joisino's shop are open. Then, the profit of Joisino's shop will be P_{1,c_1}+P_{2,c_2}+...+P_{N,c_N}.\n\nFind the maximum possible profit of Joisino's shop when she decides whether her shop is open during each period, making sure that it is open during at least one period.\n\nConstraints\n\n1≤N≤100\n\n0≤F_{i,j,k}≤1\n\nFor every integer i such that 1≤i≤N, there exists at least one pair (j,k) such that F_{i,j,k}=1.\n\n-10^7≤P_{i,j}≤10^7\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nF_{1,1,1} F_{1,1,2} ... F_{1,5,1} F_{1,5,2}\n:\nF_{N,1,1} F_{N,1,2} ... F_{N,5,1} F_{N,5,2}\nP_{1,0} ... P_{1,10}\n:\nP_{N,0} ... P_{N,10}\n\nOutput\n\nPrint the maximum possible profit of Joisino's shop.\n\nSample Input 1\n\n1\n1 1 0 1 0 0 0 1 0 1\n3 4 5 6 7 8 9 -2 -3 4 -2\n\nSample Output 1\n\n8\n\nIf her shop is open only during the periods when Shop 1 is opened, the profit will be 8, which is the maximum possible profit.\n\nSample Input 2\n\n2\n1 1 1 1 1 0 0 0 0 0\n0 0 0 0 0 1 1 1 1 1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n\nSample Output 2\n\n-2\n\nNote that a shop must be open during at least one period, and the profit may be negative.\n\nSample Input 3\n\n3\n1 1 1 1 1 1 0 0 1 1\n0 1 0 1 1 1 1 0 1 0\n1 0 1 1 0 1 0 1 0 1\n-8 6 -2 -8 -8 4 8 7 -6 2 2\n-9 2 0 1 7 -5 0 -2 -6 5 5\n6 -6 7 -9 6 -5 8 0 -9 -7 -7\n\nSample Output 3\n\n23", "sample_input": "1\n1 1 0 1 0 0 0 1 0 1\n3 4 5 6 7 8 9 -2 -3 4 -2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03503", "source_text": "Score : 300 points\n\nProblem Statement\n\nJoisino is planning to open a shop in a shopping street.\n\nEach of the five weekdays is divided into two periods, the morning and the evening. For each of those ten periods, a shop must be either open during the whole period, or closed during the whole period. Naturally, a shop must be open during at least one of those periods.\n\nThere are already N stores in the street, numbered 1 through N.\n\nYou are given information of the business hours of those shops, F_{i,j,k}. If F_{i,j,k}=1, Shop i is open during Period k on Day j (this notation is explained below); if F_{i,j,k}=0, Shop i is closed during that period. Here, the days of the week are denoted as follows. Monday: Day 1, Tuesday: Day 2, Wednesday: Day 3, Thursday: Day 4, Friday: Day 5. Also, the morning is denoted as Period 1, and the afternoon is denoted as Period 2.\n\nLet c_i be the number of periods during which both Shop i and Joisino's shop are open. Then, the profit of Joisino's shop will be P_{1,c_1}+P_{2,c_2}+...+P_{N,c_N}.\n\nFind the maximum possible profit of Joisino's shop when she decides whether her shop is open during each period, making sure that it is open during at least one period.\n\nConstraints\n\n1≤N≤100\n\n0≤F_{i,j,k}≤1\n\nFor every integer i such that 1≤i≤N, there exists at least one pair (j,k) such that F_{i,j,k}=1.\n\n-10^7≤P_{i,j}≤10^7\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nF_{1,1,1} F_{1,1,2} ... F_{1,5,1} F_{1,5,2}\n:\nF_{N,1,1} F_{N,1,2} ... F_{N,5,1} F_{N,5,2}\nP_{1,0} ... P_{1,10}\n:\nP_{N,0} ... P_{N,10}\n\nOutput\n\nPrint the maximum possible profit of Joisino's shop.\n\nSample Input 1\n\n1\n1 1 0 1 0 0 0 1 0 1\n3 4 5 6 7 8 9 -2 -3 4 -2\n\nSample Output 1\n\n8\n\nIf her shop is open only during the periods when Shop 1 is opened, the profit will be 8, which is the maximum possible profit.\n\nSample Input 2\n\n2\n1 1 1 1 1 0 0 0 0 0\n0 0 0 0 0 1 1 1 1 1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n\nSample Output 2\n\n-2\n\nNote that a shop must be open during at least one period, and the profit may be negative.\n\nSample Input 3\n\n3\n1 1 1 1 1 1 0 0 1 1\n0 1 0 1 1 1 1 0 1 0\n1 0 1 1 0 1 0 1 0 1\n-8 6 -2 -8 -8 4 8 7 -6 2 2\n-9 2 0 1 7 -5 0 -2 -6 5 5\n6 -6 7 -9 6 -5 8 0 -9 -7 -7\n\nSample Output 3\n\n23", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 227, "memory_kb": 5120}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s317011672", "group_id": "codeNet:p03503", "input_text": "@==1..<>;@$_[@=]=map[glob<>],@=for 1,2;$\\=-$$;for$i(1..$$){$c=0;$c+=$2[$j=$_][grep$1[$j][$_]&$i>>$_,0..9]for@=;$\\+=$-=$c-$\\}print", "language": "Perl", "metadata": {"date": 1512369756, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03503.html", "problem_id": "p03503", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03503/input.txt", "sample_output_relpath": "derived/input_output/data/p03503/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03503/Perl/s317011672.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s317011672", "user_id": "u657913472"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "@==1..<>;@$_[@=]=map[glob<>],@=for 1,2;$\\=-$$;for$i(1..$$){$c=0;$c+=$2[$j=$_][grep$1[$j][$_]&$i>>$_,0..9]for@=;$\\+=$-=$c-$\\}print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nJoisino is planning to open a shop in a shopping street.\n\nEach of the five weekdays is divided into two periods, the morning and the evening. For each of those ten periods, a shop must be either open during the whole period, or closed during the whole period. Naturally, a shop must be open during at least one of those periods.\n\nThere are already N stores in the street, numbered 1 through N.\n\nYou are given information of the business hours of those shops, F_{i,j,k}. If F_{i,j,k}=1, Shop i is open during Period k on Day j (this notation is explained below); if F_{i,j,k}=0, Shop i is closed during that period. Here, the days of the week are denoted as follows. Monday: Day 1, Tuesday: Day 2, Wednesday: Day 3, Thursday: Day 4, Friday: Day 5. Also, the morning is denoted as Period 1, and the afternoon is denoted as Period 2.\n\nLet c_i be the number of periods during which both Shop i and Joisino's shop are open. Then, the profit of Joisino's shop will be P_{1,c_1}+P_{2,c_2}+...+P_{N,c_N}.\n\nFind the maximum possible profit of Joisino's shop when she decides whether her shop is open during each period, making sure that it is open during at least one period.\n\nConstraints\n\n1≤N≤100\n\n0≤F_{i,j,k}≤1\n\nFor every integer i such that 1≤i≤N, there exists at least one pair (j,k) such that F_{i,j,k}=1.\n\n-10^7≤P_{i,j}≤10^7\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nF_{1,1,1} F_{1,1,2} ... F_{1,5,1} F_{1,5,2}\n:\nF_{N,1,1} F_{N,1,2} ... F_{N,5,1} F_{N,5,2}\nP_{1,0} ... P_{1,10}\n:\nP_{N,0} ... P_{N,10}\n\nOutput\n\nPrint the maximum possible profit of Joisino's shop.\n\nSample Input 1\n\n1\n1 1 0 1 0 0 0 1 0 1\n3 4 5 6 7 8 9 -2 -3 4 -2\n\nSample Output 1\n\n8\n\nIf her shop is open only during the periods when Shop 1 is opened, the profit will be 8, which is the maximum possible profit.\n\nSample Input 2\n\n2\n1 1 1 1 1 0 0 0 0 0\n0 0 0 0 0 1 1 1 1 1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n\nSample Output 2\n\n-2\n\nNote that a shop must be open during at least one period, and the profit may be negative.\n\nSample Input 3\n\n3\n1 1 1 1 1 1 0 0 1 1\n0 1 0 1 1 1 1 0 1 0\n1 0 1 1 0 1 0 1 0 1\n-8 6 -2 -8 -8 4 8 7 -6 2 2\n-9 2 0 1 7 -5 0 -2 -6 5 5\n6 -6 7 -9 6 -5 8 0 -9 -7 -7\n\nSample Output 3\n\n23", "sample_input": "1\n1 1 0 1 0 0 0 1 0 1\n3 4 5 6 7 8 9 -2 -3 4 -2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03503", "source_text": "Score : 300 points\n\nProblem Statement\n\nJoisino is planning to open a shop in a shopping street.\n\nEach of the five weekdays is divided into two periods, the morning and the evening. For each of those ten periods, a shop must be either open during the whole period, or closed during the whole period. Naturally, a shop must be open during at least one of those periods.\n\nThere are already N stores in the street, numbered 1 through N.\n\nYou are given information of the business hours of those shops, F_{i,j,k}. If F_{i,j,k}=1, Shop i is open during Period k on Day j (this notation is explained below); if F_{i,j,k}=0, Shop i is closed during that period. Here, the days of the week are denoted as follows. Monday: Day 1, Tuesday: Day 2, Wednesday: Day 3, Thursday: Day 4, Friday: Day 5. Also, the morning is denoted as Period 1, and the afternoon is denoted as Period 2.\n\nLet c_i be the number of periods during which both Shop i and Joisino's shop are open. Then, the profit of Joisino's shop will be P_{1,c_1}+P_{2,c_2}+...+P_{N,c_N}.\n\nFind the maximum possible profit of Joisino's shop when she decides whether her shop is open during each period, making sure that it is open during at least one period.\n\nConstraints\n\n1≤N≤100\n\n0≤F_{i,j,k}≤1\n\nFor every integer i such that 1≤i≤N, there exists at least one pair (j,k) such that F_{i,j,k}=1.\n\n-10^7≤P_{i,j}≤10^7\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nF_{1,1,1} F_{1,1,2} ... F_{1,5,1} F_{1,5,2}\n:\nF_{N,1,1} F_{N,1,2} ... F_{N,5,1} F_{N,5,2}\nP_{1,0} ... P_{1,10}\n:\nP_{N,0} ... P_{N,10}\n\nOutput\n\nPrint the maximum possible profit of Joisino's shop.\n\nSample Input 1\n\n1\n1 1 0 1 0 0 0 1 0 1\n3 4 5 6 7 8 9 -2 -3 4 -2\n\nSample Output 1\n\n8\n\nIf her shop is open only during the periods when Shop 1 is opened, the profit will be 8, which is the maximum possible profit.\n\nSample Input 2\n\n2\n1 1 1 1 1 0 0 0 0 0\n0 0 0 0 0 1 1 1 1 1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1\n\nSample Output 2\n\n-2\n\nNote that a shop must be open during at least one period, and the profit may be negative.\n\nSample Input 3\n\n3\n1 1 1 1 1 1 0 0 1 1\n0 1 0 1 1 1 1 0 1 0\n1 0 1 1 0 1 0 1 0 1\n-8 6 -2 -8 -8 4 8 7 -6 2 2\n-9 2 0 1 7 -5 0 -2 -6 5 5\n6 -6 7 -9 6 -5 8 0 -9 -7 -7\n\nSample Output 3\n\n23", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 10, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s860334906", "group_id": "codeNet:p03504", "input_text": "/ .* /,map$$_[$']=1,$`..$&for<>;map$a[grep$$i[$_],1..30]=$i=$_,0..1e5;print$#a", "language": "Perl", "metadata": {"date": 1550149747, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03504.html", "problem_id": "p03504", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03504/input.txt", "sample_output_relpath": "derived/input_output/data/p03504/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03504/Perl/s860334906.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s860334906", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "/ .* /,map$$_[$']=1,$`..$&for<>;map$a[grep$$i[$_],1..30]=$i=$_,0..1e5;print$#a", "problem_context": "Score : 400 points\n\nProblem Statement\n\nJoisino is planning to record N TV programs with recorders.\n\nThe TV can receive C channels numbered 1 through C.\n\nThe i-th program that she wants to record will be broadcast from time s_i to time t_i (including time s_i but not t_i) on Channel c_i.\n\nHere, there will never be more than one program that are broadcast on the same channel at the same time.\n\nWhen the recorder is recording a channel from time S to time T (including time S but not T), it cannot record other channels from time S-0.5 to time T (including time S-0.5 but not T).\n\nFind the minimum number of recorders required to record the channels so that all the N programs are completely recorded.\n\nConstraints\n\n1≤N≤10^5\n\n1≤C≤30\n\n1≤s_i;$a[grep${$'}[$i],//..30]=0for 0..1e5;print$#a", "language": "Perl", "metadata": {"date": 1550149655, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03504.html", "problem_id": "p03504", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03504/input.txt", "sample_output_relpath": "derived/input_output/data/p03504/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03504/Perl/s788232404.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s788232404", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "/ .* /,map${0+$'}[$_]=1,$`..$&for<>;$a[grep${$'}[$i],//..30]=0for 0..1e5;print$#a", "problem_context": "Score : 400 points\n\nProblem Statement\n\nJoisino is planning to record N TV programs with recorders.\n\nThe TV can receive C channels numbered 1 through C.\n\nThe i-th program that she wants to record will be broadcast from time s_i to time t_i (including time s_i but not t_i) on Channel c_i.\n\nHere, there will never be more than one program that are broadcast on the same channel at the same time.\n\nWhen the recorder is recording a channel from time S to time T (including time S but not T), it cannot record other channels from time S-0.5 to time T (including time S-0.5 but not T).\n\nFind the minimum number of recorders required to record the channels so that all the N programs are completely recorded.\n\nConstraints\n\n1≤N≤10^5\n\n1≤C≤30\n\n1≤s_i;print$#a", "language": "Perl", "metadata": {"date": 1543836772, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03504.html", "problem_id": "p03504", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03504/input.txt", "sample_output_relpath": "derived/input_output/data/p03504/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03504/Perl/s817465157.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s817465157", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "map$a[grep$$_[$'],//..30]=0,map{/ .* /;map${0+$'}[$_]=$_,$`..$&}<>;print$#a", "problem_context": "Score : 400 points\n\nProblem Statement\n\nJoisino is planning to record N TV programs with recorders.\n\nThe TV can receive C channels numbered 1 through C.\n\nThe i-th program that she wants to record will be broadcast from time s_i to time t_i (including time s_i but not t_i) on Channel c_i.\n\nHere, there will never be more than one program that are broadcast on the same channel at the same time.\n\nWhen the recorder is recording a channel from time S to time T (including time S but not T), it cannot record other channels from time S-0.5 to time T (including time S-0.5 but not T).\n\nFind the minimum number of recorders required to record the channels so that all the N programs are completely recorded.\n\nConstraints\n\n1≤N≤10^5\n\n1≤C≤30\n\n1≤s_i=INT_BASE){\n\t\t\tA[i]-=INT_BASE;\n\t\t\tA[i+1]+=1;\n\t\t}\n\t}\n\tA[INT_LENGTH]%=2;\n}\nfunction neg(A,i)\n{\n\tif(!iszero(A))\n\t{\n\t\tfor(i=0;iB?1:0\n{\n\tif(isneg(A))\n\t{\n\t\tif(isneg(B))\n\t\t{\n\t\t\tfor(i=INT_LENGTH-1;i>=0;--i)\n\t\t\t{\n\t\t\t\tif(A[i]!=B[i])return A[i]=0;--i)\n\t\t\t{\n\t\t\t\tif(A[i]!=B[i])return A[i]=0;--i)\n\t{\n\t\tfor(j=INT_LENGTH-i-1;j>0;--j)\n\t\t{\n\t\t\tA[i+j]+=A[i]*B[j];\n\t\t}\n\t\tA[i]*=B[0];\n\t}\n\tfor(i=0;i=0;--i)\n\t{\n\t\tif(flag)\n\t\t{\n\t\t\tstr=str sprintf(\"%0\" INT_WORD_SIZE \"d\",A[i]);\n\t\t}\n\t\telse if(A[i]>0)\n\t\t{\n\t\t\tstr=sprintf(\"%d\",A[i]);\n\t\t\tflag=1;\n\t\t}\n\t}\n\tif(!flag)str=\"0\";\n\treturn (negflag?\"-\":\"\")str;\n}\nfunction disp(A){print to_str(A)}\nfunction add_num(A,x)\n{\n\tif(x>0)add_num_impl(A,x);\n\telse if(x<0)sub_num_impl(A,-x);\n}\nfunction add_num_impl(A,x,i)\n{\n\ti=0;\n\twhile(i=INT_BASE)\n\t\t{\n\t\t\tA[i]-=INT_BASE;\n\t\t\tA[i+1]+=1;\n\t\t}\n\t\t++i;\n\t}\n\tA[INT_LENGTH]%=2;\n}\nfunction sub_num_impl(A,x,i)\n{\n\ti=0;\n\twhile(i=INT_BASE)\n\t\t{\n\t\t\tA[i]-=INT_BASE;\n\t\t\tA[i+1]+=1;\n\t\t}\n\t\t++i;\n\t}\n\tA[INT_LENGTH]=(A[INT_LENGTH]+1)%2;\n}\nfunction mul_num(A,x,i,negflag)\n{\n\tif(isneg(A))\n\t{\n\t\tnegflag+=1;\n\t\tneg(A);\n\t}\n\tif(x<0)\n\t{\n\t\tnegflag+=1;\n\t\tx=-x;\n\t}\n\tfor(i=INT_LENGTH-1;i>=0;--i)\n\t{\n\t\tA[i]*=x;\n\t}\n\tfor(i=0;i0)ret=x-ret;\n\tinput_num(ret,A);\n}\nfunction input_num(x,A,negflag,i)\n{\n\tif(x==\"-0\")x=\"0\";\n\tif(x<0)\n\t{\n\t\tnegflag=1;\n\t\tx=-x;\n\t}\n\tfor(i=0;i0)\n\t{\n\t\tif(b%2==1)\n\t\t{\n\t\t\tmul(ret,A);\n\t\t\tmod_num(ret,x);\n\t\t\tb--;\n\t\t}\n\t\tmul(A,A);\n\t\tmod_num(A,x);\n\t\tb/=2;\n\t}\n\treturn to_str(ret);\n}\n{input($1,N);input($2,A);input($3,B);\nif(cmp(N,A)==1)\n{\nif(cmp(A,B)==1)\n{\nneg(B);add(N,B);add_num(N,-1);add(A,B);div(N,A);mul_num(N,2);add_num(N,1);\ndisp(N);\n}\nelse print -1\n}\nelse print 1\n}", "language": "Perl", "metadata": {"date": 1579929316, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03505.html", "problem_id": "p03505", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03505/input.txt", "sample_output_relpath": "derived/input_output/data/p03505/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03505/Perl/s521414849.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s521414849", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "BEGIN{\n\tINT_WORD_SIZE=5;\n\tINT_BASE=10^INT_WORD_SIZE;\n\tINT_LENGTH=4;\n}\nfunction isneg(A){return +A[INT_LENGTH]}\nfunction iszero(A,i)\n{\n\tfor(i=0;i<=INT_LENGTH;++i)\n\t{\n\t\tif(A[i]!=0)return 0;\n\t}\n\treturn 1;\n}\nfunction add(A,B_orig,B,i)\n{\n\tcopy(B_orig,B);\n\tfor(i=0;i<=INT_LENGTH;++i)\n\t{\n\t\tA[i]+=B[i];\n\t\tif(A[i]>=INT_BASE){\n\t\t\tA[i]-=INT_BASE;\n\t\t\tA[i+1]+=1;\n\t\t}\n\t}\n\tA[INT_LENGTH]%=2;\n}\nfunction neg(A,i)\n{\n\tif(!iszero(A))\n\t{\n\t\tfor(i=0;iB?1:0\n{\n\tif(isneg(A))\n\t{\n\t\tif(isneg(B))\n\t\t{\n\t\t\tfor(i=INT_LENGTH-1;i>=0;--i)\n\t\t\t{\n\t\t\t\tif(A[i]!=B[i])return A[i]=0;--i)\n\t\t\t{\n\t\t\t\tif(A[i]!=B[i])return A[i]=0;--i)\n\t{\n\t\tfor(j=INT_LENGTH-i-1;j>0;--j)\n\t\t{\n\t\t\tA[i+j]+=A[i]*B[j];\n\t\t}\n\t\tA[i]*=B[0];\n\t}\n\tfor(i=0;i=0;--i)\n\t{\n\t\tif(flag)\n\t\t{\n\t\t\tstr=str sprintf(\"%0\" INT_WORD_SIZE \"d\",A[i]);\n\t\t}\n\t\telse if(A[i]>0)\n\t\t{\n\t\t\tstr=sprintf(\"%d\",A[i]);\n\t\t\tflag=1;\n\t\t}\n\t}\n\tif(!flag)str=\"0\";\n\treturn (negflag?\"-\":\"\")str;\n}\nfunction disp(A){print to_str(A)}\nfunction add_num(A,x)\n{\n\tif(x>0)add_num_impl(A,x);\n\telse if(x<0)sub_num_impl(A,-x);\n}\nfunction add_num_impl(A,x,i)\n{\n\ti=0;\n\twhile(i=INT_BASE)\n\t\t{\n\t\t\tA[i]-=INT_BASE;\n\t\t\tA[i+1]+=1;\n\t\t}\n\t\t++i;\n\t}\n\tA[INT_LENGTH]%=2;\n}\nfunction sub_num_impl(A,x,i)\n{\n\ti=0;\n\twhile(i=INT_BASE)\n\t\t{\n\t\t\tA[i]-=INT_BASE;\n\t\t\tA[i+1]+=1;\n\t\t}\n\t\t++i;\n\t}\n\tA[INT_LENGTH]=(A[INT_LENGTH]+1)%2;\n}\nfunction mul_num(A,x,i,negflag)\n{\n\tif(isneg(A))\n\t{\n\t\tnegflag+=1;\n\t\tneg(A);\n\t}\n\tif(x<0)\n\t{\n\t\tnegflag+=1;\n\t\tx=-x;\n\t}\n\tfor(i=INT_LENGTH-1;i>=0;--i)\n\t{\n\t\tA[i]*=x;\n\t}\n\tfor(i=0;i0)ret=x-ret;\n\tinput_num(ret,A);\n}\nfunction input_num(x,A,negflag,i)\n{\n\tif(x==\"-0\")x=\"0\";\n\tif(x<0)\n\t{\n\t\tnegflag=1;\n\t\tx=-x;\n\t}\n\tfor(i=0;i0)\n\t{\n\t\tif(b%2==1)\n\t\t{\n\t\t\tmul(ret,A);\n\t\t\tmod_num(ret,x);\n\t\t\tb--;\n\t\t}\n\t\tmul(A,A);\n\t\tmod_num(A,x);\n\t\tb/=2;\n\t}\n\treturn to_str(ret);\n}\n{input($1,N);input($2,A);input($3,B);\nif(cmp(N,A)==1)\n{\nif(cmp(A,B)==1)\n{\nneg(B);add(N,B);add_num(N,-1);add(A,B);div(N,A);mul_num(N,2);add_num(N,1);\ndisp(N);\n}\nelse print -1\n}\nelse print 1\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nButCoder Inc. runs a programming competition site called ButCoder. In this site, a user is given an integer value called rating that represents his/her skill, which changes each time he/she participates in a contest. The initial value of a new user's rating is 0, and a user whose rating reaches K or higher is called Kaiden (\"total transmission\"). Note that a user's rating may become negative.\n\nHikuhashi is a new user in ButCoder. It is estimated that, his rating increases by A in each of his odd-numbered contests (first, third, fifth, ...), and decreases by B in each of his even-numbered contests (second, fourth, sixth, ...).\n\nAccording to this estimate, after how many contests will he become Kaiden for the first time, or will he never become Kaiden?\n\nConstraints\n\n1 ≤ K, A, B ≤ 10^{18}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nIf it is estimated that Hikuhashi will never become Kaiden, print -1. Otherwise, print the estimated number of contests before he become Kaiden for the first time.\n\nSample Input 1\n\n4000 2000 500\n\nSample Output 1\n\n5\n\nEach time Hikuhashi participates in a contest, his rating is estimated to change as 0 → 2000 → 1500 → 3500 → 3000 → 5000 → … After his fifth contest, his rating will reach 4000 or higher for the first time.\n\nSample Input 2\n\n4000 500 2000\n\nSample Output 2\n\n-1\n\nEach time Hikuhashi participates in a contest, his rating is estimated to change as 0 → 500 → -1500 → -1000 → -3000 → -2500 → … He will never become Kaiden.\n\nSample Input 3\n\n1000000000000000000 2 1\n\nSample Output 3\n\n1999999999999999997\n\nThe input and output values may not fit into 32-bit integers.", "sample_input": "4000 2000 500\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03505", "source_text": "Score : 100 points\n\nProblem Statement\n\nButCoder Inc. runs a programming competition site called ButCoder. In this site, a user is given an integer value called rating that represents his/her skill, which changes each time he/she participates in a contest. The initial value of a new user's rating is 0, and a user whose rating reaches K or higher is called Kaiden (\"total transmission\"). Note that a user's rating may become negative.\n\nHikuhashi is a new user in ButCoder. It is estimated that, his rating increases by A in each of his odd-numbered contests (first, third, fifth, ...), and decreases by B in each of his even-numbered contests (second, fourth, sixth, ...).\n\nAccording to this estimate, after how many contests will he become Kaiden for the first time, or will he never become Kaiden?\n\nConstraints\n\n1 ≤ K, A, B ≤ 10^{18}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nIf it is estimated that Hikuhashi will never become Kaiden, print -1. Otherwise, print the estimated number of contests before he become Kaiden for the first time.\n\nSample Input 1\n\n4000 2000 500\n\nSample Output 1\n\n5\n\nEach time Hikuhashi participates in a contest, his rating is estimated to change as 0 → 2000 → 1500 → 3500 → 3000 → 5000 → … After his fifth contest, his rating will reach 4000 or higher for the first time.\n\nSample Input 2\n\n4000 500 2000\n\nSample Output 2\n\n-1\n\nEach time Hikuhashi participates in a contest, his rating is estimated to change as 0 → 500 → -1500 → -1000 → -3000 → -2500 → … He will never become Kaiden.\n\nSample Input 3\n\n1000000000000000000 2 1\n\nSample Output 3\n\n1999999999999999997\n\nThe input and output values may not fit into 32-bit integers.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4835, "cpu_time_ms": 411, "memory_kb": 60712}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s839905936", "group_id": "codeNet:p03506", "input_text": "($N,$Q)=glob<>;\nfor(<>){\n\t($v,$w)=split;\n\t@v=$v;push@v,$v=($v+$N-2)/$N|0while$v;\n\t@w=$v;push@w,$w=($w+$N-2)/$N|0while$w;\n\twhile($v==$w){\n\t\t$v=pop@v;\n\t\t$w=pop@w;\n\t\t$v==$w&&($x=$v);\n\t\t@v&&@w||last\n\t}\n\tprint$x,$/\n}\n", "language": "Perl", "metadata": {"date": 1511730191, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03506.html", "problem_id": "p03506", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03506/input.txt", "sample_output_relpath": "derived/input_output/data/p03506/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03506/Perl/s839905936.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s839905936", "user_id": "u467549634"}, "prompt_components": {"gold_output": "2\n1\n3\n", "input_to_evaluate": "($N,$Q)=glob<>;\nfor(<>){\n\t($v,$w)=split;\n\t@v=$v;push@v,$v=($v+$N-2)/$N|0while$v;\n\t@w=$v;push@w,$w=($w+$N-2)/$N|0while$w;\n\twhile($v==$w){\n\t\t$v=pop@v;\n\t\t$w=pop@w;\n\t\t$v==$w&&($x=$v);\n\t\t@v&&@w||last\n\t}\n\tprint$x,$/\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer N. Consider an infinite N-ary tree as shown below:\n\nFigure: an infinite N-ary tree for the case N = 3\n\nAs shown in the figure, each vertex is indexed with a unique positive integer, and for every positive integer there is a vertex indexed with it. The root of the tree has the index 1. For the remaining vertices, vertices in the upper row have smaller indices than those in the lower row. Among the vertices in the same row, a vertex that is more to the left has a smaller index.\n\nRegarding this tree, process Q queries. The i-th query is as follows:\n\nFind the index of the lowest common ancestor (see Notes) of Vertex v_i and w_i.\n\nNotes\n\nIn a rooted tree, the lowest common ancestor (LCA) of Vertex v and w is the farthest vertex from the root that is an ancestor of both Vertex v and w. Here, a vertex is considered to be an ancestor of itself. For example, in the tree shown in Problem Statement, the LCA of Vertex 5 and 7 is Vertex 2, the LCA of Vertex 8 and 11 is Vertex 1, and the LCA of Vertex 3 and 9 is Vertex 3.\n\nConstraints\n\n1 ≤ N ≤ 10^9\n\n1 ≤ Q ≤ 10^5\n\n1 ≤ v_i < w_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nv_1 w_1\n:\nv_Q w_Q\n\nOutput\n\nPrint Q lines. The i-th line (1 ≤ i ≤ Q) must contain the index of the lowest common ancestor of Vertex v_i and w_i.\n\nSample Input 1\n\n3 3\n5 7\n8 11\n3 9\n\nSample Output 1\n\n2\n1\n3\n\nThe queries in this case correspond to the examples shown in Notes.\n\nSample Input 2\n\n100000 2\n1 2\n3 4\n\nSample Output 2\n\n1\n1", "sample_input": "3 3\n5 7\n8 11\n3 9\n"}, "reference_outputs": ["2\n1\n3\n"], "source_document_id": "p03506", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer N. Consider an infinite N-ary tree as shown below:\n\nFigure: an infinite N-ary tree for the case N = 3\n\nAs shown in the figure, each vertex is indexed with a unique positive integer, and for every positive integer there is a vertex indexed with it. The root of the tree has the index 1. For the remaining vertices, vertices in the upper row have smaller indices than those in the lower row. Among the vertices in the same row, a vertex that is more to the left has a smaller index.\n\nRegarding this tree, process Q queries. The i-th query is as follows:\n\nFind the index of the lowest common ancestor (see Notes) of Vertex v_i and w_i.\n\nNotes\n\nIn a rooted tree, the lowest common ancestor (LCA) of Vertex v and w is the farthest vertex from the root that is an ancestor of both Vertex v and w. Here, a vertex is considered to be an ancestor of itself. For example, in the tree shown in Problem Statement, the LCA of Vertex 5 and 7 is Vertex 2, the LCA of Vertex 8 and 11 is Vertex 1, and the LCA of Vertex 3 and 9 is Vertex 3.\n\nConstraints\n\n1 ≤ N ≤ 10^9\n\n1 ≤ Q ≤ 10^5\n\n1 ≤ v_i < w_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nv_1 w_1\n:\nv_Q w_Q\n\nOutput\n\nPrint Q lines. The i-th line (1 ≤ i ≤ Q) must contain the index of the lowest common ancestor of Vertex v_i and w_i.\n\nSample Input 1\n\n3 3\n5 7\n8 11\n3 9\n\nSample Output 1\n\n2\n1\n3\n\nThe queries in this case correspond to the examples shown in Notes.\n\nSample Input 2\n\n100000 2\n1 2\n3 4\n\nSample Output 2\n\n1\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 212, "cpu_time_ms": 2129, "memory_kb": 455936}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s917326505", "group_id": "codeNet:p03508", "input_text": "sub f{my$r=$u[\"@_\"]=1;$u[$_]||($r+=f($_))for@{$G[\"@_\"]};$r}($n,$m)=glob<>;/ /,push@{$G[$`]},$'+!push@{$G[$']},$`for<>;$a=f 1;$a-=$-=$a- f(2);print$n*~-$n/2-$a*($n-$a)-$m", "language": "Perl", "metadata": {"date": 1527327366, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03508.html", "problem_id": "p03508", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03508/input.txt", "sample_output_relpath": "derived/input_output/data/p03508/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03508/Perl/s917326505.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s917326505", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "sub f{my$r=$u[\"@_\"]=1;$u[$_]||($r+=f($_))for@{$G[\"@_\"]};$r}($n,$m)=glob<>;/ /,push@{$G[$`]},$'+!push@{$G[$']},$`for<>;$a=f 1;$a-=$-=$a- f(2);print$n*~-$n/2-$a*($n-$a)-$m", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an undirected graph G. G has N vertices and M edges. The vertices are numbered from 1 through N, and the i-th edge (1 ≤ i ≤ M) connects Vertex a_i and b_i. G does not have self-loops and multiple edges.\n\nYou can repeatedly perform the operation of adding an edge between two vertices. However, G must not have self-loops or multiple edges as the result. Also, if Vertex 1 and 2 are connected directly or indirectly by edges, your body will be exposed to a voltage of 1000000007 volts. This must also be avoided.\n\nUnder these conditions, at most how many edges can you add? Note that Vertex 1 and 2 are never connected directly or indirectly in the beginning.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n0 ≤ M ≤ 10^5\n\n1 ≤ a_i < b_i ≤ N\n\nAll pairs (a_i, b_i) are distinct.\n\nVertex 1 and 2 in G are not connected directly or indirectly by edges.\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 maximum number of edges that can be added.\n\nSample Input 1\n\n4 1\n1 3\n\nSample Output 1\n\n2\n\nAs shown above, two edges can be added. It is not possible to add three or more edges.\n\nSample Input 2\n\n2 0\n\nSample Output 2\n\n0\n\nNo edge can be added.\n\nSample Input 3\n\n9 6\n1 4\n1 8\n2 5\n3 6\n4 8\n5 7\n\nSample Output 3\n\n12", "sample_input": "4 1\n1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03508", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an undirected graph G. G has N vertices and M edges. The vertices are numbered from 1 through N, and the i-th edge (1 ≤ i ≤ M) connects Vertex a_i and b_i. G does not have self-loops and multiple edges.\n\nYou can repeatedly perform the operation of adding an edge between two vertices. However, G must not have self-loops or multiple edges as the result. Also, if Vertex 1 and 2 are connected directly or indirectly by edges, your body will be exposed to a voltage of 1000000007 volts. This must also be avoided.\n\nUnder these conditions, at most how many edges can you add? Note that Vertex 1 and 2 are never connected directly or indirectly in the beginning.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n0 ≤ M ≤ 10^5\n\n1 ≤ a_i < b_i ≤ N\n\nAll pairs (a_i, b_i) are distinct.\n\nVertex 1 and 2 in G are not connected directly or indirectly by edges.\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 maximum number of edges that can be added.\n\nSample Input 1\n\n4 1\n1 3\n\nSample Output 1\n\n2\n\nAs shown above, two edges can be added. It is not possible to add three or more edges.\n\nSample Input 2\n\n2 0\n\nSample Output 2\n\n0\n\nNo edge can be added.\n\nSample Input 3\n\n9 6\n1 4\n1 8\n2 5\n3 6\n4 8\n5 7\n\nSample Output 3\n\n12", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 452, "memory_kb": 146816}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s600607421", "group_id": "codeNet:p03509", "input_text": "$p=<>=~$\"*$';($s+=$_)$a}map{/ /;$s-=$'*$p;(100-$p)*$`+$'*$p}<>", "language": "Perl", "metadata": {"date": 1527329085, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03509.html", "problem_id": "p03509", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03509/input.txt", "sample_output_relpath": "derived/input_output/data/p03509/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03509/Perl/s600607421.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s600607421", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$p=<>=~$\"*$';($s+=$_)$a}map{/ /;$s-=$'*$p;(100-$p)*$`+$'*$p}<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nRingo Kingdom Congress is voting on a bill.\n\nN members are present, and the i-th member (1 ≤ i ≤ N) has w_i white ballots and b_i blue ballots. Each member i will put all the w_i white ballots into the box if he/she is in favor of the bill, and put all the b_i blue ballots into the box if he/she is not in favor of the bill. No other action is allowed. For example, a member must not forfeit voting, or put only a part of his/her white ballots or a part of his/her blue ballots into the box.\n\nAfter all the members vote, if at least P percent of the ballots in the box is white, the bill is passed; if less than P percent of the ballots is white, the bill is rejected.\n\nIn order for the bill to pass, at least how many members must be in favor of it?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ P ≤ 100\n\n1 ≤ w_i ≤ 10^9\n\n1 ≤ b_i ≤ 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nw_1 b_1\nw_2 b_2\n:\nw_N b_N\n\nOutput\n\nPrint the minimum number of members in favor of the bill required for passage.\n\nSample Input 1\n\n4 75\n1 1\n1 1\n1 1\n1 1\n\nSample Output 1\n\n3\n\nThis is a \"normal\" vote, where each of the four members has one white ballot and one blue ballot. For the bill to pass, at least 75 percent of the four, that is, at least three must be in favor of it.\n\nSample Input 2\n\n4 75\n1 1\n1 1\n1 1\n100 1\n\nSample Output 2\n\n1\n\nThe \"yes\" vote of the member with 100 white ballots alone is enough to pass the bill.\n\nSample Input 3\n\n5 60\n6 3\n5 9\n3 4\n7 8\n4 7\n\nSample Output 3\n\n3", "sample_input": "4 75\n1 1\n1 1\n1 1\n1 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03509", "source_text": "Score : 100 points\n\nProblem Statement\n\nRingo Kingdom Congress is voting on a bill.\n\nN members are present, and the i-th member (1 ≤ i ≤ N) has w_i white ballots and b_i blue ballots. Each member i will put all the w_i white ballots into the box if he/she is in favor of the bill, and put all the b_i blue ballots into the box if he/she is not in favor of the bill. No other action is allowed. For example, a member must not forfeit voting, or put only a part of his/her white ballots or a part of his/her blue ballots into the box.\n\nAfter all the members vote, if at least P percent of the ballots in the box is white, the bill is passed; if less than P percent of the ballots is white, the bill is rejected.\n\nIn order for the bill to pass, at least how many members must be in favor of it?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ P ≤ 100\n\n1 ≤ w_i ≤ 10^9\n\n1 ≤ b_i ≤ 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nw_1 b_1\nw_2 b_2\n:\nw_N b_N\n\nOutput\n\nPrint the minimum number of members in favor of the bill required for passage.\n\nSample Input 1\n\n4 75\n1 1\n1 1\n1 1\n1 1\n\nSample Output 1\n\n3\n\nThis is a \"normal\" vote, where each of the four members has one white ballot and one blue ballot. For the bill to pass, at least 75 percent of the four, that is, at least three must be in favor of it.\n\nSample Input 2\n\n4 75\n1 1\n1 1\n1 1\n100 1\n\nSample Output 2\n\n1\n\nThe \"yes\" vote of the member with 100 white ballots alone is enough to pass the bill.\n\nSample Input 3\n\n5 60\n6 3\n5 9\n3 4\n7 8\n4 7\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 148, "memory_kb": 18944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s470802372", "group_id": "codeNet:p03509", "input_text": "$p=<>=~$\"*$';$i++,($s+=$_)>=0&&(exit!print$i)for sort{$b<=>$a}map{/ /;$s-=$'*$p;(100-$p)*$`+$'*$p}<>", "language": "Perl", "metadata": {"date": 1527328779, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03509.html", "problem_id": "p03509", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03509/input.txt", "sample_output_relpath": "derived/input_output/data/p03509/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03509/Perl/s470802372.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s470802372", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$p=<>=~$\"*$';$i++,($s+=$_)>=0&&(exit!print$i)for sort{$b<=>$a}map{/ /;$s-=$'*$p;(100-$p)*$`+$'*$p}<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nRingo Kingdom Congress is voting on a bill.\n\nN members are present, and the i-th member (1 ≤ i ≤ N) has w_i white ballots and b_i blue ballots. Each member i will put all the w_i white ballots into the box if he/she is in favor of the bill, and put all the b_i blue ballots into the box if he/she is not in favor of the bill. No other action is allowed. For example, a member must not forfeit voting, or put only a part of his/her white ballots or a part of his/her blue ballots into the box.\n\nAfter all the members vote, if at least P percent of the ballots in the box is white, the bill is passed; if less than P percent of the ballots is white, the bill is rejected.\n\nIn order for the bill to pass, at least how many members must be in favor of it?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ P ≤ 100\n\n1 ≤ w_i ≤ 10^9\n\n1 ≤ b_i ≤ 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nw_1 b_1\nw_2 b_2\n:\nw_N b_N\n\nOutput\n\nPrint the minimum number of members in favor of the bill required for passage.\n\nSample Input 1\n\n4 75\n1 1\n1 1\n1 1\n1 1\n\nSample Output 1\n\n3\n\nThis is a \"normal\" vote, where each of the four members has one white ballot and one blue ballot. For the bill to pass, at least 75 percent of the four, that is, at least three must be in favor of it.\n\nSample Input 2\n\n4 75\n1 1\n1 1\n1 1\n100 1\n\nSample Output 2\n\n1\n\nThe \"yes\" vote of the member with 100 white ballots alone is enough to pass the bill.\n\nSample Input 3\n\n5 60\n6 3\n5 9\n3 4\n7 8\n4 7\n\nSample Output 3\n\n3", "sample_input": "4 75\n1 1\n1 1\n1 1\n1 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03509", "source_text": "Score : 100 points\n\nProblem Statement\n\nRingo Kingdom Congress is voting on a bill.\n\nN members are present, and the i-th member (1 ≤ i ≤ N) has w_i white ballots and b_i blue ballots. Each member i will put all the w_i white ballots into the box if he/she is in favor of the bill, and put all the b_i blue ballots into the box if he/she is not in favor of the bill. No other action is allowed. For example, a member must not forfeit voting, or put only a part of his/her white ballots or a part of his/her blue ballots into the box.\n\nAfter all the members vote, if at least P percent of the ballots in the box is white, the bill is passed; if less than P percent of the ballots is white, the bill is rejected.\n\nIn order for the bill to pass, at least how many members must be in favor of it?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ P ≤ 100\n\n1 ≤ w_i ≤ 10^9\n\n1 ≤ b_i ≤ 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nw_1 b_1\nw_2 b_2\n:\nw_N b_N\n\nOutput\n\nPrint the minimum number of members in favor of the bill required for passage.\n\nSample Input 1\n\n4 75\n1 1\n1 1\n1 1\n1 1\n\nSample Output 1\n\n3\n\nThis is a \"normal\" vote, where each of the four members has one white ballot and one blue ballot. For the bill to pass, at least 75 percent of the four, that is, at least three must be in favor of it.\n\nSample Input 2\n\n4 75\n1 1\n1 1\n1 1\n100 1\n\nSample Output 2\n\n1\n\nThe \"yes\" vote of the member with 100 white ballots alone is enough to pass the bill.\n\nSample Input 3\n\n5 60\n6 3\n5 9\n3 4\n7 8\n4 7\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 100, "cpu_time_ms": 142, "memory_kb": 18944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s971529468", "group_id": "codeNet:p03523", "input_text": "print<>=~/^A?KIHA?BA?RA?$/?YES:NO", "language": "Perl", "metadata": {"date": 1559834445, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03523.html", "problem_id": "p03523", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03523/input.txt", "sample_output_relpath": "derived/input_output/data/p03523/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03523/Perl/s971529468.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s971529468", "user_id": "u573154728"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "print<>=~/^A?KIHA?BA?RA?$/?YES:NO", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S.\n\nTakahashi can insert the character A at any position in this string any number of times.\n\nCan he change S into AKIHABARA?\n\nConstraints\n\n1 \\leq |S| \\leq 50\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 it is possible to change S into AKIHABARA, print YES; otherwise, print NO.\n\nSample Input 1\n\nKIHBR\n\nSample Output 1\n\nYES\n\nInsert one A at each of the four positions: the beginning, immediately after H, immediately after B and the end.\n\nSample Input 2\n\nAKIBAHARA\n\nSample Output 2\n\nNO\n\nThe correct spell is AKIHABARA.\n\nSample Input 3\n\nAAKIAHBAARA\n\nSample Output 3\n\nNO", "sample_input": "KIHBR\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03523", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S.\n\nTakahashi can insert the character A at any position in this string any number of times.\n\nCan he change S into AKIHABARA?\n\nConstraints\n\n1 \\leq |S| \\leq 50\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 it is possible to change S into AKIHABARA, print YES; otherwise, print NO.\n\nSample Input 1\n\nKIHBR\n\nSample Output 1\n\nYES\n\nInsert one A at each of the four positions: the beginning, immediately after H, immediately after B and the end.\n\nSample Input 2\n\nAKIBAHARA\n\nSample Output 2\n\nNO\n\nThe correct spell is AKIHABARA.\n\nSample Input 3\n\nAAKIAHBAARA\n\nSample Output 3\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s740809530", "group_id": "codeNet:p03524", "input_text": "@s=split//,<>;\n$n{$_}++ for(@s);\n$m=int($#s/3);\n@J=sort{$a<=>$b}($m,$n{a},$n{b},$n{c},$m+1);\nprint+($J[0]==$m and $J[4]==$m+1)?YES:NO", "language": "Perl", "metadata": {"date": 1559834986, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03524.html", "problem_id": "p03524", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03524/input.txt", "sample_output_relpath": "derived/input_output/data/p03524/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03524/Perl/s740809530.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s740809530", "user_id": "u573154728"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "@s=split//,<>;\n$n{$_}++ for(@s);\n$m=int($#s/3);\n@J=sort{$a<=>$b}($m,$n{a},$n{b},$n{c},$m+1);\nprint+($J[0]==$m and $J[4]==$m+1)?YES:NO", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has a string S consisting of three kinds of letters: a, b and c.\n\nHe has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the objective is achievable, print YES; if it is unachievable, print NO.\n\nSample Input 1\n\nabac\n\nSample Output 1\n\nYES\n\nAs it stands now, S contains a palindrome aba, but we can permute the characters to get acba, for example, that does not contain a palindrome of length 2 or more.\n\nSample Input 2\n\naba\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nbabacccabab\n\nSample Output 3\n\nYES", "sample_input": "abac\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03524", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has a string S consisting of three kinds of letters: a, b and c.\n\nHe has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the objective is achievable, print YES; if it is unachievable, print NO.\n\nSample Input 1\n\nabac\n\nSample Output 1\n\nYES\n\nAs it stands now, S contains a palindrome aba, but we can permute the characters to get acba, for example, that does not contain a palindrome of length 2 or more.\n\nSample Input 2\n\naba\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nbabacccabab\n\nSample Output 3\n\nYES", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 22, "memory_kb": 8320}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s099693327", "group_id": "codeNet:p03525", "input_text": "get;say min @($_=sort map (-1)**$++**%24,sort +<;@a=sort{$a-$b}map y/$_//,a..c;print$a[2]-\"@@\"<2?YES:NO", "language": "Perl", "metadata": {"date": 1513529156, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03534.html", "problem_id": "p03534", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03534/input.txt", "sample_output_relpath": "derived/input_output/data/p03534/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03534/Perl/s801938613.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s801938613", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "$_=<>;@a=sort{$a-$b}map y/$_//,a..c;print$a[2]-\"@@\"<2?YES:NO", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has a string S consisting of three kinds of letters: a, b and c.\n\nHe has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the objective is achievable, print YES; if it is unachievable, print NO.\n\nSample Input 1\n\nabac\n\nSample Output 1\n\nYES\n\nAs it stands now, S contains a palindrome aba, but we can permute the characters to get acba, for example, that does not contain a palindrome of length 2 or more.\n\nSample Input 2\n\naba\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nbabacccabab\n\nSample Output 3\n\nYES", "sample_input": "abac\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03534", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has a string S consisting of three kinds of letters: a, b and c.\n\nHe has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the objective is achievable, print YES; if it is unachievable, print NO.\n\nSample Input 1\n\nabac\n\nSample Output 1\n\nYES\n\nAs it stands now, S contains a palindrome aba, but we can permute the characters to get acba, for example, that does not contain a palindrome of length 2 or more.\n\nSample Input 2\n\naba\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nbabacccabab\n\nSample Output 3\n\nYES", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 60, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s819915437", "group_id": "codeNet:p03543", "input_text": "use strict;\nuse warnings;\n\nmy $s = ;\nmy ($n1, $n2, $n3, $n4) = split //, $s;\nmy $is_true = 0;\n\nif (($n2 == $n3) and (($n1 == $n2) or ($n3 == $n4))) {\n $is_true = 1;\n}\n\nif ($is_true) {\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1511329388, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03543.html", "problem_id": "p03543", "resource_group": "low_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/Perl/s819915437.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s819915437", "user_id": "u505964248"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $s = ;\nmy ($n1, $n2, $n3, $n4) = split //, $s;\nmy $is_true = 0;\n\nif (($n2 == $n3) and (($n1 == $n2) or ($n3 == $n4))) {\n $is_true = 1;\n}\n\nif ($is_true) {\n print \"Yes\\n\";\n} else {\n print \"No\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s750782371", "group_id": "codeNet:p03544", "input_text": "my ($a,$b)=(2,1);\n($a,$b)=($b,$a+$b)for ^get;\nsay $a", "language": "Perl", "metadata": {"date": 1534795520, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03544.html", "problem_id": "p03544", "resource_group": "low_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/Perl/s750782371.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s750782371", "user_id": "u657913472"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "my ($a,$b)=(2,1);\n($a,$b)=($b,$a+$b)for ^get;\nsay $a", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 52, "cpu_time_ms": 141, "memory_kb": 51316}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s500965107", "group_id": "codeNet:p03545", "input_text": "printf\"%s=7\",grep{eval==7}glob<>=~s/\\B/{+,-}/gr", "language": "Perl", "metadata": {"date": 1562769640, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03545.html", "problem_id": "p03545", "resource_group": "low_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/Perl/s500965107.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s500965107", "user_id": "u573154728"}, "prompt_components": {"gold_output": "1+2+2+2=7\n", "input_to_evaluate": "printf\"%s=7\",grep{eval==7}glob<>=~s/\\B/{+,-}/gr", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s478121774", "group_id": "codeNet:p03546", "input_text": "<>;\n@$_[@@]=glob<>for@@=0..9;\nfor$k(@@){for$i(@@){for$j(@@){\n\t$$i[$j]-=$-=$$i[$j]-$$i[$k]-$$k[$j]\n}}}\n$\\+=$$_[1]for glob`dd`;\nprint\n", "language": "Perl", "metadata": {"date": 1511058389, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03546.html", "problem_id": "p03546", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03546/input.txt", "sample_output_relpath": "derived/input_output/data/p03546/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03546/Perl/s478121774.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s478121774", "user_id": "u283869437"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "<>;\n@$_[@@]=glob<>for@@=0..9;\nfor$k(@@){for$i(@@){for$j(@@){\n\t$$i[$j]-=$-=$$i[$j]-$$i[$k]-$$k[$j]\n}}}\n$\\+=$$_[1]for glob`dd`;\nprint\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nJoisino the magical girl has decided to turn every single digit that exists on this world into 1.\n\nRewriting a digit i with j (0≤i,j≤9) costs c_{i,j} MP (Magic Points).\n\nShe is now standing before a wall. The wall is divided into HW squares in H rows and W columns, and at least one square contains a digit between 0 and 9 (inclusive).\n\nYou are given A_{i,j} that describes the square at the i-th row from the top and j-th column from the left, as follows:\n\nIf A_{i,j}≠-1, the square contains a digit A_{i,j}.\n\nIf A_{i,j}=-1, the square does not contain a digit.\n\nFind the minimum total amount of MP required to turn every digit on this wall into 1 in the end.\n\nConstraints\n\n1≤H,W≤200\n\n1≤c_{i,j}≤10^3 (i≠j)\n\nc_{i,j}=0 (i=j)\n\n-1≤A_{i,j}≤9\n\nAll input values are integers.\n\nThere is at least one digit on the wall.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nc_{0,0} ... c_{0,9}\n:\nc_{9,0} ... c_{9,9}\nA_{1,1} ... A_{1,W}\n:\nA_{H,1} ... A_{H,W}\n\nOutput\n\nPrint the minimum total amount of MP required to turn every digit on the wall into 1 in the end.\n\nSample Input 1\n\n2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n\nSample Output 1\n\n12\n\nTo turn a single 8 into 1, it is optimal to first turn 8 into 4, then turn 4 into 9, and finally turn 9 into 1, costing 6 MP.\n\nThe wall contains two 8s, so the minimum total MP required is 6×2=12.\n\nSample Input 2\n\n5 5\n0 999 999 999 999 999 999 999 999 999\n999 0 999 999 999 999 999 999 999 999\n999 999 0 999 999 999 999 999 999 999\n999 999 999 0 999 999 999 999 999 999\n999 999 999 999 0 999 999 999 999 999\n999 999 999 999 999 0 999 999 999 999\n999 999 999 999 999 999 0 999 999 999\n999 999 999 999 999 999 999 0 999 999\n999 999 999 999 999 999 999 999 0 999\n999 999 999 999 999 999 999 999 999 0\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n\nSample Output 2\n\n0\n\nNote that she may not need to change any digit.\n\nSample Input 3\n\n3 5\n0 4 3 6 2 7 2 5 3 3\n4 0 5 3 7 5 3 7 2 7\n5 7 0 7 2 9 3 2 9 1\n3 6 2 0 2 4 6 4 2 3\n3 5 7 4 0 6 9 7 6 7\n9 8 5 2 2 0 4 7 6 5\n5 4 6 3 2 3 0 5 4 3\n3 6 2 3 4 2 4 0 8 9\n4 6 5 4 3 5 3 2 0 8\n2 1 3 4 5 7 8 6 4 0\n3 5 2 6 1\n2 5 3 2 1\n6 9 2 5 6\n\nSample Output 3\n\n47", "sample_input": "2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03546", "source_text": "Score : 400 points\n\nProblem Statement\n\nJoisino the magical girl has decided to turn every single digit that exists on this world into 1.\n\nRewriting a digit i with j (0≤i,j≤9) costs c_{i,j} MP (Magic Points).\n\nShe is now standing before a wall. The wall is divided into HW squares in H rows and W columns, and at least one square contains a digit between 0 and 9 (inclusive).\n\nYou are given A_{i,j} that describes the square at the i-th row from the top and j-th column from the left, as follows:\n\nIf A_{i,j}≠-1, the square contains a digit A_{i,j}.\n\nIf A_{i,j}=-1, the square does not contain a digit.\n\nFind the minimum total amount of MP required to turn every digit on this wall into 1 in the end.\n\nConstraints\n\n1≤H,W≤200\n\n1≤c_{i,j}≤10^3 (i≠j)\n\nc_{i,j}=0 (i=j)\n\n-1≤A_{i,j}≤9\n\nAll input values are integers.\n\nThere is at least one digit on the wall.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nc_{0,0} ... c_{0,9}\n:\nc_{9,0} ... c_{9,9}\nA_{1,1} ... A_{1,W}\n:\nA_{H,1} ... A_{H,W}\n\nOutput\n\nPrint the minimum total amount of MP required to turn every digit on the wall into 1 in the end.\n\nSample Input 1\n\n2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n\nSample Output 1\n\n12\n\nTo turn a single 8 into 1, it is optimal to first turn 8 into 4, then turn 4 into 9, and finally turn 9 into 1, costing 6 MP.\n\nThe wall contains two 8s, so the minimum total MP required is 6×2=12.\n\nSample Input 2\n\n5 5\n0 999 999 999 999 999 999 999 999 999\n999 0 999 999 999 999 999 999 999 999\n999 999 0 999 999 999 999 999 999 999\n999 999 999 0 999 999 999 999 999 999\n999 999 999 999 0 999 999 999 999 999\n999 999 999 999 999 0 999 999 999 999\n999 999 999 999 999 999 0 999 999 999\n999 999 999 999 999 999 999 0 999 999\n999 999 999 999 999 999 999 999 0 999\n999 999 999 999 999 999 999 999 999 0\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n\nSample Output 2\n\n0\n\nNote that she may not need to change any digit.\n\nSample Input 3\n\n3 5\n0 4 3 6 2 7 2 5 3 3\n4 0 5 3 7 5 3 7 2 7\n5 7 0 7 2 9 3 2 9 1\n3 6 2 0 2 4 6 4 2 3\n3 5 7 4 0 6 9 7 6 7\n9 8 5 2 2 0 4 7 6 5\n5 4 6 3 2 3 0 5 4 3\n3 6 2 3 4 2 4 0 8 9\n4 6 5 4 3 5 3 2 0 8\n2 1 3 4 5 7 8 6 4 0\n3 5 2 6 1\n2 5 3 2 1\n6 9 2 5 6\n\nSample Output 3\n\n47", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 152, "memory_kb": 7936}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s090163920", "group_id": "codeNet:p03547", "input_text": "my ($a,$b)=get.words>>.ord;say $a>$b??\">\"!!$a==$b??\"=\"!!\"<\"", "language": "Perl", "metadata": {"date": 1528434521, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03547.html", "problem_id": "p03547", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03547/input.txt", "sample_output_relpath": "derived/input_output/data/p03547/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03547/Perl/s090163920.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s090163920", "user_id": "u657913472"}, "prompt_components": {"gold_output": "<\n", "input_to_evaluate": "my ($a,$b)=get.words>>.ord;say $a>$b??\">\"!!$a==$b??\"=\"!!\"<\"", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "sample_input": "A B\n"}, "reference_outputs": ["<\n"], "source_document_id": "p03547", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 59, "cpu_time_ms": 169, "memory_kb": 52612}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s049623327", "group_id": "codeNet:p03547", "input_text": "use strict;\nuse warnings;\n\nmy %n = (\n A => 10,\n B => 11,\n C => 12,\n D => 13,\n E => 14,\n F => 15,\n);\n\nmy $s = ;\nchomp $s;\nmy ($a, $b) = split / /, $s;\n\nif ($n{$a} < $n{$b}) {\n print '<';\n} elsif ($n{$a} > $n{$b}) {\n print '>';\n} else {\n print '=';\n}\n", "language": "Perl", "metadata": {"date": 1511475946, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03547.html", "problem_id": "p03547", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03547/input.txt", "sample_output_relpath": "derived/input_output/data/p03547/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03547/Perl/s049623327.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s049623327", "user_id": "u505964248"}, "prompt_components": {"gold_output": "<\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy %n = (\n A => 10,\n B => 11,\n C => 12,\n D => 13,\n E => 14,\n F => 15,\n);\n\nmy $s = ;\nchomp $s;\nmy ($a, $b) = split / /, $s;\n\nif ($n{$a} < $n{$b}) {\n print '<';\n} elsif ($n{$a} > $n{$b}) {\n print '>';\n} else {\n print '=';\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "sample_input": "A B\n"}, "reference_outputs": ["<\n"], "source_document_id": "p03547", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 283, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s847341375", "group_id": "codeNet:p03547", "input_text": "<>=~$\";print+(\"=\",\">\",\"<\")[ord($`)<=>ord$']", "language": "Perl", "metadata": {"date": 1510460054, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03547.html", "problem_id": "p03547", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03547/input.txt", "sample_output_relpath": "derived/input_output/data/p03547/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03547/Perl/s847341375.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s847341375", "user_id": "u657913472"}, "prompt_components": {"gold_output": "<\n", "input_to_evaluate": "<>=~$\";print+(\"=\",\">\",\"<\")[ord($`)<=>ord$']", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "sample_input": "A B\n"}, "reference_outputs": ["<\n"], "source_document_id": "p03547", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s469106497", "group_id": "codeNet:p03550", "input_text": "(my@a=lines.words)[2,*-1]>>.&{abs $_-@a.pop}.max.say", "language": "Perl", "metadata": {"date": 1538447087, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03550.html", "problem_id": "p03550", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03550/input.txt", "sample_output_relpath": "derived/input_output/data/p03550/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03550/Perl/s469106497.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s469106497", "user_id": "u657913472"}, "prompt_components": {"gold_output": "900\n", "input_to_evaluate": "(my@a=lines.words)[2,*-1]>>.&{abs $_-@a.pop}.max.say", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.\n\nTwo people X and Y will play a game using this deck. Initially, X has a card with Z written on it in his hand, and Y has a card with W written on it in his hand. Then, starting from X, they will alternately perform the following action:\n\nDraw some number of cards from the top of the deck. Then, discard the card in his hand and keep the last drawn card instead. Here, at least one card must be drawn.\n\nThe game ends when there is no more card in the deck. The score of the game is the absolute difference of the integers written on the cards in the two players' hand.\n\nX will play the game so that the score will be maximized, and Y will play the game so that the score will be minimized. What will be the score of the game?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq Z, W, a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Z W\na_1 a_2 ... a_N\n\nOutput\n\nPrint the score.\n\nSample Input 1\n\n3 100 100\n10 1000 100\n\nSample Output 1\n\n900\n\nIf X draws two cards first, Y will draw the last card, and the score will be |1000 - 100| = 900.\n\nSample Input 2\n\n3 100 1000\n10 100 100\n\nSample Output 2\n\n900\n\nIf X draws all the cards first, the score will be |1000 - 100| = 900.\n\nSample Input 3\n\n5 1 1\n1 1 1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 1 1\n1000000000\n\nSample Output 4\n\n999999999", "sample_input": "3 100 100\n10 1000 100\n"}, "reference_outputs": ["900\n"], "source_document_id": "p03550", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.\n\nTwo people X and Y will play a game using this deck. Initially, X has a card with Z written on it in his hand, and Y has a card with W written on it in his hand. Then, starting from X, they will alternately perform the following action:\n\nDraw some number of cards from the top of the deck. Then, discard the card in his hand and keep the last drawn card instead. Here, at least one card must be drawn.\n\nThe game ends when there is no more card in the deck. The score of the game is the absolute difference of the integers written on the cards in the two players' hand.\n\nX will play the game so that the score will be maximized, and Y will play the game so that the score will be minimized. What will be the score of the game?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq Z, W, a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Z W\na_1 a_2 ... a_N\n\nOutput\n\nPrint the score.\n\nSample Input 1\n\n3 100 100\n10 1000 100\n\nSample Output 1\n\n900\n\nIf X draws two cards first, Y will draw the last card, and the score will be |1000 - 100| = 900.\n\nSample Input 2\n\n3 100 1000\n10 100 100\n\nSample Output 2\n\n900\n\nIf X draws all the cards first, the score will be |1000 - 100| = 900.\n\nSample Input 3\n\n5 1 1\n1 1 1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 1 1\n1000000000\n\nSample Output 4\n\n999999999", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 52, "cpu_time_ms": 292, "memory_kb": 64884}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s161466300", "group_id": "codeNet:p03552", "input_text": "<>=~/.* /;@a=glob<>;printf sort{$b-$a}abs$'-$a[-1],@a>1&&abs$a[-2]-pop@a", "language": "Perl", "metadata": {"date": 1510459078, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03552.html", "problem_id": "p03552", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03552/input.txt", "sample_output_relpath": "derived/input_output/data/p03552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03552/Perl/s161466300.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s161466300", "user_id": "u283869437"}, "prompt_components": {"gold_output": "900\n", "input_to_evaluate": "<>=~/.* /;@a=glob<>;printf sort{$b-$a}abs$'-$a[-1],@a>1&&abs$a[-2]-pop@a", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.\n\nTwo people X and Y will play a game using this deck. Initially, X has a card with Z written on it in his hand, and Y has a card with W written on it in his hand. Then, starting from X, they will alternately perform the following action:\n\nDraw some number of cards from the top of the deck. Then, discard the card in his hand and keep the last drawn card instead. Here, at least one card must be drawn.\n\nThe game ends when there is no more card in the deck. The score of the game is the absolute difference of the integers written on the cards in the two players' hand.\n\nX will play the game so that the score will be maximized, and Y will play the game so that the score will be minimized. What will be the score of the game?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq Z, W, a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Z W\na_1 a_2 ... a_N\n\nOutput\n\nPrint the score.\n\nSample Input 1\n\n3 100 100\n10 1000 100\n\nSample Output 1\n\n900\n\nIf X draws two cards first, Y will draw the last card, and the score will be |1000 - 100| = 900.\n\nSample Input 2\n\n3 100 1000\n10 100 100\n\nSample Output 2\n\n900\n\nIf X draws all the cards first, the score will be |1000 - 100| = 900.\n\nSample Input 3\n\n5 1 1\n1 1 1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 1 1\n1000000000\n\nSample Output 4\n\n999999999", "sample_input": "3 100 100\n10 1000 100\n"}, "reference_outputs": ["900\n"], "source_document_id": "p03552", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.\n\nTwo people X and Y will play a game using this deck. Initially, X has a card with Z written on it in his hand, and Y has a card with W written on it in his hand. Then, starting from X, they will alternately perform the following action:\n\nDraw some number of cards from the top of the deck. Then, discard the card in his hand and keep the last drawn card instead. Here, at least one card must be drawn.\n\nThe game ends when there is no more card in the deck. The score of the game is the absolute difference of the integers written on the cards in the two players' hand.\n\nX will play the game so that the score will be maximized, and Y will play the game so that the score will be minimized. What will be the score of the game?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq Z, W, a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Z W\na_1 a_2 ... a_N\n\nOutput\n\nPrint the score.\n\nSample Input 1\n\n3 100 100\n10 1000 100\n\nSample Output 1\n\n900\n\nIf X draws two cards first, Y will draw the last card, and the score will be |1000 - 100| = 900.\n\nSample Input 2\n\n3 100 1000\n10 100 100\n\nSample Output 2\n\n900\n\nIf X draws all the cards first, the score will be |1000 - 100| = 900.\n\nSample Input 3\n\n5 1 1\n1 1 1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 1 1\n1000000000\n\nSample Output 4\n\n999999999", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 10, "memory_kb": 1280}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s740192510", "group_id": "codeNet:p03556", "input_text": "$n=<>;for($i=1;$i**2<=$n;$i++){}print --$i**2", "language": "Perl", "metadata": {"date": 1559933881, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03556.html", "problem_id": "p03556", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03556/input.txt", "sample_output_relpath": "derived/input_output/data/p03556/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03556/Perl/s740192510.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s740192510", "user_id": "u573154728"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "$n=<>;for($i=1;$i**2<=$n;$i++){}print --$i**2", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the largest square number not exceeding N. Here, a square number is an integer that can be represented as the square of an integer.\n\nConstraints\n\n1 \\leq N \\leq 10^9\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 largest square number not exceeding N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\n10 is not square, but 9 = 3 × 3 is. Thus, we print 9.\n\nSample Input 2\n\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\n271828182\n\nSample Output 3\n\n271821169", "sample_input": "10\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03556", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the largest square number not exceeding N. Here, a square number is an integer that can be represented as the square of an integer.\n\nConstraints\n\n1 \\leq N \\leq 10^9\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 largest square number not exceeding N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\n10 is not square, but 9 = 3 × 3 is. Thus, we print 9.\n\nSample Input 2\n\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\n271828182\n\nSample Output 3\n\n271821169", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s947926070", "group_id": "codeNet:p03559", "input_text": "@$_=sort{$a-$b}glob<>for a..d;\nmap{\n\t$b++while$b<@b&&$b[$b]<$_;\n\t$d++while$d<@d&&$d[$d]<=$_;\n\t$\\+=$b*(@d-$d);\n}@c;\nprint", "language": "Perl", "metadata": {"date": 1509852472, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03559.html", "problem_id": "p03559", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03559/input.txt", "sample_output_relpath": "derived/input_output/data/p03559/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03559/Perl/s947926070.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s947926070", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "@$_=sort{$a-$b}glob<>for a..d;\nmap{\n\t$b++while$b<@b&&$b[$b]<$_;\n\t$d++while$d<@d&&$d[$d]<=$_;\n\t$\\+=$b*(@d-$d);\n}@c;\nprint", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower.\n\nHe has N parts for each of the three categories. The size of the i-th upper part is A_i, the size of the i-th middle part is B_i, and the size of the i-th lower part is C_i.\n\nTo build an altar, the size of the middle part must be strictly greater than that of the upper part, and the size of the lower part must be strictly greater than that of the middle part. On the other hand, any three parts that satisfy these conditions can be combined to form an altar.\n\nHow many different altars can Ringo build? Here, two altars are considered different when at least one of the three parts used is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq C_i \\leq 10^9(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_N\nB_1 ... B_N\nC_1 ... C_N\n\nOutput\n\nPrint the number of different altars that Ringo can build.\n\nSample Input 1\n\n2\n1 5\n2 4\n3 6\n\nSample Output 1\n\n3\n\nThe following three altars can be built:\n\nUpper: 1-st part, Middle: 1-st part, Lower: 1-st part\n\nUpper: 1-st part, Middle: 1-st part, Lower: 2-nd part\n\nUpper: 1-st part, Middle: 2-nd part, Lower: 2-nd part\n\nSample Input 2\n\n3\n1 1 1\n2 2 2\n3 3 3\n\nSample Output 2\n\n27\n\nSample Input 3\n\n6\n3 14 159 2 6 53\n58 9 79 323 84 6\n2643 383 2 79 50 288\n\nSample Output 3\n\n87", "sample_input": "2\n1 5\n2 4\n3 6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03559", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower.\n\nHe has N parts for each of the three categories. The size of the i-th upper part is A_i, the size of the i-th middle part is B_i, and the size of the i-th lower part is C_i.\n\nTo build an altar, the size of the middle part must be strictly greater than that of the upper part, and the size of the lower part must be strictly greater than that of the middle part. On the other hand, any three parts that satisfy these conditions can be combined to form an altar.\n\nHow many different altars can Ringo build? Here, two altars are considered different when at least one of the three parts used is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq C_i \\leq 10^9(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_N\nB_1 ... B_N\nC_1 ... C_N\n\nOutput\n\nPrint the number of different altars that Ringo can build.\n\nSample Input 1\n\n2\n1 5\n2 4\n3 6\n\nSample Output 1\n\n3\n\nThe following three altars can be built:\n\nUpper: 1-st part, Middle: 1-st part, Lower: 1-st part\n\nUpper: 1-st part, Middle: 1-st part, Lower: 2-nd part\n\nUpper: 1-st part, Middle: 2-nd part, Lower: 2-nd part\n\nSample Input 2\n\n3\n1 1 1\n2 2 2\n3 3 3\n\nSample Output 2\n\n27\n\nSample Input 3\n\n6\n3 14 159 2 6 53\n58 9 79 323 84 6\n2643 383 2 79 50 288\n\nSample Output 3\n\n87", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 120, "cpu_time_ms": 1458, "memory_kb": 48260}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s230678562", "group_id": "codeNet:p03561", "input_text": "$,=$\";\n($K,$N)=glob<>;\nif($K%2){\n\t@_=($K+1>>1)x$N;\n\t$i=$#_;\n\tfor(1..$N/2){\n\t\tif($_[$i]){\n\t\t\t--$_[$i]\n\t\t}elsif(--$_[--$i]){\n\t\t\twhile(++$i<$N){\n\t\t\t\t$_[$i]=$K\n\t\t\t}\n\t\t}\n\t}\n\tprint grep$_,@_\n}else{\n\tprint$K/2,($K)x($N-1)\n}\n", "language": "Perl", "metadata": {"date": 1521253344, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03561.html", "problem_id": "p03561", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03561/input.txt", "sample_output_relpath": "derived/input_output/data/p03561/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03561/Perl/s230678562.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s230678562", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2 1\n", "input_to_evaluate": "$,=$\";\n($K,$N)=glob<>;\nif($K%2){\n\t@_=($K+1>>1)x$N;\n\t$i=$#_;\n\tfor(1..$N/2){\n\t\tif($_[$i]){\n\t\t\t--$_[$i]\n\t\t}elsif(--$_[--$i]){\n\t\t\twhile(++$i<$N){\n\t\t\t\t$_[$i]=$K\n\t\t\t}\n\t\t}\n\t}\n\tprint grep$_,@_\n}else{\n\tprint$K/2,($K)x($N-1)\n}\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nIn Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between 1 and N (inclusive) consisting of integers between 1 and K (inclusive) are listed.\n\nLet the total number of sequences listed in FEIS be X. Among those sequences, find the (X/2)-th (rounded up to the nearest integer) lexicographically smallest one.\n\nConstraints\n\n1 \\leq N,K \\leq 3 × 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\n\nOutput\n\nPrint the (X/2)-th (rounded up to the nearest integer) lexicographically smallest sequence listed in FEIS, with spaces in between, where X is the total number of sequences listed in FEIS.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2 1\n\nThere are 12 sequences listed in FEIS: (1),(1,1),(1,2),(1,3),(2),(2,1),(2,2),(2,3),(3),(3,1),(3,2),(3,3).\nThe (12/2 = 6)-th lexicographically smallest one among them is (2,1).\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\n1 2 2 2\n\nSample Input 3\n\n5 14\n\nSample Output 3\n\n3 3 3 3 3 3 3 3 3 3 3 3 2 2", "sample_input": "3 2\n"}, "reference_outputs": ["2 1\n"], "source_document_id": "p03561", "source_text": "Score : 800 points\n\nProblem Statement\n\nIn Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between 1 and N (inclusive) consisting of integers between 1 and K (inclusive) are listed.\n\nLet the total number of sequences listed in FEIS be X. Among those sequences, find the (X/2)-th (rounded up to the nearest integer) lexicographically smallest one.\n\nConstraints\n\n1 \\leq N,K \\leq 3 × 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\n\nOutput\n\nPrint the (X/2)-th (rounded up to the nearest integer) lexicographically smallest sequence listed in FEIS, with spaces in between, where X is the total number of sequences listed in FEIS.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2 1\n\nThere are 12 sequences listed in FEIS: (1),(1,1),(1,2),(1,3),(2),(2,1),(2,2),(2,3),(3),(3,1),(3,2),(3,3).\nThe (12/2 = 6)-th lexicographically smallest one among them is (2,1).\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\n1 2 2 2\n\nSample Input 3\n\n5 14\n\nSample Output 3\n\n3 3 3 3 3 3 3 3 3 3 3 3 2 2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 141, "memory_kb": 14592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s625630302", "group_id": "codeNet:p03563", "input_text": "$r = <>; chomp $r;\n$g = <>; chomp $g;\nprint 2 * $g - $r;\n", "language": "Perl", "metadata": {"date": 1509663110, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03563.html", "problem_id": "p03563", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03563/input.txt", "sample_output_relpath": "derived/input_output/data/p03563/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03563/Perl/s625630302.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s625630302", "user_id": "u698551366"}, "prompt_components": {"gold_output": "2032\n", "input_to_evaluate": "$r = <>; chomp $r;\n$g = <>; chomp $g;\nprint 2 * $g - $r;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a user of a site that hosts programming contests.\n\nWhen a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:\n\nLet the current rating of the user be a.\n\nSuppose that the performance of the user in the contest is b.\n\nThen, the new rating of the user will be the avarage of a and b.\n\nFor example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.\n\nTakahashi's current rating is R, and he wants his rating to be exactly G after the next contest.\n\nFind the performance required to achieve it.\n\nConstraints\n\n0 \\leq R, G \\leq 4500\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\nG\n\nOutput\n\nPrint the performance required to achieve the objective.\n\nSample Input 1\n\n2002\n2017\n\nSample Output 1\n\n2032\n\nTakahashi's current rating is 2002.\n\nIf his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.\n\nSample Input 2\n\n4500\n0\n\nSample Output 2\n\n-4500\n\nAlthough the current and desired ratings are between 0 and 4500, the performance of a user can be below 0.", "sample_input": "2002\n2017\n"}, "reference_outputs": ["2032\n"], "source_document_id": "p03563", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a user of a site that hosts programming contests.\n\nWhen a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:\n\nLet the current rating of the user be a.\n\nSuppose that the performance of the user in the contest is b.\n\nThen, the new rating of the user will be the avarage of a and b.\n\nFor example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.\n\nTakahashi's current rating is R, and he wants his rating to be exactly G after the next contest.\n\nFind the performance required to achieve it.\n\nConstraints\n\n0 \\leq R, G \\leq 4500\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\nG\n\nOutput\n\nPrint the performance required to achieve the objective.\n\nSample Input 1\n\n2002\n2017\n\nSample Output 1\n\n2032\n\nTakahashi's current rating is 2002.\n\nIf his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.\n\nSample Input 2\n\n4500\n0\n\nSample Output 2\n\n-4500\n\nAlthough the current and desired ratings are between 0 and 4500, the performance of a user can be below 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s327226225", "group_id": "codeNet:p03563", "input_text": "print-<>+2*<>print-<>+2*<>", "language": "Perl", "metadata": {"date": 1509239116, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03563.html", "problem_id": "p03563", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03563/input.txt", "sample_output_relpath": "derived/input_output/data/p03563/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03563/Perl/s327226225.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s327226225", "user_id": "u207056619"}, "prompt_components": {"gold_output": "2032\n", "input_to_evaluate": "print-<>+2*<>print-<>+2*<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a user of a site that hosts programming contests.\n\nWhen a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:\n\nLet the current rating of the user be a.\n\nSuppose that the performance of the user in the contest is b.\n\nThen, the new rating of the user will be the avarage of a and b.\n\nFor example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.\n\nTakahashi's current rating is R, and he wants his rating to be exactly G after the next contest.\n\nFind the performance required to achieve it.\n\nConstraints\n\n0 \\leq R, G \\leq 4500\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\nG\n\nOutput\n\nPrint the performance required to achieve the objective.\n\nSample Input 1\n\n2002\n2017\n\nSample Output 1\n\n2032\n\nTakahashi's current rating is 2002.\n\nIf his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.\n\nSample Input 2\n\n4500\n0\n\nSample Output 2\n\n-4500\n\nAlthough the current and desired ratings are between 0 and 4500, the performance of a user can be below 0.", "sample_input": "2002\n2017\n"}, "reference_outputs": ["2032\n"], "source_document_id": "p03563", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a user of a site that hosts programming contests.\n\nWhen a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:\n\nLet the current rating of the user be a.\n\nSuppose that the performance of the user in the contest is b.\n\nThen, the new rating of the user will be the avarage of a and b.\n\nFor example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.\n\nTakahashi's current rating is R, and he wants his rating to be exactly G after the next contest.\n\nFind the performance required to achieve it.\n\nConstraints\n\n0 \\leq R, G \\leq 4500\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\nG\n\nOutput\n\nPrint the performance required to achieve the objective.\n\nSample Input 1\n\n2002\n2017\n\nSample Output 1\n\n2032\n\nTakahashi's current rating is 2002.\n\nIf his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.\n\nSample Input 2\n\n4500\n0\n\nSample Output 2\n\n-4500\n\nAlthough the current and desired ratings are between 0 and 4500, the performance of a user can be below 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 26, "cpu_time_ms": 1, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s844636463", "group_id": "codeNet:p03564", "input_text": "say 1+[+] map *min($/+=get),(1,2,4...*)[^get]", "language": "Perl", "metadata": {"date": 1534809150, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03564.html", "problem_id": "p03564", "resource_group": "low_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/Perl/s844636463.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s844636463", "user_id": "u657913472"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "say 1+[+] map *min($/+=get),(1,2,4...*)[^get]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 170, "memory_kb": 55408}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s334552376", "group_id": "codeNet:p03564", "input_text": "$|=1;\n$N = ;\nchomp $N;\n$K = ;\nchomp $K;\n\n$V=1;\nfor($i=1;$i<=$N;$i++){\n\tif($V+$K<$V*2) {\n\t\t$V=$V+$K;\n\t} else {\n\t\t$V=$V*2;\n\t}\n}\nprint \"$V\\n\";\n", "language": "Perl", "metadata": {"date": 1516073930, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03564.html", "problem_id": "p03564", "resource_group": "low_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/Perl/s334552376.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s334552376", "user_id": "u420702888"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$|=1;\n$N = ;\nchomp $N;\n$K = ;\nchomp $K;\n\n$V=1;\nfor($i=1;$i<=$N;$i++){\n\tif($V+$K<$V*2) {\n\t\t$V=$V+$K;\n\t} else {\n\t\t$V=$V*2;\n\t}\n}\nprint \"$V\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s559527201", "group_id": "codeNet:p03564", "input_text": "$\\=1;$k+=<>,$\\+=$\\>$'?$':$\\for 1..$n;print", "language": "Perl", "metadata": {"date": 1509244859, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03564.html", "problem_id": "p03564", "resource_group": "low_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/Perl/s559527201.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s559527201", "user_id": "u657913472"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$\\=1;$k+=<>,$\\+=$\\>$'?$':$\\for 1..$n;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s948977444", "group_id": "codeNet:p03566", "input_text": "get;\nmy@z=$/=0;map {@z[0]=$/min=$!=.[1]*2;@z.unshift($/=++$/min$!)xx.[0]*2},[Z] lines>>.words;\n$/=-1;\nsay @z.map({$/=1+$/min$_}).sum/4", "language": "Perl", "metadata": {"date": 1543747862, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03566.html", "problem_id": "p03566", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03566/input.txt", "sample_output_relpath": "derived/input_output/data/p03566/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03566/Perl/s948977444.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s948977444", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2100.000000000000000\n", "input_to_evaluate": "get;\nmy@z=$/=0;map {@z[0]=$/min=$!=.[1]*2;@z.unshift($/=++$/min$!)xx.[0]*2},[Z] lines>>.words;\n$/=-1;\nsay @z.map({$/=1+$/min$_}).sum/4", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express.\n\nIn the plan developed by the president Takahashi, the trains will run as follows:\n\nA train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds.\n\nIn the first t_1 seconds, a train must run at a speed of at most v_1 m/s (meters per second). Similarly, in the subsequent t_2 seconds, a train must run at a speed of at most v_2 m/s, and so on.\n\nAccording to the specifications of the trains, the acceleration of a train must be always within ±1m/s^2. Additionally, a train must stop at the beginning and the end of the run.\n\nFind the maximum possible distance that a train can cover in the run.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq t_i \\leq 200\n\n1 \\leq v_i \\leq 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 t_2 t_3 … t_N\nv_1 v_2 v_3 … v_N\n\nOutput\n\nPrint the maximum possible that a train can cover in the run.\n\nOutput is considered correct if its absolute difference from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n1\n100\n30\n\nSample Output 1\n\n2100.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 30 seconds, it accelerates at a rate of 1m/s^2, covering 450 meters.\n\nIn the subsequent 40 seconds, it maintains the velocity of 30m/s, covering 1200 meters.\n\nIn the last 30 seconds, it decelerates at the acceleration of -1m/s^2, covering 450 meters.\n\nThe total distance covered is 450 + 1200 + 450 = 2100 meters.\n\nSample Input 2\n\n2\n60 50\n34 38\n\nSample Output 2\n\n2632.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 34 seconds, it accelerates at a rate of 1m/s^2, covering 578 meters.\n\nIn the subsequent 26 seconds, it maintains the velocity of 34m/s, covering 884 meters.\n\nIn the subsequent 4 seconds, it accelerates at a rate of 1m/s^2, covering 144 meters.\n\nIn the subsequent 8 seconds, it maintains the velocity of 38m/s, covering 304 meters.\n\nIn the last 38 seconds, it decelerates at the acceleration of -1m/s^2, covering 722 meters.\n\nThe total distance covered is 578 + 884 + 144 + 304 + 722 = 2632 meters.\n\nSample Input 3\n\n3\n12 14 2\n6 2 7\n\nSample Output 3\n\n76.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 6 seconds, it accelerates at a rate of 1m/s^2, covering 18 meters.\n\nIn the subsequent 2 seconds, it maintains the velocity of 6m/s, covering 12 meters.\n\nIn the subsequent 4 seconds, it decelerates at the acceleration of -1m/s^2, covering 16 meters.\n\nIn the subsequent 14 seconds, it maintains the velocity of 2m/s, covering 28 meters.\n\nIn the last 2 seconds, it decelerates at the acceleration of -1m/s^2, covering 2 meters.\n\nThe total distance covered is 18 + 12 + 16 + 28 + 2 = 76 meters.\n\nSample Input 4\n\n1\n9\n10\n\nSample Output 4\n\n20.250000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 4.5 seconds, it accelerates at a rate of 1m/s^2, covering 10.125 meters.\n\nIn the last 4.5 seconds, it decelerates at the acceleration of -1m/s^2, covering 10.125 meters.\n\nThe total distance covered is 10.125 + 10.125 = 20.25 meters.\n\nSample Input 5\n\n10\n64 55 27 35 76 119 7 18 49 100\n29 19 31 39 27 48 41 87 55 70\n\nSample Output 5\n\n20291.000000000000", "sample_input": "1\n100\n30\n"}, "reference_outputs": ["2100.000000000000000\n"], "source_document_id": "p03566", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express.\n\nIn the plan developed by the president Takahashi, the trains will run as follows:\n\nA train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds.\n\nIn the first t_1 seconds, a train must run at a speed of at most v_1 m/s (meters per second). Similarly, in the subsequent t_2 seconds, a train must run at a speed of at most v_2 m/s, and so on.\n\nAccording to the specifications of the trains, the acceleration of a train must be always within ±1m/s^2. Additionally, a train must stop at the beginning and the end of the run.\n\nFind the maximum possible distance that a train can cover in the run.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq t_i \\leq 200\n\n1 \\leq v_i \\leq 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 t_2 t_3 … t_N\nv_1 v_2 v_3 … v_N\n\nOutput\n\nPrint the maximum possible that a train can cover in the run.\n\nOutput is considered correct if its absolute difference from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n1\n100\n30\n\nSample Output 1\n\n2100.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 30 seconds, it accelerates at a rate of 1m/s^2, covering 450 meters.\n\nIn the subsequent 40 seconds, it maintains the velocity of 30m/s, covering 1200 meters.\n\nIn the last 30 seconds, it decelerates at the acceleration of -1m/s^2, covering 450 meters.\n\nThe total distance covered is 450 + 1200 + 450 = 2100 meters.\n\nSample Input 2\n\n2\n60 50\n34 38\n\nSample Output 2\n\n2632.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 34 seconds, it accelerates at a rate of 1m/s^2, covering 578 meters.\n\nIn the subsequent 26 seconds, it maintains the velocity of 34m/s, covering 884 meters.\n\nIn the subsequent 4 seconds, it accelerates at a rate of 1m/s^2, covering 144 meters.\n\nIn the subsequent 8 seconds, it maintains the velocity of 38m/s, covering 304 meters.\n\nIn the last 38 seconds, it decelerates at the acceleration of -1m/s^2, covering 722 meters.\n\nThe total distance covered is 578 + 884 + 144 + 304 + 722 = 2632 meters.\n\nSample Input 3\n\n3\n12 14 2\n6 2 7\n\nSample Output 3\n\n76.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 6 seconds, it accelerates at a rate of 1m/s^2, covering 18 meters.\n\nIn the subsequent 2 seconds, it maintains the velocity of 6m/s, covering 12 meters.\n\nIn the subsequent 4 seconds, it decelerates at the acceleration of -1m/s^2, covering 16 meters.\n\nIn the subsequent 14 seconds, it maintains the velocity of 2m/s, covering 28 meters.\n\nIn the last 2 seconds, it decelerates at the acceleration of -1m/s^2, covering 2 meters.\n\nThe total distance covered is 18 + 12 + 16 + 28 + 2 = 76 meters.\n\nSample Input 4\n\n1\n9\n10\n\nSample Output 4\n\n20.250000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 4.5 seconds, it accelerates at a rate of 1m/s^2, covering 10.125 meters.\n\nIn the last 4.5 seconds, it decelerates at the acceleration of -1m/s^2, covering 10.125 meters.\n\nThe total distance covered is 10.125 + 10.125 = 20.25 meters.\n\nSample Input 5\n\n10\n64 55 27 35 76 119 7 18 49 100\n29 19 31 39 27 48 41 87 55 70\n\nSample Output 5\n\n20291.000000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 773, "memory_kb": 93944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s825156479", "group_id": "codeNet:p03566", "input_text": "get;\nmy@z=$/=0;\nmap {@z[0]=$/min=$!=.[1]*2;@z.unshift($/=++$/min$!)xx.[0]*2},(get.words Z get.words);\n@z.shift;\n$/=$!=0;\n@z.map({$!+=$/=1+$/min$_});\nsay $!/4", "language": "Perl", "metadata": {"date": 1543747500, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03566.html", "problem_id": "p03566", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03566/input.txt", "sample_output_relpath": "derived/input_output/data/p03566/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03566/Perl/s825156479.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s825156479", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2100.000000000000000\n", "input_to_evaluate": "get;\nmy@z=$/=0;\nmap {@z[0]=$/min=$!=.[1]*2;@z.unshift($/=++$/min$!)xx.[0]*2},(get.words Z get.words);\n@z.shift;\n$/=$!=0;\n@z.map({$!+=$/=1+$/min$_});\nsay $!/4", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express.\n\nIn the plan developed by the president Takahashi, the trains will run as follows:\n\nA train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds.\n\nIn the first t_1 seconds, a train must run at a speed of at most v_1 m/s (meters per second). Similarly, in the subsequent t_2 seconds, a train must run at a speed of at most v_2 m/s, and so on.\n\nAccording to the specifications of the trains, the acceleration of a train must be always within ±1m/s^2. Additionally, a train must stop at the beginning and the end of the run.\n\nFind the maximum possible distance that a train can cover in the run.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq t_i \\leq 200\n\n1 \\leq v_i \\leq 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 t_2 t_3 … t_N\nv_1 v_2 v_3 … v_N\n\nOutput\n\nPrint the maximum possible that a train can cover in the run.\n\nOutput is considered correct if its absolute difference from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n1\n100\n30\n\nSample Output 1\n\n2100.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 30 seconds, it accelerates at a rate of 1m/s^2, covering 450 meters.\n\nIn the subsequent 40 seconds, it maintains the velocity of 30m/s, covering 1200 meters.\n\nIn the last 30 seconds, it decelerates at the acceleration of -1m/s^2, covering 450 meters.\n\nThe total distance covered is 450 + 1200 + 450 = 2100 meters.\n\nSample Input 2\n\n2\n60 50\n34 38\n\nSample Output 2\n\n2632.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 34 seconds, it accelerates at a rate of 1m/s^2, covering 578 meters.\n\nIn the subsequent 26 seconds, it maintains the velocity of 34m/s, covering 884 meters.\n\nIn the subsequent 4 seconds, it accelerates at a rate of 1m/s^2, covering 144 meters.\n\nIn the subsequent 8 seconds, it maintains the velocity of 38m/s, covering 304 meters.\n\nIn the last 38 seconds, it decelerates at the acceleration of -1m/s^2, covering 722 meters.\n\nThe total distance covered is 578 + 884 + 144 + 304 + 722 = 2632 meters.\n\nSample Input 3\n\n3\n12 14 2\n6 2 7\n\nSample Output 3\n\n76.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 6 seconds, it accelerates at a rate of 1m/s^2, covering 18 meters.\n\nIn the subsequent 2 seconds, it maintains the velocity of 6m/s, covering 12 meters.\n\nIn the subsequent 4 seconds, it decelerates at the acceleration of -1m/s^2, covering 16 meters.\n\nIn the subsequent 14 seconds, it maintains the velocity of 2m/s, covering 28 meters.\n\nIn the last 2 seconds, it decelerates at the acceleration of -1m/s^2, covering 2 meters.\n\nThe total distance covered is 18 + 12 + 16 + 28 + 2 = 76 meters.\n\nSample Input 4\n\n1\n9\n10\n\nSample Output 4\n\n20.250000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 4.5 seconds, it accelerates at a rate of 1m/s^2, covering 10.125 meters.\n\nIn the last 4.5 seconds, it decelerates at the acceleration of -1m/s^2, covering 10.125 meters.\n\nThe total distance covered is 10.125 + 10.125 = 20.25 meters.\n\nSample Input 5\n\n10\n64 55 27 35 76 119 7 18 49 100\n29 19 31 39 27 48 41 87 55 70\n\nSample Output 5\n\n20291.000000000000", "sample_input": "1\n100\n30\n"}, "reference_outputs": ["2100.000000000000000\n"], "source_document_id": "p03566", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express.\n\nIn the plan developed by the president Takahashi, the trains will run as follows:\n\nA train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds.\n\nIn the first t_1 seconds, a train must run at a speed of at most v_1 m/s (meters per second). Similarly, in the subsequent t_2 seconds, a train must run at a speed of at most v_2 m/s, and so on.\n\nAccording to the specifications of the trains, the acceleration of a train must be always within ±1m/s^2. Additionally, a train must stop at the beginning and the end of the run.\n\nFind the maximum possible distance that a train can cover in the run.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq t_i \\leq 200\n\n1 \\leq v_i \\leq 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 t_2 t_3 … t_N\nv_1 v_2 v_3 … v_N\n\nOutput\n\nPrint the maximum possible that a train can cover in the run.\n\nOutput is considered correct if its absolute difference from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n1\n100\n30\n\nSample Output 1\n\n2100.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 30 seconds, it accelerates at a rate of 1m/s^2, covering 450 meters.\n\nIn the subsequent 40 seconds, it maintains the velocity of 30m/s, covering 1200 meters.\n\nIn the last 30 seconds, it decelerates at the acceleration of -1m/s^2, covering 450 meters.\n\nThe total distance covered is 450 + 1200 + 450 = 2100 meters.\n\nSample Input 2\n\n2\n60 50\n34 38\n\nSample Output 2\n\n2632.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 34 seconds, it accelerates at a rate of 1m/s^2, covering 578 meters.\n\nIn the subsequent 26 seconds, it maintains the velocity of 34m/s, covering 884 meters.\n\nIn the subsequent 4 seconds, it accelerates at a rate of 1m/s^2, covering 144 meters.\n\nIn the subsequent 8 seconds, it maintains the velocity of 38m/s, covering 304 meters.\n\nIn the last 38 seconds, it decelerates at the acceleration of -1m/s^2, covering 722 meters.\n\nThe total distance covered is 578 + 884 + 144 + 304 + 722 = 2632 meters.\n\nSample Input 3\n\n3\n12 14 2\n6 2 7\n\nSample Output 3\n\n76.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 6 seconds, it accelerates at a rate of 1m/s^2, covering 18 meters.\n\nIn the subsequent 2 seconds, it maintains the velocity of 6m/s, covering 12 meters.\n\nIn the subsequent 4 seconds, it decelerates at the acceleration of -1m/s^2, covering 16 meters.\n\nIn the subsequent 14 seconds, it maintains the velocity of 2m/s, covering 28 meters.\n\nIn the last 2 seconds, it decelerates at the acceleration of -1m/s^2, covering 2 meters.\n\nThe total distance covered is 18 + 12 + 16 + 28 + 2 = 76 meters.\n\nSample Input 4\n\n1\n9\n10\n\nSample Output 4\n\n20.250000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 4.5 seconds, it accelerates at a rate of 1m/s^2, covering 10.125 meters.\n\nIn the last 4.5 seconds, it decelerates at the acceleration of -1m/s^2, covering 10.125 meters.\n\nThe total distance covered is 10.125 + 10.125 = 20.25 meters.\n\nSample Input 5\n\n10\n64 55 27 35 76 119 7 18 49 100\n29 19 31 39 27 48 41 87 55 70\n\nSample Output 5\n\n20291.000000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 598, "memory_kb": 82012}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s470640551", "group_id": "codeNet:p03566", "input_text": "get;\nmy@z=$/=0;\nmap {@z[0]=$/min=$!=.[1]*2;@z.unshift($/=++$/min$!)xx.[0]*2},(get.words Z get.words);\n@z.shift;\nsay .25*[+] produce 1+*min*,0,|@z", "language": "Perl", "metadata": {"date": 1543746819, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03566.html", "problem_id": "p03566", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03566/input.txt", "sample_output_relpath": "derived/input_output/data/p03566/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03566/Perl/s470640551.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s470640551", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2100.000000000000000\n", "input_to_evaluate": "get;\nmy@z=$/=0;\nmap {@z[0]=$/min=$!=.[1]*2;@z.unshift($/=++$/min$!)xx.[0]*2},(get.words Z get.words);\n@z.shift;\nsay .25*[+] produce 1+*min*,0,|@z", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express.\n\nIn the plan developed by the president Takahashi, the trains will run as follows:\n\nA train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds.\n\nIn the first t_1 seconds, a train must run at a speed of at most v_1 m/s (meters per second). Similarly, in the subsequent t_2 seconds, a train must run at a speed of at most v_2 m/s, and so on.\n\nAccording to the specifications of the trains, the acceleration of a train must be always within ±1m/s^2. Additionally, a train must stop at the beginning and the end of the run.\n\nFind the maximum possible distance that a train can cover in the run.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq t_i \\leq 200\n\n1 \\leq v_i \\leq 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 t_2 t_3 … t_N\nv_1 v_2 v_3 … v_N\n\nOutput\n\nPrint the maximum possible that a train can cover in the run.\n\nOutput is considered correct if its absolute difference from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n1\n100\n30\n\nSample Output 1\n\n2100.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 30 seconds, it accelerates at a rate of 1m/s^2, covering 450 meters.\n\nIn the subsequent 40 seconds, it maintains the velocity of 30m/s, covering 1200 meters.\n\nIn the last 30 seconds, it decelerates at the acceleration of -1m/s^2, covering 450 meters.\n\nThe total distance covered is 450 + 1200 + 450 = 2100 meters.\n\nSample Input 2\n\n2\n60 50\n34 38\n\nSample Output 2\n\n2632.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 34 seconds, it accelerates at a rate of 1m/s^2, covering 578 meters.\n\nIn the subsequent 26 seconds, it maintains the velocity of 34m/s, covering 884 meters.\n\nIn the subsequent 4 seconds, it accelerates at a rate of 1m/s^2, covering 144 meters.\n\nIn the subsequent 8 seconds, it maintains the velocity of 38m/s, covering 304 meters.\n\nIn the last 38 seconds, it decelerates at the acceleration of -1m/s^2, covering 722 meters.\n\nThe total distance covered is 578 + 884 + 144 + 304 + 722 = 2632 meters.\n\nSample Input 3\n\n3\n12 14 2\n6 2 7\n\nSample Output 3\n\n76.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 6 seconds, it accelerates at a rate of 1m/s^2, covering 18 meters.\n\nIn the subsequent 2 seconds, it maintains the velocity of 6m/s, covering 12 meters.\n\nIn the subsequent 4 seconds, it decelerates at the acceleration of -1m/s^2, covering 16 meters.\n\nIn the subsequent 14 seconds, it maintains the velocity of 2m/s, covering 28 meters.\n\nIn the last 2 seconds, it decelerates at the acceleration of -1m/s^2, covering 2 meters.\n\nThe total distance covered is 18 + 12 + 16 + 28 + 2 = 76 meters.\n\nSample Input 4\n\n1\n9\n10\n\nSample Output 4\n\n20.250000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 4.5 seconds, it accelerates at a rate of 1m/s^2, covering 10.125 meters.\n\nIn the last 4.5 seconds, it decelerates at the acceleration of -1m/s^2, covering 10.125 meters.\n\nThe total distance covered is 10.125 + 10.125 = 20.25 meters.\n\nSample Input 5\n\n10\n64 55 27 35 76 119 7 18 49 100\n29 19 31 39 27 48 41 87 55 70\n\nSample Output 5\n\n20291.000000000000", "sample_input": "1\n100\n30\n"}, "reference_outputs": ["2100.000000000000000\n"], "source_document_id": "p03566", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express.\n\nIn the plan developed by the president Takahashi, the trains will run as follows:\n\nA train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds.\n\nIn the first t_1 seconds, a train must run at a speed of at most v_1 m/s (meters per second). Similarly, in the subsequent t_2 seconds, a train must run at a speed of at most v_2 m/s, and so on.\n\nAccording to the specifications of the trains, the acceleration of a train must be always within ±1m/s^2. Additionally, a train must stop at the beginning and the end of the run.\n\nFind the maximum possible distance that a train can cover in the run.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq t_i \\leq 200\n\n1 \\leq v_i \\leq 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 t_2 t_3 … t_N\nv_1 v_2 v_3 … v_N\n\nOutput\n\nPrint the maximum possible that a train can cover in the run.\n\nOutput is considered correct if its absolute difference from the judge's output is at most 10^{-3}.\n\nSample Input 1\n\n1\n100\n30\n\nSample Output 1\n\n2100.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 30 seconds, it accelerates at a rate of 1m/s^2, covering 450 meters.\n\nIn the subsequent 40 seconds, it maintains the velocity of 30m/s, covering 1200 meters.\n\nIn the last 30 seconds, it decelerates at the acceleration of -1m/s^2, covering 450 meters.\n\nThe total distance covered is 450 + 1200 + 450 = 2100 meters.\n\nSample Input 2\n\n2\n60 50\n34 38\n\nSample Output 2\n\n2632.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 34 seconds, it accelerates at a rate of 1m/s^2, covering 578 meters.\n\nIn the subsequent 26 seconds, it maintains the velocity of 34m/s, covering 884 meters.\n\nIn the subsequent 4 seconds, it accelerates at a rate of 1m/s^2, covering 144 meters.\n\nIn the subsequent 8 seconds, it maintains the velocity of 38m/s, covering 304 meters.\n\nIn the last 38 seconds, it decelerates at the acceleration of -1m/s^2, covering 722 meters.\n\nThe total distance covered is 578 + 884 + 144 + 304 + 722 = 2632 meters.\n\nSample Input 3\n\n3\n12 14 2\n6 2 7\n\nSample Output 3\n\n76.000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 6 seconds, it accelerates at a rate of 1m/s^2, covering 18 meters.\n\nIn the subsequent 2 seconds, it maintains the velocity of 6m/s, covering 12 meters.\n\nIn the subsequent 4 seconds, it decelerates at the acceleration of -1m/s^2, covering 16 meters.\n\nIn the subsequent 14 seconds, it maintains the velocity of 2m/s, covering 28 meters.\n\nIn the last 2 seconds, it decelerates at the acceleration of -1m/s^2, covering 2 meters.\n\nThe total distance covered is 18 + 12 + 16 + 28 + 2 = 76 meters.\n\nSample Input 4\n\n1\n9\n10\n\nSample Output 4\n\n20.250000000000000000\n\nThe maximum distance is achieved when a train runs as follows:\n\nIn the first 4.5 seconds, it accelerates at a rate of 1m/s^2, covering 10.125 meters.\n\nIn the last 4.5 seconds, it decelerates at the acceleration of -1m/s^2, covering 10.125 meters.\n\nThe total distance covered is 10.125 + 10.125 = 20.25 meters.\n\nSample Input 5\n\n10\n64 55 27 35 76 119 7 18 49 100\n29 19 31 39 27 48 41 87 55 70\n\nSample Output 5\n\n20291.000000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2111, "memory_kb": 90140}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s554957931", "group_id": "codeNet:p03567", "input_text": "use v5.18; say \"AC\" if <> =~ \"AC\"", "language": "Perl", "metadata": {"date": 1508726780, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03567.html", "problem_id": "p03567", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03567/input.txt", "sample_output_relpath": "derived/input_output/data/p03567/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03567/Perl/s554957931.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s554957931", "user_id": "u376692089"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "use v5.18; say \"AC\" if <> =~ \"AC\"", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke built an online judge to hold a programming contest.\n\nWhen a program is submitted to the judge, the judge returns a verdict, which is a two-character string that appears in the string S as a contiguous substring.\n(The judge can return any two-character substring of S.)\n\nDetermine whether the judge can return the string AC as the verdict to a program.\n\nConstraints\n\n2 \\leq |S| \\leq 5\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 the judge can return the string AC as a verdict to a program, print Yes; if it cannot, print No.\n\nSample Input 1\n\nBACD\n\nSample Output 1\n\nYes\n\nThe string AC appears in BACD as a contiguous substring (the second and third characters).\n\nSample Input 2\n\nABCD\n\nSample Output 2\n\nNo\n\nAlthough the string ABCD contains both A and C (the first and third characters), the string AC does not appear in ABCD as a contiguous substring.\n\nSample Input 3\n\nCABD\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nACACA\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nXX\n\nSample Output 5\n\nNo", "sample_input": "BACD\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03567", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke built an online judge to hold a programming contest.\n\nWhen a program is submitted to the judge, the judge returns a verdict, which is a two-character string that appears in the string S as a contiguous substring.\n(The judge can return any two-character substring of S.)\n\nDetermine whether the judge can return the string AC as the verdict to a program.\n\nConstraints\n\n2 \\leq |S| \\leq 5\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 the judge can return the string AC as a verdict to a program, print Yes; if it cannot, print No.\n\nSample Input 1\n\nBACD\n\nSample Output 1\n\nYes\n\nThe string AC appears in BACD as a contiguous substring (the second and third characters).\n\nSample Input 2\n\nABCD\n\nSample Output 2\n\nNo\n\nAlthough the string ABCD contains both A and C (the first and third characters), the string AC does not appear in ABCD as a contiguous substring.\n\nSample Input 3\n\nCABD\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nACACA\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nXX\n\nSample Output 5\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 5, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s864402286", "group_id": "codeNet:p03568", "input_text": "print 3**(@a=glob<>)-2**grep~$_%2,@a", "language": "Perl", "metadata": {"date": 1508724174, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03568.html", "problem_id": "p03568", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03568/input.txt", "sample_output_relpath": "derived/input_output/data/p03568/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03568/Perl/s864402286.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s864402286", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "print 3**(@a=glob<>)-2**grep~$_%2,@a", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe will say that two integer sequences of length N, x_1, x_2, ..., x_N and y_1, y_2, ..., y_N, are similar when |x_i - y_i| \\leq 1 holds for all i (1 \\leq i \\leq N).\n\nIn particular, any integer sequence is similar to itself.\n\nYou are given an integer N and an integer sequence of length N, A_1, A_2, ..., A_N.\n\nHow many integer sequences b_1, b_2, ..., b_N are there such that b_1, b_2, ..., b_N is similar to A and the product of all elements, b_1 b_2 ... b_N, is even?\n\nConstraints\n\n1 \\leq N \\leq 10\n\n1 \\leq A_i \\leq 100\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 number of integer sequences that satisfy the condition.\n\nSample Input 1\n\n2\n2 3\n\nSample Output 1\n\n7\n\nThere are seven integer sequences that satisfy the condition:\n\n1, 2\n\n1, 4\n\n2, 2\n\n2, 3\n\n2, 4\n\n3, 2\n\n3, 4\n\nSample Input 2\n\n3\n3 3 3\n\nSample Output 2\n\n26\n\nSample Input 3\n\n1\n100\n\nSample Output 3\n\n1\n\nSample Input 4\n\n10\n90 52 56 71 44 8 13 30 57 84\n\nSample Output 4\n\n58921", "sample_input": "2\n2 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03568", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe will say that two integer sequences of length N, x_1, x_2, ..., x_N and y_1, y_2, ..., y_N, are similar when |x_i - y_i| \\leq 1 holds for all i (1 \\leq i \\leq N).\n\nIn particular, any integer sequence is similar to itself.\n\nYou are given an integer N and an integer sequence of length N, A_1, A_2, ..., A_N.\n\nHow many integer sequences b_1, b_2, ..., b_N are there such that b_1, b_2, ..., b_N is similar to A and the product of all elements, b_1 b_2 ... b_N, is even?\n\nConstraints\n\n1 \\leq N \\leq 10\n\n1 \\leq A_i \\leq 100\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 number of integer sequences that satisfy the condition.\n\nSample Input 1\n\n2\n2 3\n\nSample Output 1\n\n7\n\nThere are seven integer sequences that satisfy the condition:\n\n1, 2\n\n1, 4\n\n2, 2\n\n2, 3\n\n2, 4\n\n3, 2\n\n3, 4\n\nSample Input 2\n\n3\n3 3 3\n\nSample Output 2\n\n26\n\nSample Input 3\n\n1\n100\n\nSample Output 3\n\n1\n\nSample Input 4\n\n10\n90 52 56 71 44 8 13 30 57 84\n\nSample Output 4\n\n58921", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s187478877", "group_id": "codeNet:p03569", "input_text": "$_=<>;chomp;\nwhile(length($_)>1){\n /^(.)(.*)(.)$/;\n if($1 eq \"x\" and $3 ne \"x\"){\n $_=$2.$3;\n $i++;\n }elsif($1 ne \"x\" and $3 eq \"x\"){\n $_=$1.$2;\n $i++;\n }elsif($1 ne $3){\n print -1;\n exit;\n }else{\n $_=$2;\n }\n}\nprint $i//=0\n", "language": "Perl", "metadata": {"date": 1559569885, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03569.html", "problem_id": "p03569", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03569/input.txt", "sample_output_relpath": "derived/input_output/data/p03569/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03569/Perl/s187478877.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s187478877", "user_id": "u573154728"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$_=<>;chomp;\nwhile(length($_)>1){\n /^(.)(.*)(.)$/;\n if($1 eq \"x\" and $3 ne \"x\"){\n $_=$2.$3;\n $i++;\n }elsif($1 ne \"x\" and $3 eq \"x\"){\n $_=$1.$2;\n $i++;\n }elsif($1 ne $3){\n print -1;\n exit;\n }else{\n $_=$2;\n }\n}\nprint $i//=0\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string s consisting of lowercase English letters.\nSnuke can perform the following operation repeatedly:\n\nInsert a letter x to any position in s of his choice, including the beginning and end of s.\n\nSnuke's objective is to turn s into a palindrome.\nDetermine whether the objective is achievable. If it is achievable, find the minimum number of operations required.\n\nNotes\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are palindromes, while ab, abab and abcda are not.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\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 objective is achievable, print the number of operations required.\nIf it is not, print -1 instead.\n\nSample Input 1\n\nxabxa\n\nSample Output 1\n\n2\n\nOne solution is as follows (newly inserted x are shown in bold):\n\nxabxa → xaxbxa → xaxbxax\n\nSample Input 2\n\nab\n\nSample Output 2\n\n-1\n\nNo sequence of operations can turn s into a palindrome.\n\nSample Input 3\n\na\n\nSample Output 3\n\n0\n\ns is a palindrome already at the beginning.\n\nSample Input 4\n\noxxx\n\nSample Output 4\n\n3\n\nOne solution is as follows:\n\noxxx → xoxxx → xxoxxx → xxxoxxx", "sample_input": "xabxa\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03569", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string s consisting of lowercase English letters.\nSnuke can perform the following operation repeatedly:\n\nInsert a letter x to any position in s of his choice, including the beginning and end of s.\n\nSnuke's objective is to turn s into a palindrome.\nDetermine whether the objective is achievable. If it is achievable, find the minimum number of operations required.\n\nNotes\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are palindromes, while ab, abab and abcda are not.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\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 objective is achievable, print the number of operations required.\nIf it is not, print -1 instead.\n\nSample Input 1\n\nxabxa\n\nSample Output 1\n\n2\n\nOne solution is as follows (newly inserted x are shown in bold):\n\nxabxa → xaxbxa → xaxbxax\n\nSample Input 2\n\nab\n\nSample Output 2\n\n-1\n\nNo sequence of operations can turn s into a palindrome.\n\nSample Input 3\n\na\n\nSample Output 3\n\n0\n\ns is a palindrome already at the beginning.\n\nSample Input 4\n\noxxx\n\nSample Output 4\n\n3\n\nOne solution is as follows:\n\noxxx → xoxxx → xxoxxx → xxxoxxx", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2103, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s381689700", "group_id": "codeNet:p03573", "input_text": "$/=$\";print+(0+<>)^(0+<>)^(0+<>)", "language": "Perl", "metadata": {"date": 1528427361, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03573.html", "problem_id": "p03573", "resource_group": "low_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/Perl/s381689700.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s381689700", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "$/=$\";print+(0+<>)^(0+<>)^(0+<>)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s494468783", "group_id": "codeNet:p03576", "input_text": "$\\=~0;<>=~$\";@x=sort{$a-$b}<>;until(@x<($k=$')){map{@X=@p=sort{$a-$b}@X,/ /*$';$\\-=$-=$\\+($p[-$k]-pop@p)*($_-\"@x\")until@p<$k}@x;@X=();shift@x}print", "language": "Perl", "metadata": {"date": 1550149277, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03576.html", "problem_id": "p03576", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03576/input.txt", "sample_output_relpath": "derived/input_output/data/p03576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03576/Perl/s494468783.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s494468783", "user_id": "u657913472"}, "prompt_components": {"gold_output": "21\n", "input_to_evaluate": "$\\=~0;<>=~$\";@x=sort{$a-$b}<>;until(@x<($k=$')){map{@X=@p=sort{$a-$b}@X,/ /*$';$\\-=$-=$\\+($p[-$k]-pop@p)*($_-\"@x\")until@p<$k}@x;@X=();shift@x}print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N points in a two-dimensional plane.\n\nThe coordinates of the i-th point (1 \\leq i \\leq N) are (x_i,y_i).\n\nLet us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior.\n\nHere, points on the sides of the rectangle are considered to be in the interior.\n\nFind the minimum possible area of such a rectangle.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 50\n\n-10^9 \\leq x_i,y_i \\leq 10^9 (1 \\leq i \\leq N)\n\nx_i≠x_j (1 \\leq i[[≽] lines[1,3]>>.words].say", "language": "Perl", "metadata": {"date": 1520347844, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03578.html", "problem_id": "p03578", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03578/input.txt", "sample_output_relpath": "derived/input_output/data/p03578/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03578/Perl/s520947719.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s520947719", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "[[≽] lines[1,3]>>.words].say", "problem_context": "Score : 200 points\n\nProblem Statement\n\nRng is preparing a problem set for a qualification round of CODEFESTIVAL.\n\nHe has N candidates of problems. The difficulty of the i-th candidate is D_i.\n\nThere must be M problems in the problem set, and the difficulty of the i-th problem must be T_i. Here, one candidate of a problem cannot be used as multiple problems.\n\nDetermine whether Rng can complete the problem set without creating new candidates of problems.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq D_i \\leq 10^9\n\n1 \\leq M \\leq 200,000\n\n1 \\leq T_i \\leq 10^9\n\nAll numbers in the input are integers.\n\nPartial Score\n\n100 points will be awarded for passing the test set satisfying N \\leq 100 and M \\leq 100.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_1 D_2 ... D_N\nM\nT_1 T_2 ... T_M\n\nOutput\n\nPrint YES if Rng can complete the problem set without creating new candidates of problems; print NO if he cannot.\n\nSample Input 1\n\n5\n3 1 4 1 5\n3\n5 4 3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n7\n100 200 500 700 1200 1600 2000\n6\n100 200 500 700 1600 1600\n\nSample Output 2\n\nNO\n\nNot enough 1600s.\n\nSample Input 3\n\n1\n800\n5\n100 100 100 100 100\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n15\n1 2 2 3 3 3 4 4 4 4 5 5 5 5 5\n9\n5 4 3 2 1 2 3 4 5\n\nSample Output 4\n\nYES", "sample_input": "5\n3 1 4 1 5\n3\n5 4 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03578", "source_text": "Score : 200 points\n\nProblem Statement\n\nRng is preparing a problem set for a qualification round of CODEFESTIVAL.\n\nHe has N candidates of problems. The difficulty of the i-th candidate is D_i.\n\nThere must be M problems in the problem set, and the difficulty of the i-th problem must be T_i. Here, one candidate of a problem cannot be used as multiple problems.\n\nDetermine whether Rng can complete the problem set without creating new candidates of problems.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq D_i \\leq 10^9\n\n1 \\leq M \\leq 200,000\n\n1 \\leq T_i \\leq 10^9\n\nAll numbers in the input are integers.\n\nPartial Score\n\n100 points will be awarded for passing the test set satisfying N \\leq 100 and M \\leq 100.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_1 D_2 ... D_N\nM\nT_1 T_2 ... T_M\n\nOutput\n\nPrint YES if Rng can complete the problem set without creating new candidates of problems; print NO if he cannot.\n\nSample Input 1\n\n5\n3 1 4 1 5\n3\n5 4 3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n7\n100 200 500 700 1200 1600 2000\n6\n100 200 500 700 1600 1600\n\nSample Output 2\n\nNO\n\nNot enough 1600s.\n\nSample Input 3\n\n1\n800\n5\n100 100 100 100 100\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n15\n1 2 2 3 3 3 4 4 4 4 5 5 5 5 5\n9\n5 4 3 2 1 2 3 4 5\n\nSample Output 4\n\nYES", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 2109, "memory_kb": 99084}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s826048275", "group_id": "codeNet:p03578", "input_text": "<>;++$h{$_}for glob<>;<>;$x=1;$x*=$h{$_}-->0for glob<>;\nprint$x?YES:NO,$/", "language": "Perl", "metadata": {"date": 1507511054, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03578.html", "problem_id": "p03578", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03578/input.txt", "sample_output_relpath": "derived/input_output/data/p03578/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03578/Perl/s826048275.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s826048275", "user_id": "u283869437"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "<>;++$h{$_}for glob<>;<>;$x=1;$x*=$h{$_}-->0for glob<>;\nprint$x?YES:NO,$/", "problem_context": "Score : 200 points\n\nProblem Statement\n\nRng is preparing a problem set for a qualification round of CODEFESTIVAL.\n\nHe has N candidates of problems. The difficulty of the i-th candidate is D_i.\n\nThere must be M problems in the problem set, and the difficulty of the i-th problem must be T_i. Here, one candidate of a problem cannot be used as multiple problems.\n\nDetermine whether Rng can complete the problem set without creating new candidates of problems.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq D_i \\leq 10^9\n\n1 \\leq M \\leq 200,000\n\n1 \\leq T_i \\leq 10^9\n\nAll numbers in the input are integers.\n\nPartial Score\n\n100 points will be awarded for passing the test set satisfying N \\leq 100 and M \\leq 100.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_1 D_2 ... D_N\nM\nT_1 T_2 ... T_M\n\nOutput\n\nPrint YES if Rng can complete the problem set without creating new candidates of problems; print NO if he cannot.\n\nSample Input 1\n\n5\n3 1 4 1 5\n3\n5 4 3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n7\n100 200 500 700 1200 1600 2000\n6\n100 200 500 700 1600 1600\n\nSample Output 2\n\nNO\n\nNot enough 1600s.\n\nSample Input 3\n\n1\n800\n5\n100 100 100 100 100\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n15\n1 2 2 3 3 3 4 4 4 4 5 5 5 5 5\n9\n5 4 3 2 1 2 3 4 5\n\nSample Output 4\n\nYES", "sample_input": "5\n3 1 4 1 5\n3\n5 4 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03578", "source_text": "Score : 200 points\n\nProblem Statement\n\nRng is preparing a problem set for a qualification round of CODEFESTIVAL.\n\nHe has N candidates of problems. The difficulty of the i-th candidate is D_i.\n\nThere must be M problems in the problem set, and the difficulty of the i-th problem must be T_i. Here, one candidate of a problem cannot be used as multiple problems.\n\nDetermine whether Rng can complete the problem set without creating new candidates of problems.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq D_i \\leq 10^9\n\n1 \\leq M \\leq 200,000\n\n1 \\leq T_i \\leq 10^9\n\nAll numbers in the input are integers.\n\nPartial Score\n\n100 points will be awarded for passing the test set satisfying N \\leq 100 and M \\leq 100.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_1 D_2 ... D_N\nM\nT_1 T_2 ... T_M\n\nOutput\n\nPrint YES if Rng can complete the problem set without creating new candidates of problems; print NO if he cannot.\n\nSample Input 1\n\n5\n3 1 4 1 5\n3\n5 4 3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n7\n100 200 500 700 1200 1600 2000\n6\n100 200 500 700 1600 1600\n\nSample Output 2\n\nNO\n\nNot enough 1600s.\n\nSample Input 3\n\n1\n800\n5\n100 100 100 100 100\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n15\n1 2 2 3 3 3 4 4 4 4 5 5 5 5 5\n9\n5 4 3 2 1 2 3 4 5\n\nSample Output 4\n\nYES", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 993, "memory_kb": 65476}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s360158718", "group_id": "codeNet:p03579", "input_text": "($N,$M)=glob<>;\n/ /,${$`}{$'+0}=${$'+0}{$`}=1for<>;\n\nsub f{\n\tmy$c=$c[$_];\n\tfor(keys%$_){\n\t\tif($c[$_]){\n\t\t\tif($c[$_]==$c){\n\t\t\t\t$e=1\n\t\t\t}\n\t\t}else{\n\t\t\t$g+=$-=$c[$_]=-$c;\n\t\t\t&f\n\t\t}\n\t}\n}\nf$_=$g=$c[1]=1;\n\nprint$e?$N*($N-1)/2-$M:$g*($N-$g)-$M\n", "language": "Perl", "metadata": {"date": 1507692744, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03579.html", "problem_id": "p03579", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03579/input.txt", "sample_output_relpath": "derived/input_output/data/p03579/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03579/Perl/s360158718.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s360158718", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "($N,$M)=glob<>;\n/ /,${$`}{$'+0}=${$'+0}{$`}=1for<>;\n\nsub f{\n\tmy$c=$c[$_];\n\tfor(keys%$_){\n\t\tif($c[$_]){\n\t\t\tif($c[$_]==$c){\n\t\t\t\t$e=1\n\t\t\t}\n\t\t}else{\n\t\t\t$g+=$-=$c[$_]=-$c;\n\t\t\t&f\n\t\t}\n\t}\n}\nf$_=$g=$c[1]=1;\n\nprint$e?$N*($N-1)/2-$M:$g*($N-$g)-$M\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nRng has a connected undirected graph with N vertices.\nCurrently, there are M edges in the graph, and the i-th edge connects Vertices A_i and B_i.\n\nRng will add new edges to the graph by repeating the following operation:\n\nOperation: Choose u and v (u \\neq v) such that Vertex v can be reached by traversing exactly three edges from Vertex u, and add an edge connecting Vertices u and v. It is not allowed to add an edge if there is already an edge connecting Vertices u and v.\n\nFind the maximum possible number of edges that can be added.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i,B_i \\leq N\n\nThe graph has no self-loops or multiple edges.\n\nThe graph is connected.\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\nFind the maximum possible number of edges that can be added.\n\nSample Input 1\n\n6 5\n1 2\n2 3\n3 4\n4 5\n5 6\n\nSample Output 1\n\n4\n\nIf we add edges as shown below, four edges can be added, and no more.\n\nSample Input 2\n\n5 5\n1 2\n2 3\n3 1\n5 4\n5 1\n\nSample Output 2\n\n5\n\nFive edges can be added, for example, as follows:\n\nAdd an edge connecting Vertex 5 and Vertex 3.\n\nAdd an edge connecting Vertex 5 and Vertex 2.\n\nAdd an edge connecting Vertex 4 and Vertex 1.\n\nAdd an edge connecting Vertex 4 and Vertex 2.\n\nAdd an edge connecting Vertex 4 and Vertex 3.", "sample_input": "6 5\n1 2\n2 3\n3 4\n4 5\n5 6\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03579", "source_text": "Score : 500 points\n\nProblem Statement\n\nRng has a connected undirected graph with N vertices.\nCurrently, there are M edges in the graph, and the i-th edge connects Vertices A_i and B_i.\n\nRng will add new edges to the graph by repeating the following operation:\n\nOperation: Choose u and v (u \\neq v) such that Vertex v can be reached by traversing exactly three edges from Vertex u, and add an edge connecting Vertices u and v. It is not allowed to add an edge if there is already an edge connecting Vertices u and v.\n\nFind the maximum possible number of edges that can be added.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i,B_i \\leq N\n\nThe graph has no self-loops or multiple edges.\n\nThe graph is connected.\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\nFind the maximum possible number of edges that can be added.\n\nSample Input 1\n\n6 5\n1 2\n2 3\n3 4\n4 5\n5 6\n\nSample Output 1\n\n4\n\nIf we add edges as shown below, four edges can be added, and no more.\n\nSample Input 2\n\n5 5\n1 2\n2 3\n3 1\n5 4\n5 1\n\nSample Output 2\n\n5\n\nFive edges can be added, for example, as follows:\n\nAdd an edge connecting Vertex 5 and Vertex 3.\n\nAdd an edge connecting Vertex 5 and Vertex 2.\n\nAdd an edge connecting Vertex 4 and Vertex 1.\n\nAdd an edge connecting Vertex 4 and Vertex 2.\n\nAdd an edge connecting Vertex 4 and Vertex 3.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 236, "cpu_time_ms": 738, "memory_kb": 104576}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s285940108", "group_id": "codeNet:p03583", "input_text": "\n\n\nmy $N = ;\nmy $h,$n,$w;\n\n\n\nforeach $h(1..3500){\nforeach $n(1..3500){\n\tmy $tmp;\n\t$tmp=4*$h*$n-$N*$h-$N*$n;\n\tnext if ($tmp==0);\n\tnext if($tmp<0);\n\n\t$w=($N*$h*$n)/$tmp;\n#\tif($w>0)\n\t{\t\n\t\tnext if($w != int ($w));\n\n\t\tprint \"$h $n $w\\n\";\n\t\texit;\n\t}\n}\n}\n\n\n\n", "language": "Perl", "metadata": {"date": 1509389537, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03583.html", "problem_id": "p03583", "resource_group": "low_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/Perl/s285940108.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s285940108", "user_id": "u073506018"}, "prompt_components": {"gold_output": "1 2 2\n", "input_to_evaluate": "\n\n\nmy $N = ;\nmy $h,$n,$w;\n\n\n\nforeach $h(1..3500){\nforeach $n(1..3500){\n\tmy $tmp;\n\t$tmp=4*$h*$n-$N*$h-$N*$n;\n\tnext if ($tmp==0);\n\tnext if($tmp<0);\n\n\t$w=($N*$h*$n)/$tmp;\n#\tif($w>0)\n\t{\t\n\t\tnext if($w != int ($w));\n\n\t\tprint \"$h $n $w\\n\";\n\t\texit;\n\t}\n}\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1971, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s508619015", "group_id": "codeNet:p03583", "input_text": "\n\n\nmy $N = ;\nmy $h,$n,$w;\n\n\n\nforeach $h(1..3500){\nforeach $n(1..3500){\n\tmy $tmp;\n\t$tmp=4*$h*$n-$N*$h-$N*$n;\n\tnext if ($tmp==0);\n\n\t$w=($N*$h*$n)/$tmp;\n\tif($w>0)\n\t{\t\n\t\tnext if($w != int ($w));\n\n\t\tprint \"$h $n $w\\n\";\n\t\texit;\n\t}\n}\n}\n\n\n\n", "language": "Perl", "metadata": {"date": 1509389276, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03583.html", "problem_id": "p03583", "resource_group": "low_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/Perl/s508619015.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s508619015", "user_id": "u073506018"}, "prompt_components": {"gold_output": "1 2 2\n", "input_to_evaluate": "\n\n\nmy $N = ;\nmy $h,$n,$w;\n\n\n\nforeach $h(1..3500){\nforeach $n(1..3500){\n\tmy $tmp;\n\t$tmp=4*$h*$n-$N*$h-$N*$n;\n\tnext if ($tmp==0);\n\n\t$w=($N*$h*$n)/$tmp;\n\tif($w>0)\n\t{\t\n\t\tnext if($w != int ($w));\n\n\t\tprint \"$h $n $w\\n\";\n\t\texit;\n\t}\n}\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 239, "cpu_time_ms": 2103, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s265208651", "group_id": "codeNet:p03584", "input_text": "@@=(<>=~$\"*$',map$'&($.*=2)&&$'|$.-1^$.,1..29);$i=//,map$x+=$-=(${--$i}+=$`&~$_?0:$')-$x,@@for<>;print$x", "language": "Perl", "metadata": {"date": 1579345227, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03584.html", "problem_id": "p03584", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03584/input.txt", "sample_output_relpath": "derived/input_output/data/p03584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03584/Perl/s265208651.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s265208651", "user_id": "u657913472"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "@@=(<>=~$\"*$',map$'&($.*=2)&&$'|$.-1^$.,1..29);$i=//,map$x+=$-=(${--$i}+=$`&~$_?0:$')-$x,@@for<>;print$x", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSeisu-ya, a store specializing in non-negative integers, sells N non-negative integers. The i-th integer is A_i and has a utility of B_i.\nThere may be multiple equal integers with different utilities.\n\nTakahashi will buy some integers in this store. He can buy a combination of integers whose bitwise OR is less than or equal to K. He wants the sum of utilities of purchased integers to be as large as possible.\n\nFind the maximum possible sum of utilities of purchased integers.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K < 2^{30}\n\n0 \\leq A_i < 2^{30}(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible sum of utilities of purchased integers.\n\nSample Input 1\n\n3 5\n3 3\n4 4\n2 5\n\nSample Output 1\n\n8\n\nBuy 2 and 3 to achieve the maximum possible total utility, 8.\n\nSample Input 2\n\n3 6\n3 3\n4 4\n2 5\n\nSample Output 2\n\n9\n\nBuy 2 and 4 to achieve the maximum possible total utility, 9.\n\nSample Input 3\n\n7 14\n10 5\n7 4\n11 4\n9 8\n3 6\n6 2\n8 9\n\nSample Output 3\n\n32", "sample_input": "3 5\n3 3\n4 4\n2 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03584", "source_text": "Score : 500 points\n\nProblem Statement\n\nSeisu-ya, a store specializing in non-negative integers, sells N non-negative integers. The i-th integer is A_i and has a utility of B_i.\nThere may be multiple equal integers with different utilities.\n\nTakahashi will buy some integers in this store. He can buy a combination of integers whose bitwise OR is less than or equal to K. He wants the sum of utilities of purchased integers to be as large as possible.\n\nFind the maximum possible sum of utilities of purchased integers.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K < 2^{30}\n\n0 \\leq A_i < 2^{30}(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible sum of utilities of purchased integers.\n\nSample Input 1\n\n3 5\n3 3\n4 4\n2 5\n\nSample Output 1\n\n8\n\nBuy 2 and 3 to achieve the maximum possible total utility, 8.\n\nSample Input 2\n\n3 6\n3 3\n4 4\n2 5\n\nSample Output 2\n\n9\n\nBuy 2 and 4 to achieve the maximum possible total utility, 9.\n\nSample Input 3\n\n7 14\n10 5\n7 4\n11 4\n9 8\n3 6\n6 2\n8 9\n\nSample Output 3\n\n32", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 104, "cpu_time_ms": 2111, "memory_kb": 17280}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s830875992", "group_id": "codeNet:p03587", "input_text": "get.comb.sum.say", "language": "Perl", "metadata": {"date": 1506896562, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03587.html", "problem_id": "p03587", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03587/input.txt", "sample_output_relpath": "derived/input_output/data/p03587/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03587/Perl/s830875992.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s830875992", "user_id": "u032223772"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "get.comb.sum.say", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke prepared 6 problems for a upcoming programming contest.\nFor each of those problems, Rng judged whether it can be used in the contest or not.\n\nYou are given a string S of length 6.\nIf the i-th character of s is 1, it means that the i-th problem prepared by Snuke is accepted to be used; 0 means that the problem is not accepted.\n\nHow many problems prepared by Snuke are accepted to be used in the contest?\n\nConstraints\n\nThe length of S is 6.\n\nS consists of 0 and 1.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutputs\n\nPrint the number of problems prepared by Snuke that are accepted to be used in the contest.\n\nSample Input 1\n\n111100\n\nSample Output 1\n\n4\n\nThe first, second, third and fourth problems are accepted, for a total of four.\n\nSample Input 2\n\n001001\n\nSample Output 2\n\n2\n\nSample Input 3\n\n000000\n\nSample Output 3\n\n0", "sample_input": "111100\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03587", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke prepared 6 problems for a upcoming programming contest.\nFor each of those problems, Rng judged whether it can be used in the contest or not.\n\nYou are given a string S of length 6.\nIf the i-th character of s is 1, it means that the i-th problem prepared by Snuke is accepted to be used; 0 means that the problem is not accepted.\n\nHow many problems prepared by Snuke are accepted to be used in the contest?\n\nConstraints\n\nThe length of S is 6.\n\nS consists of 0 and 1.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutputs\n\nPrint the number of problems prepared by Snuke that are accepted to be used in the contest.\n\nSample Input 1\n\n111100\n\nSample Output 1\n\n4\n\nThe first, second, third and fourth problems are accepted, for a total of four.\n\nSample Input 2\n\n001001\n\nSample Output 2\n\n2\n\nSample Input 3\n\n000000\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 16, "cpu_time_ms": 927, "memory_kb": 60276}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s614215099", "group_id": "codeNet:p03591", "input_text": "chomp ($aa = ); \n$aa =~ /^YAKI/ ? print 'YES' : print \"NO\"; ", "language": "Perl", "metadata": {"date": 1514334202, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03591.html", "problem_id": "p03591", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03591/input.txt", "sample_output_relpath": "derived/input_output/data/p03591/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03591/Perl/s614215099.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s614215099", "user_id": "u429679664"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "chomp ($aa = ); \n$aa =~ /^YAKI/ ? print 'YES' : print \"NO\"; ", "problem_context": "Score : 100 points\n\nProblem Statement\n\nRingo is giving a present to Snuke.\n\nRingo has found out that Snuke loves yakiniku (a Japanese term meaning grilled meat. yaki: grilled, niku: meat). He supposes that Snuke likes grilled things starting with YAKI in Japanese, and does not like other things.\n\nYou are given a string S representing the Japanese name of Ringo's present to Snuke. Determine whether S starts with YAKI.\n\nConstraints\n\n1 \\leq |S| \\leq 10\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 starts with YAKI, print Yes; otherwise, print No.\n\nSample Input 1\n\nYAKINIKU\n\nSample Output 1\n\nYes\n\nYAKINIKU starts with YAKI.\n\nSample Input 2\n\nTAKOYAKI\n\nSample Output 2\n\nNo\n\nTAKOYAKI (a Japanese snack. tako: octopus) does not start with YAKI.\n\nSample Input 3\n\nYAK\n\nSample Output 3\n\nNo", "sample_input": "YAKINIKU\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03591", "source_text": "Score : 100 points\n\nProblem Statement\n\nRingo is giving a present to Snuke.\n\nRingo has found out that Snuke loves yakiniku (a Japanese term meaning grilled meat. yaki: grilled, niku: meat). He supposes that Snuke likes grilled things starting with YAKI in Japanese, and does not like other things.\n\nYou are given a string S representing the Japanese name of Ringo's present to Snuke. Determine whether S starts with YAKI.\n\nConstraints\n\n1 \\leq |S| \\leq 10\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 starts with YAKI, print Yes; otherwise, print No.\n\nSample Input 1\n\nYAKINIKU\n\nSample Output 1\n\nYes\n\nYAKINIKU starts with YAKI.\n\nSample Input 2\n\nTAKOYAKI\n\nSample Output 2\n\nNo\n\nTAKOYAKI (a Japanese snack. tako: octopus) does not start with YAKI.\n\nSample Input 3\n\nYAK\n\nSample Output 3\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s251945814", "group_id": "codeNet:p03592", "input_text": "my ($n, $m, $k) = split / /, ;\n\nfor(my $p = 0; $p < $m; $p++){\n for(my $q = 0; $q < $n; $q++){\n if($p * $n + $q * $m - 2 * $p * $q == $k){\n print \"Yes\";\n exit;\n }\n }\n}\nprint \"No\";\nexit;", "language": "Perl", "metadata": {"date": 1506223256, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03592.html", "problem_id": "p03592", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03592/input.txt", "sample_output_relpath": "derived/input_output/data/p03592/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03592/Perl/s251945814.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s251945814", "user_id": "u170302265"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my ($n, $m, $k) = split / /, ;\n\nfor(my $p = 0; $p < $m; $p++){\n for(my $q = 0; $q < $n; $q++){\n if($p * $n + $q * $m - 2 * $p * $q == $k){\n print \"Yes\";\n exit;\n }\n }\n}\nprint \"No\";\nexit;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a grid with N rows and M columns of squares. Initially, all the squares are white.\n\nThere is a button attached to each row and each column.\nWhen a button attached to a row is pressed, the colors of all the squares in that row are inverted; that is, white squares become black and vice versa.\nWhen a button attached to a column is pressed, the colors of all the squares in that column are inverted.\n\nTakahashi can freely press the buttons any number of times. Determine whether he can have exactly K black squares in the grid.\n\nConstraints\n\n1 \\leq N,M \\leq 1000\n\n0 \\leq K \\leq NM\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M K\n\nOutput\n\nIf Takahashi can have exactly K black squares in the grid, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 2 2\n\nSample Output 1\n\nYes\n\nPress the buttons in the order of the first row, the first column.\n\nSample Input 2\n\n2 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 5 8\n\nSample Output 3\n\nYes\n\nPress the buttons in the order of the first column, third column, second row, fifth column.\n\nSample Input 4\n\n7 9 20\n\nSample Output 4\n\nNo", "sample_input": "2 2 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03592", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a grid with N rows and M columns of squares. Initially, all the squares are white.\n\nThere is a button attached to each row and each column.\nWhen a button attached to a row is pressed, the colors of all the squares in that row are inverted; that is, white squares become black and vice versa.\nWhen a button attached to a column is pressed, the colors of all the squares in that column are inverted.\n\nTakahashi can freely press the buttons any number of times. Determine whether he can have exactly K black squares in the grid.\n\nConstraints\n\n1 \\leq N,M \\leq 1000\n\n0 \\leq K \\leq NM\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M K\n\nOutput\n\nIf Takahashi can have exactly K black squares in the grid, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 2 2\n\nSample Output 1\n\nYes\n\nPress the buttons in the order of the first row, the first column.\n\nSample Input 2\n\n2 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 5 8\n\nSample Output 3\n\nYes\n\nPress the buttons in the order of the first column, third column, second row, fifth column.\n\nSample Input 4\n\n7 9 20\n\nSample Output 4\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 283, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s447051639", "group_id": "codeNet:p03594", "input_text": "($H,$W,$d)=glob<>;\nif($d%2){\n\tfor(1..$W/2){\n\t\tprint'RG'x($W/2),'R'x($W%2),$/;\n\t\tprint'GR'x($W/2),'G'x($W%2),$/;\n\t}\n\tfor(1..$W%2){\n\t\tprint'RG'x($W/2),'R'x($W%2),$/;\n\t}\n}else{\n\t$x=$d;\n\tfor(0..$H-1){\n\t\tif($f==0){\n\t\t\tprint substr+('Y'x(($d-$x)/2).'R'x$x.'B'x($d-$x).'G'x$x.'Y'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x-=2;\n\t\t\tif($x==0){++$f}\n\t\t}elsif($f==1){\n\t\t\tprint substr+('Y'x(($d-$x)/2).'G'x$x.'B'x($d-$x).'R'x$x.'Y'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x+=2;\n\t\t\tif($x==$d){++$f}\n\t\t}elsif($f==2){\n\t\t\tprint substr+('B'x(($d-$x)/2).'G'x$x.'Y'x($d-$x).'R'x$x.'B'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x-=2;\n\t\t\tif($x==0){++$f}\n\t\t}elsif($f==3){\n\t\t\tprint substr+('B'x(($d-$x)/2).'R'x$x.'Y'x($d-$x).'G'x$x.'B'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x+=2;\n\t\t\tif($x==$d){$f=0}\n\t\t}\n\t}\n}\n", "language": "Perl", "metadata": {"date": 1506220745, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03594.html", "problem_id": "p03594", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03594/input.txt", "sample_output_relpath": "derived/input_output/data/p03594/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03594/Perl/s447051639.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s447051639", "user_id": "u283869437"}, "prompt_components": {"gold_output": "RY\nGR\n", "input_to_evaluate": "($H,$W,$d)=glob<>;\nif($d%2){\n\tfor(1..$W/2){\n\t\tprint'RG'x($W/2),'R'x($W%2),$/;\n\t\tprint'GR'x($W/2),'G'x($W%2),$/;\n\t}\n\tfor(1..$W%2){\n\t\tprint'RG'x($W/2),'R'x($W%2),$/;\n\t}\n}else{\n\t$x=$d;\n\tfor(0..$H-1){\n\t\tif($f==0){\n\t\t\tprint substr+('Y'x(($d-$x)/2).'R'x$x.'B'x($d-$x).'G'x$x.'Y'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x-=2;\n\t\t\tif($x==0){++$f}\n\t\t}elsif($f==1){\n\t\t\tprint substr+('Y'x(($d-$x)/2).'G'x$x.'B'x($d-$x).'R'x$x.'Y'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x+=2;\n\t\t\tif($x==$d){++$f}\n\t\t}elsif($f==2){\n\t\t\tprint substr+('B'x(($d-$x)/2).'G'x$x.'Y'x($d-$x).'R'x$x.'B'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x-=2;\n\t\t\tif($x==0){++$f}\n\t\t}elsif($f==3){\n\t\t\tprint substr+('B'x(($d-$x)/2).'R'x$x.'Y'x($d-$x).'G'x$x.'B'x(($d-$x)/2))x($W/$d+1),0,$W;\n\t\t\tprint$/;\n\t\t\t$x+=2;\n\t\t\tif($x==$d){$f=0}\n\t\t}\n\t}\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nWe will represent the square at the i-th row from the top and j-th column from the left as (i,\\ j).\nAlso, we will define the distance between the squares (i_1,\\ j_1) and (i_2,\\ j_2) as |i_1 - i_2| + |j_1 - j_2|.\n\nSnuke is painting each square in red, yellow, green or blue.\nHere, for a given positive integer d, he wants to satisfy the following condition:\n\nNo two squares with distance exactly d have the same color.\n\nFind a way to paint the squares satisfying the condition.\nIt can be shown that a solution always exists.\n\nConstraints\n\n2 ≤ H, W ≤ 500\n\n1 ≤ d ≤ H + W - 2\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W d\n\nOutput\n\nPrint a way to paint the squares satisfying the condition, in the following format. If the square (i,\\ j) is painted in red, yellow, green or blue, c_{ij} should be R, Y, G or B, respectively.\n\nc_{11}c_{12}...c_{1W}\n:\nc_{H1}c_{H2}...c_{HW}\n\nSample Input 1\n\n2 2 1\n\nSample Output 1\n\nRY\nGR\n\nThere are four pairs of squares with distance exactly 1.\nAs shown below, no two such squares have the same color.\n\n(1,\\ 1), (1,\\ 2) : R, Y\n\n(1,\\ 2), (2,\\ 2) : Y, R\n\n(2,\\ 2), (2,\\ 1) : R, G\n\n(2,\\ 1), (1,\\ 1) : G, R\n\nSample Input 2\n\n2 3 2\n\nSample Output 2\n\nRYB\nRGB\n\nThere are six pairs of squares with distance exactly 2.\nAs shown below, no two such squares have the same color.\n\n(1,\\ 1) , (1,\\ 3) : R , B\n\n(1,\\ 3) , (2,\\ 2) : B , G\n\n(2,\\ 2) , (1,\\ 1) : G , R\n\n(2,\\ 1) , (2,\\ 3) : R , B\n\n(2,\\ 3) , (1,\\ 2) : B , Y\n\n(1,\\ 2) , (2,\\ 1) : Y , R", "sample_input": "2 2 1\n"}, "reference_outputs": ["RY\nGR\n"], "source_document_id": "p03594", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nWe will represent the square at the i-th row from the top and j-th column from the left as (i,\\ j).\nAlso, we will define the distance between the squares (i_1,\\ j_1) and (i_2,\\ j_2) as |i_1 - i_2| + |j_1 - j_2|.\n\nSnuke is painting each square in red, yellow, green or blue.\nHere, for a given positive integer d, he wants to satisfy the following condition:\n\nNo two squares with distance exactly d have the same color.\n\nFind a way to paint the squares satisfying the condition.\nIt can be shown that a solution always exists.\n\nConstraints\n\n2 ≤ H, W ≤ 500\n\n1 ≤ d ≤ H + W - 2\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W d\n\nOutput\n\nPrint a way to paint the squares satisfying the condition, in the following format. If the square (i,\\ j) is painted in red, yellow, green or blue, c_{ij} should be R, Y, G or B, respectively.\n\nc_{11}c_{12}...c_{1W}\n:\nc_{H1}c_{H2}...c_{HW}\n\nSample Input 1\n\n2 2 1\n\nSample Output 1\n\nRY\nGR\n\nThere are four pairs of squares with distance exactly 1.\nAs shown below, no two such squares have the same color.\n\n(1,\\ 1), (1,\\ 2) : R, Y\n\n(1,\\ 2), (2,\\ 2) : Y, R\n\n(2,\\ 2), (2,\\ 1) : R, G\n\n(2,\\ 1), (1,\\ 1) : G, R\n\nSample Input 2\n\n2 3 2\n\nSample Output 2\n\nRYB\nRGB\n\nThere are six pairs of squares with distance exactly 2.\nAs shown below, no two such squares have the same color.\n\n(1,\\ 1) , (1,\\ 3) : R , B\n\n(1,\\ 3) , (2,\\ 2) : B , G\n\n(2,\\ 2) , (1,\\ 1) : G , R\n\n(2,\\ 1) , (2,\\ 3) : R , B\n\n(2,\\ 3) , (1,\\ 2) : B , Y\n\n(1,\\ 2) , (2,\\ 1) : Y , R", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 804, "cpu_time_ms": 6, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s939777433", "group_id": "codeNet:p03597", "input_text": "print<>**2-<>", "language": "Perl", "metadata": {"date": 1563821421, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03597.html", "problem_id": "p03597", "resource_group": "low_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/Perl/s939777433.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s939777433", "user_id": "u573154728"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "print<>**2-<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 13, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s970551897", "group_id": "codeNet:p03597", "input_text": "($a,$b,$c,$d,$e,$f)=split(' ', <>);\n\nfor ($suma = 0; $suma <= 30; $suma += $a) {\n for ($sumb = $suma; $sumb <= 30; $sumb += $b) {\n $water{$sumb}++;\n }\n}\n\n$e30 = $e*30;\n\nfor ($sumc = 0; $sumc <= $e30; $sumc += $c) {\n for ($sumd = $sumc; $sumd <= $e30; $sumd += $d) {\n $suger{$sumd}++;\n }\n}\n\n$max = -1;\n@water = sort{$a<=>$b}(keys %water);\n@suger = sort{$a<=>$b}(keys %suger);\nfor $w (@water) {\n if ($w == 0) {\n next;\n }\n\n for $s (@suger) {\n if ($s > $w * $e ) {\n last;\n }\n ($s + $w*100 > $f)and last;\n if ($max < $s*100/$w) {\n $resw = $w;\n $ress = $s;\n $max = $s*100/$w;\n }\n }\n}\nprintf(\"%d %d\\n\", $ress+$resw*100, $ress);", "language": "Perl", "metadata": {"date": 1505614406, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03597.html", "problem_id": "p03597", "resource_group": "low_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/Perl/s970551897.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s970551897", "user_id": "u789036644"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "($a,$b,$c,$d,$e,$f)=split(' ', <>);\n\nfor ($suma = 0; $suma <= 30; $suma += $a) {\n for ($sumb = $suma; $sumb <= 30; $sumb += $b) {\n $water{$sumb}++;\n }\n}\n\n$e30 = $e*30;\n\nfor ($sumc = 0; $sumc <= $e30; $sumc += $c) {\n for ($sumd = $sumc; $sumd <= $e30; $sumd += $d) {\n $suger{$sumd}++;\n }\n}\n\n$max = -1;\n@water = sort{$a<=>$b}(keys %water);\n@suger = sort{$a<=>$b}(keys %suger);\nfor $w (@water) {\n if ($w == 0) {\n next;\n }\n\n for $s (@suger) {\n if ($s > $w * $e ) {\n last;\n }\n ($s + $w*100 > $f)and last;\n if ($max < $s*100/$w) {\n $resw = $w;\n $ress = $s;\n $max = $s*100/$w;\n }\n }\n}\nprintf(\"%d %d\\n\", $ress+$resw*100, $ress);", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 744, "cpu_time_ms": 2103, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s698942729", "group_id": "codeNet:p03598", "input_text": "get;$/=get;say 2*[+] map {abs($/-$_)min+$_},get.words", "language": "Perl", "metadata": {"date": 1534831356, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03598.html", "problem_id": "p03598", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03598/input.txt", "sample_output_relpath": "derived/input_output/data/p03598/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03598/Perl/s698942729.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s698942729", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "get;$/=get;say 2*[+] map {abs($/-$_)min+$_},get.words", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N balls in the xy-plane. The coordinates of the i-th of them is (x_i, i).\nThus, we have one ball on each of the N lines y = 1, y = 2, ..., y = N.\n\nIn order to collect these balls, Snuke prepared 2N robots, N of type A and N of type B.\nThen, he placed the i-th type-A robot at coordinates (0, i), and the i-th type-B robot at coordinates (K, i).\nThus, now we have one type-A robot and one type-B robot on each of the N lines y = 1, y = 2, ..., y = N.\n\nWhen activated, each type of robot will operate as follows.\n\nWhen a type-A robot is activated at coordinates (0, a), it will move to the position of the ball on the line y = a, collect the ball, move back to its original position (0, a) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nWhen a type-B robot is activated at coordinates (K, b), it will move to the position of the ball on the line y = b, collect the ball, move back to its original position (K, b) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nSnuke will activate some of the 2N robots to collect all of the balls. Find the minimum possible total distance covered by robots.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n0 < x_i < K\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nK\nx_1 x_2 ... x_N\n\nOutputs\n\nPrint the minimum possible total distance covered by robots.\n\nSample Input 1\n\n1\n10\n2\n\nSample Output 1\n\n4\n\nThere are just one ball, one type-A robot and one type-B robot.\n\nIf the type-A robot is used to collect the ball, the distance from the robot to the ball is 2, and the distance from the ball to the original position of the robot is also 2, for a total distance of 4.\n\nSimilarly, if the type-B robot is used, the total distance covered will be 16.\n\nThus, the total distance covered will be minimized when the type-A robot is used. The output should be 4.\n\nSample Input 2\n\n2\n9\n3 6\n\nSample Output 2\n\n12\n\nThe total distance covered will be minimized when the first ball is collected by the type-A robot, and the second ball by the type-B robot.\n\nSample Input 3\n\n5\n20\n11 12 9 17 12\n\nSample Output 3\n\n74", "sample_input": "1\n10\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03598", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N balls in the xy-plane. The coordinates of the i-th of them is (x_i, i).\nThus, we have one ball on each of the N lines y = 1, y = 2, ..., y = N.\n\nIn order to collect these balls, Snuke prepared 2N robots, N of type A and N of type B.\nThen, he placed the i-th type-A robot at coordinates (0, i), and the i-th type-B robot at coordinates (K, i).\nThus, now we have one type-A robot and one type-B robot on each of the N lines y = 1, y = 2, ..., y = N.\n\nWhen activated, each type of robot will operate as follows.\n\nWhen a type-A robot is activated at coordinates (0, a), it will move to the position of the ball on the line y = a, collect the ball, move back to its original position (0, a) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nWhen a type-B robot is activated at coordinates (K, b), it will move to the position of the ball on the line y = b, collect the ball, move back to its original position (K, b) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nSnuke will activate some of the 2N robots to collect all of the balls. Find the minimum possible total distance covered by robots.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n0 < x_i < K\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nK\nx_1 x_2 ... x_N\n\nOutputs\n\nPrint the minimum possible total distance covered by robots.\n\nSample Input 1\n\n1\n10\n2\n\nSample Output 1\n\n4\n\nThere are just one ball, one type-A robot and one type-B robot.\n\nIf the type-A robot is used to collect the ball, the distance from the robot to the ball is 2, and the distance from the ball to the original position of the robot is also 2, for a total distance of 4.\n\nSimilarly, if the type-B robot is used, the total distance covered will be 16.\n\nThus, the total distance covered will be minimized when the type-A robot is used. The output should be 4.\n\nSample Input 2\n\n2\n9\n3 6\n\nSample Output 2\n\n12\n\nThe total distance covered will be minimized when the first ball is collected by the type-A robot, and the second ball by the type-B robot.\n\nSample Input 3\n\n5\n20\n11 12 9 17 12\n\nSample Output 3\n\n74", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 178, "memory_kb": 58104}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s106422859", "group_id": "codeNet:p03600", "input_text": "use strict;\n\nmy $n = <>;\nmy $n1 = $n-1;\nmy @a;\nfor (0..$n1) {\n my @x=split(' ', <>);\n $a[$_] = \\@x;\n}\nmy $sum;\nfor my $i (0..$n1) {\n for my $j (($i+1)..$n1) {\n my $direct = $a[$i]->[$j];\n my $found = 1;\n for my $k (@a) {\n my $cpd = $k->[$i] + $k->[$j];\n if ($cpd == $direct) {\n ($k->[$i] > 0 and $k->[$j] > 0) and $found = 0;\n next;\n }\n if ($direct > $cpd) {\n print \"-1\\n\";\n exit;\n }\n }\n ($found) and $sum += $direct;\n }\n}\nprint \"$sum\\n\";", "language": "Perl", "metadata": {"date": 1505643659, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03600.html", "problem_id": "p03600", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03600/input.txt", "sample_output_relpath": "derived/input_output/data/p03600/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03600/Perl/s106422859.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s106422859", "user_id": "u789036644"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use strict;\n\nmy $n = <>;\nmy $n1 = $n-1;\nmy @a;\nfor (0..$n1) {\n my @x=split(' ', <>);\n $a[$_] = \\@x;\n}\nmy $sum;\nfor my $i (0..$n1) {\n for my $j (($i+1)..$n1) {\n my $direct = $a[$i]->[$j];\n my $found = 1;\n for my $k (@a) {\n my $cpd = $k->[$i] + $k->[$j];\n if ($cpd == $direct) {\n ($k->[$i] > 0 and $k->[$j] > 0) and $found = 0;\n next;\n }\n if ($direct > $cpd) {\n print \"-1\\n\";\n exit;\n }\n }\n ($found) and $sum += $direct;\n }\n}\nprint \"$sum\\n\";", "problem_context": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "sample_input": "3\n0 1 3\n1 0 2\n3 2 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03600", "source_text": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 600, "cpu_time_ms": 2104, "memory_kb": 11776}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s528274453", "group_id": "codeNet:p03601", "input_text": "my ($a,$b,$c,$d,$e,$f)=+<=$^x*100+$^y&&$^x*$e>=$^y&&g($^x+$a,$^y)*g($^x+$b,$^y)*g($^x,$^y+$c)*g($^x,$^y+$d)*0+$^y/$^x}\ng $a,0;g $b,0;\n.sort(-*.value)[0].key~~m:g/\\d+/;put ($0*100+$1,$1)", "language": "Perl", "metadata": {"date": 1538099678, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03601.html", "problem_id": "p03601", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03601/input.txt", "sample_output_relpath": "derived/input_output/data/p03601/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03601/Perl/s528274453.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s528274453", "user_id": "u657913472"}, "prompt_components": {"gold_output": "110 10\n", "input_to_evaluate": "my ($a,$b,$c,$d,$e,$f)=+<=$^x*100+$^y&&$^x*$e>=$^y&&g($^x+$a,$^y)*g($^x+$b,$^y)*g($^x,$^y+$c)*g($^x,$^y+$d)*0+$^y/$^x}\ng $a,0;g $b,0;\n.sort(-*.value)[0].key~~m:g/\\d+/;put ($0*100+$1,$1)", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke is making sugar water in a beaker.\nInitially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations.\n\nOperation 1: Pour 100A grams of water into the beaker.\n\nOperation 2: Pour 100B grams of water into the beaker.\n\nOperation 3: Put C grams of sugar into the beaker.\n\nOperation 4: Put D grams of sugar into the beaker.\n\nIn our experimental environment, E grams of sugar can dissolve into 100 grams of water.\n\nSnuke will make sugar water with the highest possible density.\n\nThe beaker can contain at most F grams of substances (water and sugar combined), and there must not be any undissolved sugar in the beaker.\nFind the mass of the sugar water Snuke will make, and the mass of sugar dissolved in it.\nIf there is more than one candidate, any of them will be accepted.\n\nWe remind you that the sugar water that contains a grams of water and b grams of sugar is \\frac{100b}{a + b} percent.\nAlso, in this problem, pure water that does not contain any sugar is regarded as 0 percent density sugar water.\n\nConstraints\n\n1 \\leq A < B \\leq 30\n\n1 \\leq C < D \\leq 30\n\n1 \\leq E \\leq 100\n\n100A \\leq F \\leq 3 000\n\nA, B, C, D, E and F are all integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nA B C D E F\n\nOutputs\n\nPrint two integers separated by a space.\nThe first integer should be the mass of the desired sugar water, and the second should be the mass of the sugar dissolved in it.\n\nSample Input 1\n\n1 2 10 20 15 200\n\nSample Output 1\n\n110 10\n\nIn this environment, 15 grams of sugar can dissolve into 100 grams of water, and the beaker can contain at most 200 grams of substances.\n\nWe can make 110 grams of sugar water by performing Operation 1 once and Operation 3 once.\nIt is not possible to make sugar water with higher density.\nFor example, the following sequences of operations are infeasible:\n\nIf we perform Operation 1 once and Operation 4 once, there will be undissolved sugar in the beaker.\n\nIf we perform Operation 2 once and Operation 3 three times, the mass of substances in the beaker will exceed 200 grams.\n\nSample Input 2\n\n1 2 1 2 100 1000\n\nSample Output 2\n\n200 100\n\nThere are other acceptable outputs, such as:\n\n400 200\n\nHowever, the output below is not acceptable:\n\n300 150\n\nThis is because, in order to make 300 grams of sugar water containing 150 grams of sugar, we need to pour exactly 150 grams of water into the beaker, which is impossible.\n\nSample Input 3\n\n17 19 22 26 55 2802\n\nSample Output 3\n\n2634 934", "sample_input": "1 2 10 20 15 200\n"}, "reference_outputs": ["110 10\n"], "source_document_id": "p03601", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke is making sugar water in a beaker.\nInitially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations.\n\nOperation 1: Pour 100A grams of water into the beaker.\n\nOperation 2: Pour 100B grams of water into the beaker.\n\nOperation 3: Put C grams of sugar into the beaker.\n\nOperation 4: Put D grams of sugar into the beaker.\n\nIn our experimental environment, E grams of sugar can dissolve into 100 grams of water.\n\nSnuke will make sugar water with the highest possible density.\n\nThe beaker can contain at most F grams of substances (water and sugar combined), and there must not be any undissolved sugar in the beaker.\nFind the mass of the sugar water Snuke will make, and the mass of sugar dissolved in it.\nIf there is more than one candidate, any of them will be accepted.\n\nWe remind you that the sugar water that contains a grams of water and b grams of sugar is \\frac{100b}{a + b} percent.\nAlso, in this problem, pure water that does not contain any sugar is regarded as 0 percent density sugar water.\n\nConstraints\n\n1 \\leq A < B \\leq 30\n\n1 \\leq C < D \\leq 30\n\n1 \\leq E \\leq 100\n\n100A \\leq F \\leq 3 000\n\nA, B, C, D, E and F are all integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nA B C D E F\n\nOutputs\n\nPrint two integers separated by a space.\nThe first integer should be the mass of the desired sugar water, and the second should be the mass of the sugar dissolved in it.\n\nSample Input 1\n\n1 2 10 20 15 200\n\nSample Output 1\n\n110 10\n\nIn this environment, 15 grams of sugar can dissolve into 100 grams of water, and the beaker can contain at most 200 grams of substances.\n\nWe can make 110 grams of sugar water by performing Operation 1 once and Operation 3 once.\nIt is not possible to make sugar water with higher density.\nFor example, the following sequences of operations are infeasible:\n\nIf we perform Operation 1 once and Operation 4 once, there will be undissolved sugar in the beaker.\n\nIf we perform Operation 2 once and Operation 3 three times, the mass of substances in the beaker will exceed 200 grams.\n\nSample Input 2\n\n1 2 1 2 100 1000\n\nSample Output 2\n\n200 100\n\nThere are other acceptable outputs, such as:\n\n400 200\n\nHowever, the output below is not acceptable:\n\n300 150\n\nThis is because, in order to make 300 grams of sugar water containing 150 grams of sugar, we need to pour exactly 150 grams of water into the beaker, which is impossible.\n\nSample Input 3\n\n17 19 22 26 55 2802\n\nSample Output 3\n\n2634 934", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2973, "memory_kb": 110576}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s078132802", "group_id": "codeNet:p03602", "input_text": "$N=<>;\nfor$i(0..$N-1){\n\t@{$A[$i]}=split$\",<>;\n\t$A[$i][$i]=inf\n}\nfor$k(0..$N-1){\n\tfor$I(@A){\n\t\tif(@$I[$k]!=inf){\n\t\t\tfor$j(0..$N-1){\n\t\t\t\tif(@$I[$j]!=inf){\n\t\t\t\t\tif(@$I[$j]==@$I[$k]+$A[$k][$j]){\n\t\t\t\t\t\t@$I[$j]=inf\n\t\t\t\t\t}elsif(@$I[$j]>@$I[$k]+$A[$k][$j]){\n\t\t\t\t\t\texit!print-1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nfor(@A){\n\tfor(@$_){\n\t\t$z+=$_==inf?0:$_\n\t}\n}\nprint$z/2\n", "language": "Perl", "metadata": {"date": 1505667481, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03602.html", "problem_id": "p03602", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03602/input.txt", "sample_output_relpath": "derived/input_output/data/p03602/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03602/Perl/s078132802.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s078132802", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$N=<>;\nfor$i(0..$N-1){\n\t@{$A[$i]}=split$\",<>;\n\t$A[$i][$i]=inf\n}\nfor$k(0..$N-1){\n\tfor$I(@A){\n\t\tif(@$I[$k]!=inf){\n\t\t\tfor$j(0..$N-1){\n\t\t\t\tif(@$I[$j]!=inf){\n\t\t\t\t\tif(@$I[$j]==@$I[$k]+$A[$k][$j]){\n\t\t\t\t\t\t@$I[$j]=inf\n\t\t\t\t\t}elsif(@$I[$j]>@$I[$k]+$A[$k][$j]){\n\t\t\t\t\t\texit!print-1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nfor(@A){\n\tfor(@$_){\n\t\t$z+=$_==inf?0:$_\n\t}\n}\nprint$z/2\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "sample_input": "3\n0 1 3\n1 0 2\n3 2 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03602", "source_text": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 350, "cpu_time_ms": 2105, "memory_kb": 12416}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s381793617", "group_id": "codeNet:p03602", "input_text": "for$i(@@=1..<>){\n\t$j=1;\n\t$_[$i][$j++]=$_ for glob<>\n}\nfor$k(@@){\n\tfor$i(@@){\n\t\tnext if$i==$k;\n\t\tfor$j(@@){\n\t\t\tnext if$j==$k||$j==$i||$_[$i][$j]==1e15;\n\t\t\tif($_[$i][$j]>$_[$i][$k]+$_[$k][$j]){\n\t\t\t\tprint-1;\n\t\t\t\texit\n\t\t\t}\n\t\t\tif($_[$i][$j]==$_[$i][$k]+$_[$k][$j]){\n\t\t\t\t$_[$i][$j]=1e15\n\t\t\t}\n\t\t}\n\t}\n}\nfor$i(@@){\n\tfor$j(@@){\n\t\t$\\+=$_[$i][$j]!=1e15&&$_[$i][$j]/2\n\t}\n}\nprint\n", "language": "Perl", "metadata": {"date": 1505661873, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03602.html", "problem_id": "p03602", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03602/input.txt", "sample_output_relpath": "derived/input_output/data/p03602/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03602/Perl/s381793617.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s381793617", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "for$i(@@=1..<>){\n\t$j=1;\n\t$_[$i][$j++]=$_ for glob<>\n}\nfor$k(@@){\n\tfor$i(@@){\n\t\tnext if$i==$k;\n\t\tfor$j(@@){\n\t\t\tnext if$j==$k||$j==$i||$_[$i][$j]==1e15;\n\t\t\tif($_[$i][$j]>$_[$i][$k]+$_[$k][$j]){\n\t\t\t\tprint-1;\n\t\t\t\texit\n\t\t\t}\n\t\t\tif($_[$i][$j]==$_[$i][$k]+$_[$k][$j]){\n\t\t\t\t$_[$i][$j]=1e15\n\t\t\t}\n\t\t}\n\t}\n}\nfor$i(@@){\n\tfor$j(@@){\n\t\t$\\+=$_[$i][$j]!=1e15&&$_[$i][$j]/2\n\t}\n}\nprint\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "sample_input": "3\n0 1 3\n1 0 2\n3 2 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03602", "source_text": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2105, "memory_kb": 14592}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s956020985", "group_id": "codeNet:p03607", "input_text": "chomp (my $n = );\nmy %h;\nfor my $i (1..$n) {\n chomp (my $s = );\n $h{$s}++;\n}\nprint scalar(grep {$_ % 2 == 1} values %h);", "language": "Perl", "metadata": {"date": 1588644281, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03607.html", "problem_id": "p03607", "resource_group": "low_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/Perl/s956020985.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s956020985", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "chomp (my $n = );\nmy %h;\nfor my $i (1..$n) {\n chomp (my $s = );\n $h{$s}++;\n}\nprint scalar(grep {$_ % 2 == 1} values %h);", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 76, "memory_kb": 14208}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s268530986", "group_id": "codeNet:p03607", "input_text": "<>;$h{$_}^=1for<>;$r+=$_ for values(%h);print$r", "language": "Perl", "metadata": {"date": 1505027070, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03607.html", "problem_id": "p03607", "resource_group": "low_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/Perl/s268530986.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s268530986", "user_id": "u280667879"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>;$h{$_}^=1for<>;$r+=$_ for values(%h);print$r", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 72, "memory_kb": 22144}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s285743639", "group_id": "codeNet:p03609", "input_text": "$input = <>;\n($x, $t) = split(/ /, $input);\nprint $x - $t > 0 ? $x - $t : 0;", "language": "Perl", "metadata": {"date": 1504827500, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03609.html", "problem_id": "p03609", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03609/input.txt", "sample_output_relpath": "derived/input_output/data/p03609/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03609/Perl/s285743639.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s285743639", "user_id": "u931757436"}, "prompt_components": {"gold_output": "83\n", "input_to_evaluate": "$input = <>;\n($x, $t) = split(/ /, $input);\nprint $x - $t > 0 ? $x - $t : 0;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.\n\nHow many grams of sand will the upper bulb contains after t seconds?\n\nConstraints\n\n1≤X≤10^9\n\n1≤t≤10^9\n\nX and t are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX t\n\nOutput\n\nPrint the number of sand in the upper bulb after t second.\n\nSample Input 1\n\n100 17\n\nSample Output 1\n\n83\n\n17 out of the initial 100 grams of sand will be consumed, resulting in 83 grams.\n\nSample Input 2\n\n48 58\n\nSample Output 2\n\n0\n\nAll 48 grams of sand will be gone, resulting in 0 grams.\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n0", "sample_input": "100 17\n"}, "reference_outputs": ["83\n"], "source_document_id": "p03609", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.\n\nHow many grams of sand will the upper bulb contains after t seconds?\n\nConstraints\n\n1≤X≤10^9\n\n1≤t≤10^9\n\nX and t are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX t\n\nOutput\n\nPrint the number of sand in the upper bulb after t second.\n\nSample Input 1\n\n100 17\n\nSample Output 1\n\n83\n\n17 out of the initial 100 grams of sand will be consumed, resulting in 83 grams.\n\nSample Input 2\n\n48 58\n\nSample Output 2\n\n0\n\nAll 48 grams of sand will be gone, resulting in 0 grams.\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n0", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s924208982", "group_id": "codeNet:p03610", "input_text": "my $s = glob<>;\nprint join '', $s =~ /(.).?/g;\n", "language": "Perl", "metadata": {"date": 1565313577, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03610.html", "problem_id": "p03610", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03610/input.txt", "sample_output_relpath": "derived/input_output/data/p03610/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03610/Perl/s924208982.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s924208982", "user_id": "u822702091"}, "prompt_components": {"gold_output": "acdr\n", "input_to_evaluate": "my $s = glob<>;\nprint join '', $s =~ /(.).?/g;\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1.\n\nConstraints\n\nEach character in s is a lowercase English letter.\n\n1≤|s|≤10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string obtained by concatenating all the characters in the odd-numbered positions.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\nacdr\n\nExtract the first character a, the third character c, the fifth character d and the seventh character r to obtain acdr.\n\nSample Input 2\n\naaaa\n\nSample Output 2\n\naa\n\nSample Input 3\n\nz\n\nSample Output 3\n\nz\n\nSample Input 4\n\nfukuokayamaguchi\n\nSample Output 4\n\nfkoaaauh", "sample_input": "atcoder\n"}, "reference_outputs": ["acdr\n"], "source_document_id": "p03610", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1.\n\nConstraints\n\nEach character in s is a lowercase English letter.\n\n1≤|s|≤10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string obtained by concatenating all the characters in the odd-numbered positions.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\nacdr\n\nExtract the first character a, the third character c, the fifth character d and the seventh character r to obtain acdr.\n\nSample Input 2\n\naaaa\n\nSample Output 2\n\naa\n\nSample Input 3\n\nz\n\nSample Output 3\n\nz\n\nSample Input 4\n\nfukuokayamaguchi\n\nSample Output 4\n\nfkoaaauh", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 6, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s877062652", "group_id": "codeNet:p03611", "input_text": "use List::Util qw/max/;\nmy $n = <>;\nmy @a = split(' ',<>);\nmy %x;\nfor (@a) {\n for ($_-1,$_,$_+1) {\n $a{$_}//=0;\n $a{$_}++;\n }\n}\n\nprint max(values %a);", "language": "Perl", "metadata": {"date": 1504833732, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03611.html", "problem_id": "p03611", "resource_group": "low_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/Perl/s877062652.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s877062652", "user_id": "u081594539"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use List::Util qw/max/;\nmy $n = <>;\nmy @a = split(' ',<>);\nmy %x;\nfor (@a) {\n for ($_-1,$_,$_+1) {\n $a{$_}//=0;\n $a{$_}++;\n }\n}\n\nprint max(values %a);", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 158, "cpu_time_ms": 177, "memory_kb": 25708}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s964184351", "group_id": "codeNet:p03611", "input_text": "use strict;\n\nmy $n = <>;\nmy @input = split(/\\s+/, <>);\n\nmy %cnt;\nforeach my $key (@input){\n if ($cnt{$key}) {\n $cnt{$key}=$cnt{$key}+1;\n } else {\n $cnt{$key}=1;\n }\n}\n\nmy $answer = 0;\nforeach my $key (sort(keys(%cnt))){\n my $tmp = $cnt{$key} + $cnt{$key-1} + $cnt{$key+1};\n if ($answer < $tmp) {\n $answer = $tmp;\n }\n}\nprint $answer;", "language": "Perl", "metadata": {"date": 1504829967, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03611.html", "problem_id": "p03611", "resource_group": "low_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/Perl/s964184351.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s964184351", "user_id": "u931757436"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use strict;\n\nmy $n = <>;\nmy @input = split(/\\s+/, <>);\n\nmy %cnt;\nforeach my $key (@input){\n if ($cnt{$key}) {\n $cnt{$key}=$cnt{$key}+1;\n } else {\n $cnt{$key}=1;\n }\n}\n\nmy $answer = 0;\nforeach my $key (sort(keys(%cnt))){\n my $tmp = $cnt{$key} + $cnt{$key-1} + $cnt{$key+1};\n if ($answer < $tmp) {\n $answer = $tmp;\n }\n}\nprint $answer;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 370, "cpu_time_ms": 161, "memory_kb": 22780}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s397258044", "group_id": "codeNet:p03613", "input_text": "get;bag(^3 X++<^4-3;say ($_=get)+>1*$3+$_%2*$2/2", "language": "Perl", "metadata": {"date": 1579670423, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03617.html", "problem_id": "p03617", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03617/input.txt", "sample_output_relpath": "derived/input_output/data/p03617/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03617/Perl/s483999809.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s483999809", "user_id": "u657913472"}, "prompt_components": {"gold_output": "150\n", "input_to_evaluate": "$/=[\\min] get.words Z+>^4-3;say ($_=get)+>1*$3+$_%2*$2/2", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "sample_input": "20 30 70 90\n3\n"}, "reference_outputs": ["150\n"], "source_document_id": "p03617", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 56, "cpu_time_ms": 148, "memory_kb": 51944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s566214873", "group_id": "codeNet:p03617", "input_text": "$/=$*IN.words;say $4+>1*min(@$/Z+>^4)*8+$4%2*min @$/Z*4,2,1", "language": "Perl", "metadata": {"date": 1573090449, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03617.html", "problem_id": "p03617", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03617/input.txt", "sample_output_relpath": "derived/input_output/data/p03617/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03617/Perl/s566214873.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s566214873", "user_id": "u657913472"}, "prompt_components": {"gold_output": "150\n", "input_to_evaluate": "$/=$*IN.words;say $4+>1*min(@$/Z+>^4)*8+$4%2*min @$/Z*4,2,1", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "sample_input": "20 30 70 90\n3\n"}, "reference_outputs": ["150\n"], "source_document_id": "p03617", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 59, "cpu_time_ms": 143, "memory_kb": 51072}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s935042514", "group_id": "codeNet:p03617", "input_text": "($Q,$H,$S,$D)=glob<>;\n$N=<>;\n$S=4*$Q if(4*$Q<$S);\n$S=2*$H if(2*$H<$S);\n$D=2*$S if(2*$S<$D);\nprint+$N%2?$S+$D*($N>>1):$N/2*$D", "language": "Perl", "metadata": {"date": 1559594869, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03617.html", "problem_id": "p03617", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03617/input.txt", "sample_output_relpath": "derived/input_output/data/p03617/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03617/Perl/s935042514.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s935042514", "user_id": "u573154728"}, "prompt_components": {"gold_output": "150\n", "input_to_evaluate": "($Q,$H,$S,$D)=glob<>;\n$N=<>;\n$S=4*$Q if(4*$Q<$S);\n$S=2*$H if(2*$H<$S);\n$D=2*$S if(2*$S<$D);\nprint+$N%2?$S+$D*($N>>1):$N/2*$D", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "sample_input": "20 30 70 90\n3\n"}, "reference_outputs": ["150\n"], "source_document_id": "p03617", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s554709630", "group_id": "codeNet:p03623", "input_text": "get~~m:g/\\d+/;[abs($0-$1)>abs($0-$2)].say", "language": "Perl", "metadata": {"date": 1528422698, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03623.html", "problem_id": "p03623", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03623/input.txt", "sample_output_relpath": "derived/input_output/data/p03623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03623/Perl/s554709630.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s554709630", "user_id": "u657913472"}, "prompt_components": {"gold_output": "B\n", "input_to_evaluate": "get~~m:g/\\d+/;[abs($0-$1)>abs($0-$2)].say", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "sample_input": "5 2 7\n"}, "reference_outputs": ["B\n"], "source_document_id": "p03623", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 158, "memory_kb": 53616}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s043078890", "group_id": "codeNet:p03623", "input_text": "use strict;\nuse warnings;\nuse utf8;\n \nuse feature qw/say/;\n \nmy $n = <>;\nmy @a = split(/\\s+/, <>);\n \nmy %cnt; $cnt{$_} = ($cnt{$_} // 0) + 1 for (@a);\nmy ($first, $second) = sort { $b <=> $a } grep { $cnt{$_} >= 2 } (keys %cnt);\n \nsay !defined $first ? 0\n : $cnt{$first} >= 4 ? $first * $first\n : $first * ($second // 0);", "language": "Perl", "metadata": {"date": 1506465734, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03623.html", "problem_id": "p03623", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03623/input.txt", "sample_output_relpath": "derived/input_output/data/p03623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03623/Perl/s043078890.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s043078890", "user_id": "u136553578"}, "prompt_components": {"gold_output": "B\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\n \nuse feature qw/say/;\n \nmy $n = <>;\nmy @a = split(/\\s+/, <>);\n \nmy %cnt; $cnt{$_} = ($cnt{$_} // 0) + 1 for (@a);\nmy ($first, $second) = sort { $b <=> $a } grep { $cnt{$_} >= 2 } (keys %cnt);\n \nsay !defined $first ? 0\n : $cnt{$first} >= 4 ? $first * $first\n : $first * ($second // 0);", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "sample_input": "5 2 7\n"}, "reference_outputs": ["B\n"], "source_document_id": "p03623", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s223413222", "group_id": "codeNet:p03625", "input_text": "#!/usr/bin/perl\n\n\n$line = 0;\nwhile (<>) {\n chomp;\n if($line == 0) {\n $n = $_;\n } else {\n @a = split /\\s+/, $_\n }\n $line++;\n}\n\nforeach (@a) {\n $e{$_}++;\n}\n\nforeach (sort {$b <=> $a} keys %e) {\n if($e{$_} >= 2) {\n push @h, $_;\n if($#h >= 1) {\n print $h[0] * $h[1], \"\\n\";\n exit;\n }\n if($e{$_} >= 4) {\n print $_ * $_, \"\\n\";\n exit;\n }\n }\n}\n\nprint \"0\\n\";\n", "language": "Perl", "metadata": {"date": 1503279200, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03625.html", "problem_id": "p03625", "resource_group": "low_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/Perl/s223413222.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s223413222", "user_id": "u669573977"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\n\n$line = 0;\nwhile (<>) {\n chomp;\n if($line == 0) {\n $n = $_;\n } else {\n @a = split /\\s+/, $_\n }\n $line++;\n}\n\nforeach (@a) {\n $e{$_}++;\n}\n\nforeach (sort {$b <=> $a} keys %e) {\n if($e{$_} >= 2) {\n push @h, $_;\n if($#h >= 1) {\n print $h[0] * $h[1], \"\\n\";\n exit;\n }\n if($e{$_} >= 4) {\n print $_ * $_, \"\\n\";\n exit;\n }\n }\n}\n\nprint \"0\\n\";\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 144, "memory_kb": 31692}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s860253496", "group_id": "codeNet:p03627", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(max);\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nmy %h;\n$h{$_}++ for @a;\nmy @s = sort {$b <=> $a} grep {$h{$_} >= 4} keys %h;\nmy @t = sort {$b <=> $a} grep {$h{$_} >= 2} keys %h;\nmy $ans = 0;\n$ans = $s[0] * $s[0] if @s > 0;\n$ans = max($ans, $t[0] * $t[1]) if @t > 1;\nsay $ans;", "language": "Perl", "metadata": {"date": 1587057133, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03627.html", "problem_id": "p03627", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03627/input.txt", "sample_output_relpath": "derived/input_output/data/p03627/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03627/Perl/s860253496.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s860253496", "user_id": "u979552932"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(max);\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nmy %h;\n$h{$_}++ for @a;\nmy @s = sort {$b <=> $a} grep {$h{$_} >= 4} keys %h;\nmy @t = sort {$b <=> $a} grep {$h{$_} >= 2} keys %h;\nmy $ans = 0;\n$ans = $s[0] * $s[0] if @s > 0;\n$ans = max($ans, $t[0] * $t[1]) if @t > 1;\nsay $ans;", "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": "p03627", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 135, "memory_kb": 28196}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s318083186", "group_id": "codeNet:p03628", "input_text": "s/(.)\\1*/length$&/ge,$\\=/./*$&*3,/..(??{$\\=$\\*(2,1,3,2)[$&%4]%(1e9+7)})/ for<>;print", "language": "Perl", "metadata": {"date": 1539754752, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03628.html", "problem_id": "p03628", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03628/input.txt", "sample_output_relpath": "derived/input_output/data/p03628/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03628/Perl/s318083186.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s318083186", "user_id": "u657913472"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "s/(.)\\1*/length$&/ge,$\\=/./*$&*3,/..(??{$\\=$\\*(2,1,3,2)[$&%4]%(1e9+7)})/ for<>;print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a board with a 2 \\times N grid.\nSnuke covered the board with N dominoes without overlaps.\nHere, a domino can cover a 1 \\times 2 or 2 \\times 1 square.\n\nThen, Snuke decided to paint these dominoes using three colors: red, cyan and green.\nTwo dominoes that are adjacent by side should be painted by different colors.\nHere, it is not always necessary to use all three colors.\n\nFind the number of such ways to paint the dominoes, modulo 1000000007.\n\nThe arrangement of the dominoes is given to you as two strings S_1 and S_2 in the following manner:\n\nEach domino is represented by a different English letter (lowercase or uppercase).\n\nThe j-th character in S_i represents the domino that occupies the square at the i-th row from the top and j-th column from the left.\n\nConstraints\n\n1 \\leq N \\leq 52\n\n|S_1| = |S_2| = N\n\nS_1 and S_2 consist of lowercase and uppercase English letters.\n\nS_1 and S_2 represent a valid arrangement of dominoes.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\nS_2\n\nOutput\n\nPrint the number of such ways to paint the dominoes, modulo 1000000007.\n\nSample Input 1\n\n3\naab\nccb\n\nSample Output 1\n\n6\n\nThere are six ways as shown below:\n\nSample Input 2\n\n1\nZ\nZ\n\nSample Output 2\n\n3\n\nNote that it is not always necessary to use all the colors.\n\nSample Input 3\n\n52\nRvvttdWIyyPPQFFZZssffEEkkaSSDKqcibbeYrhAljCCGGJppHHn\nRLLwwdWIxxNNQUUXXVVMMooBBaggDKqcimmeYrhAljOOTTJuuzzn\n\nSample Output 3\n\n958681902", "sample_input": "3\naab\nccb\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03628", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a board with a 2 \\times N grid.\nSnuke covered the board with N dominoes without overlaps.\nHere, a domino can cover a 1 \\times 2 or 2 \\times 1 square.\n\nThen, Snuke decided to paint these dominoes using three colors: red, cyan and green.\nTwo dominoes that are adjacent by side should be painted by different colors.\nHere, it is not always necessary to use all three colors.\n\nFind the number of such ways to paint the dominoes, modulo 1000000007.\n\nThe arrangement of the dominoes is given to you as two strings S_1 and S_2 in the following manner:\n\nEach domino is represented by a different English letter (lowercase or uppercase).\n\nThe j-th character in S_i represents the domino that occupies the square at the i-th row from the top and j-th column from the left.\n\nConstraints\n\n1 \\leq N \\leq 52\n\n|S_1| = |S_2| = N\n\nS_1 and S_2 consist of lowercase and uppercase English letters.\n\nS_1 and S_2 represent a valid arrangement of dominoes.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\nS_2\n\nOutput\n\nPrint the number of such ways to paint the dominoes, modulo 1000000007.\n\nSample Input 1\n\n3\naab\nccb\n\nSample Output 1\n\n6\n\nThere are six ways as shown below:\n\nSample Input 2\n\n1\nZ\nZ\n\nSample Output 2\n\n3\n\nNote that it is not always necessary to use all the colors.\n\nSample Input 3\n\n52\nRvvttdWIyyPPQFFZZssffEEkkaSSDKqcibbeYrhAljCCGGJppHHn\nRLLwwdWIxxNNQUUXXVVMMooBBaggDKqcimmeYrhAljOOTTJuuzzn\n\nSample Output 3\n\n958681902", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s236197513", "group_id": "codeNet:p03629", "input_text": "$in1=in();\n@ary=split //,$in1;\nfor($i=0;$i<26;$i++){\n${$to[@ary]}[$i]=@ary;\n}for($i=@ary-1;$i>=0;$i--){\nfor($j=0;$j<26;$j++){\n${$to[$i]}[$j]=${$to[$i+1]}[$j];\n}${$to[$i]}[ord($ary[$i])-ord('a')]=$i;\n}\nfor($j=0;$j<26;$j++){\nif(!defined $pop[${$to[0]}[$j]] or $pop[${$to[0]}[$j]]>1){\n$pop[${$to[0]}[$j]]=1;\n$ans[${$to[0]}[$j]]=chr(ord('a')+$j);\n}}\n\nfor($i=0;$i<@ary;$i++){\nfor($j=0;$j<26;$j++){\nif(!defined $pop[${$to[$i+1]}[$j]] or $pop[${$to[$i+1]}[$j]]>$pop[$i]+1){\n$pop[${$to[$i+1]}[$j]]=$pop[$i]+1;\n$ans[${$to[$i+1]}[$j]]=$ans[$i].chr(ord('a')+$j);\n}}\n}\n\nprint \"$ans[@ary]\";\nsub in {\n$t=;\n$t=~s/[¥r¥n]+//;\nreturn $t;\n}\n", "language": "Perl", "metadata": {"date": 1577215885, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03629.html", "problem_id": "p03629", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03629/input.txt", "sample_output_relpath": "derived/input_output/data/p03629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03629/Perl/s236197513.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s236197513", "user_id": "u004311543"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "$in1=in();\n@ary=split //,$in1;\nfor($i=0;$i<26;$i++){\n${$to[@ary]}[$i]=@ary;\n}for($i=@ary-1;$i>=0;$i--){\nfor($j=0;$j<26;$j++){\n${$to[$i]}[$j]=${$to[$i+1]}[$j];\n}${$to[$i]}[ord($ary[$i])-ord('a')]=$i;\n}\nfor($j=0;$j<26;$j++){\nif(!defined $pop[${$to[0]}[$j]] or $pop[${$to[0]}[$j]]>1){\n$pop[${$to[0]}[$j]]=1;\n$ans[${$to[0]}[$j]]=chr(ord('a')+$j);\n}}\n\nfor($i=0;$i<@ary;$i++){\nfor($j=0;$j<26;$j++){\nif(!defined $pop[${$to[$i+1]}[$j]] or $pop[${$to[$i+1]}[$j]]>$pop[$i]+1){\n$pop[${$to[$i+1]}[$j]]=$pop[$i]+1;\n$ans[${$to[$i+1]}[$j]]=$ans[$i].chr(ord('a')+$j);\n}}\n}\n\nprint \"$ans[@ary]\";\nsub in {\n$t=;\n$t=~s/[¥r¥n]+//;\nreturn $t;\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nA subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters.\nFor example, arc, artistic and (an empty string) are all subsequences of artistic; abc and ci are not.\n\nYou are given a string A consisting of lowercase English letters.\nFind the shortest string among the strings consisting of lowercase English letters that are not subsequences of A.\nIf there are more than one such string, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq |A| \\leq 2 \\times 10^5\n\nA consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\n\nOutput\n\nPrint the lexicographically smallest string among the shortest strings consisting of lowercase English letters that are not subsequences of A.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a as a subsequence, but not b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\naa\n\nSample Input 3\n\nfrqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn\n\nSample Output 3\n\naca", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03629", "source_text": "Score : 600 points\n\nProblem Statement\n\nA subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters.\nFor example, arc, artistic and (an empty string) are all subsequences of artistic; abc and ci are not.\n\nYou are given a string A consisting of lowercase English letters.\nFind the shortest string among the strings consisting of lowercase English letters that are not subsequences of A.\nIf there are more than one such string, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq |A| \\leq 2 \\times 10^5\n\nA consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\n\nOutput\n\nPrint the lexicographically smallest string among the shortest strings consisting of lowercase English letters that are not subsequences of A.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a as a subsequence, but not b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\naa\n\nSample Input 3\n\nfrqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn\n\nSample Output 3\n\naca", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 631, "cpu_time_ms": 431, "memory_kb": 71648}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s933070778", "group_id": "codeNet:p03632", "input_text": "@inputs = split(/ /, <>);\n$before1 = $inputs[0];\n$before2 = $inputs[2];\n$after1 = $inputs[1];\n$after2 = $inputs[3];\n\nif ($before1 < $before2) {\n if($after1 < $after2){\n $answer = $after1 - $before1; \n }else {\n $answer = $after2 - $before1;\n }\n}else {\n if($after1<$after2){\n $answer = $after1- $before1;\n }else {\n $answer = $after2 - $before1;\n }\n}\n\nif ($answer > 0){\n print ($answer);\n}else{\n print (0);\n}", "language": "Perl", "metadata": {"date": 1503016215, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03632.html", "problem_id": "p03632", "resource_group": "low_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/Perl/s933070778.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s933070778", "user_id": "u931757436"}, "prompt_components": {"gold_output": "50\n", "input_to_evaluate": "@inputs = split(/ /, <>);\n$before1 = $inputs[0];\n$before2 = $inputs[2];\n$after1 = $inputs[1];\n$after2 = $inputs[3];\n\nif ($before1 < $before2) {\n if($after1 < $after2){\n $answer = $after1 - $before1; \n }else {\n $answer = $after2 - $before1;\n }\n}else {\n if($after1<$after2){\n $answer = $after1- $before1;\n }else {\n $answer = $after2 - $before1;\n }\n}\n\nif ($answer > 0){\n print ($answer);\n}else{\n print (0);\n}", "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≤A);\n\nif ($inputs[2] >= $inputs[1] || $inputs[0] >= $inputs[3]) {\n print(\"0\");\n} elsif ($inputs[0] <= $inputs[2] && $inputs[1] <= $inputs[3]) {\n print($inputs[1] - $inputs[2]);\n} elsif ($inputs[2] <= $inputs[0] && $inputs[3] <= $inputs[1]) {\n print($inputs[3] - $inputs[0]);\n} elsif ($inputs[0] <= $inputs[2] && $inputs[1] >= $inputs[3]) {\n print (($inputs[1] - $inputs[2]) - ($inputs[2] - $inputs[0]));\n} elsif ($inputs[2] <= $inputs[0] && $inputs[3] >= $inputs[1]) {\n print (($inputs[3] - $inputs[0]) - ($inputs[0] - $inputs[2]));\n} else {\n print(\"0\");\n}", "language": "Perl", "metadata": {"date": 1503014583, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03632.html", "problem_id": "p03632", "resource_group": "low_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/Perl/s607518943.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s607518943", "user_id": "u931757436"}, "prompt_components": {"gold_output": "50\n", "input_to_evaluate": "@inputs = split(/ /, <>);\n\nif ($inputs[2] >= $inputs[1] || $inputs[0] >= $inputs[3]) {\n print(\"0\");\n} elsif ($inputs[0] <= $inputs[2] && $inputs[1] <= $inputs[3]) {\n print($inputs[1] - $inputs[2]);\n} elsif ($inputs[2] <= $inputs[0] && $inputs[3] <= $inputs[1]) {\n print($inputs[3] - $inputs[0]);\n} elsif ($inputs[0] <= $inputs[2] && $inputs[1] >= $inputs[3]) {\n print (($inputs[1] - $inputs[2]) - ($inputs[2] - $inputs[0]));\n} elsif ($inputs[2] <= $inputs[0] && $inputs[3] >= $inputs[1]) {\n print (($inputs[3] - $inputs[0]) - ($inputs[0] - $inputs[2]));\n} else {\n print(\"0\");\n}", "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≤A;my @T;\nfor (my $i=0;$i<$N;$i++){\n push(@T, <>); \n}\nprint Math::BigInt::blcm(@T);\n", "language": "Perl", "metadata": {"date": 1588381709, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03633.html", "problem_id": "p03633", "resource_group": "low_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/Perl/s317304473.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s317304473", "user_id": "u468291514"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "use strict;use warnings;use Math::BigInt;\nmy $N=<>;my @T;\nfor (my $i=0;$i<$N;$i++){\n push(@T, <>); \n}\nprint Math::BigInt::blcm(@T);\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 39, "memory_kb": 4608}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s523400452", "group_id": "codeNet:p03633", "input_text": "#!/usr/bin/perl\n\n$line = 0;\nwhile (<>) {\n chomp;\n if($line == 0) {\n $n = $_;\n } else {\n push @t, $_;\n }\n $line++;\n}\n\nforeach (@t) {\n soin($_);\n}\n\n$total = 1;\nforeach (keys %t) {\n $total *= $_ ** $t{$_};\n}\nprint \"$total\\n\";\n\nsub soin {\n my ($n) = @_;\n undef %s;\n $max = sprintf(\"%d\", sqrt($n));\n foreach $i (2 .. $max) {\n if($n % $i == 0) {\n $s{$i}++;\n $n /= $i;\n if($n == 1) {\n last;\n }\n redo;\n }\n }\n if ($n != 1) {\n $s{$n}++;\n }\n foreach (keys %s) {\n if(!defined $t{$_} || $t{$_} < $s{$_}) {\n $t{$_} = $s{$_};\n }\n }\n}\n", "language": "Perl", "metadata": {"date": 1502589504, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03633.html", "problem_id": "p03633", "resource_group": "low_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/Perl/s523400452.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s523400452", "user_id": "u669573977"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "#!/usr/bin/perl\n\n$line = 0;\nwhile (<>) {\n chomp;\n if($line == 0) {\n $n = $_;\n } else {\n push @t, $_;\n }\n $line++;\n}\n\nforeach (@t) {\n soin($_);\n}\n\n$total = 1;\nforeach (keys %t) {\n $total *= $_ ** $t{$_};\n}\nprint \"$total\\n\";\n\nsub soin {\n my ($n) = @_;\n undef %s;\n $max = sprintf(\"%d\", sqrt($n));\n foreach $i (2 .. $max) {\n if($n % $i == 0) {\n $s{$i}++;\n $n /= $i;\n if($n == 1) {\n last;\n }\n redo;\n }\n }\n if ($n != 1) {\n $s{$n}++;\n }\n foreach (keys %s) {\n if(!defined $t{$_} || $t{$_} < $s{$_}) {\n $t{$_} = $s{$_};\n }\n }\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 697, "cpu_time_ms": 2103, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s368232740", "group_id": "codeNet:p03634", "input_text": "$N=<>;\n($a,$b,$c)=glob(<>),$$a{$b}=$$b{$a}=$c for 1..$N-1;\n($Q,$K)=glob<>;\n@q=$K;\nwhile($q=shift@q){\n\t$d[$_]or$d[$_]=$d[$q]+$$q{$_},push@q,$_ for keys%$q;\n}\n($x,$y)=glob,print$d[$x]+$d[$y],$/for<>", "language": "Perl", "metadata": {"date": 1502587749, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03634.html", "problem_id": "p03634", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03634/input.txt", "sample_output_relpath": "derived/input_output/data/p03634/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03634/Perl/s368232740.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s368232740", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n2\n4\n", "input_to_evaluate": "$N=<>;\n($a,$b,$c)=glob(<>),$$a{$b}=$$b{$a}=$c for 1..$N-1;\n($Q,$K)=glob<>;\n@q=$K;\nwhile($q=shift@q){\n\t$d[$_]or$d[$_]=$d[$q]+$$q{$_},push@q,$_ for keys%$q;\n}\n($x,$y)=glob,print$d[$x]+$d[$y],$/for<>", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given a tree with N vertices.\n\nHere, a tree is a kind of graph, and more specifically, a connected undirected graph with N-1 edges, where N is the number of its vertices.\n\nThe i-th edge (1≤i≤N-1) connects Vertices a_i and b_i, and has a length of c_i.\n\nYou are also given Q queries and an integer K. In the j-th query (1≤j≤Q):\n\nfind the length of the shortest path from Vertex x_j and Vertex y_j via Vertex K.\n\nConstraints\n\n3≤N≤10^5\n\n1≤a_i,b_i≤N (1≤i≤N-1)\n\n1≤c_i≤10^9 (1≤i≤N-1)\n\nThe given graph is a tree.\n\n1≤Q≤10^5\n\n1≤K≤N\n\n1≤x_j,y_j≤N (1≤j≤Q)\n\nx_j≠y_j (1≤j≤Q)\n\nx_j≠K,y_j≠K (1≤j≤Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\n:\na_{N-1} b_{N-1} c_{N-1}\nQ K\nx_1 y_1\n:\nx_{Q} y_{Q}\n\nOutput\n\nPrint the responses to the queries in Q lines.\n\nIn the j-th line j(1≤j≤Q), print the response to the j-th query.\n\nSample Input 1\n\n5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5\n\nSample Output 1\n\n3\n2\n4\n\nThe shortest paths for the three queries are as follows:\n\nQuery 1: Vertex 2 → Vertex 1 → Vertex 2 → Vertex 4 : Length 1+1+1=3\n\nQuery 2: Vertex 2 → Vertex 1 → Vertex 3 : Length 1+1=2\n\nQuery 3: Vertex 4 → Vertex 2 → Vertex 1 → Vertex 3 → Vertex 5 : Length 1+1+1+1=4\n\nSample Input 2\n\n7\n1 2 1\n1 3 3\n1 4 5\n1 5 7\n1 6 9\n1 7 11\n3 2\n1 3\n4 5\n6 7\n\nSample Output 2\n\n5\n14\n22\n\nThe path for each query must pass Vertex K=2.\n\nSample Input 3\n\n10\n1 2 1000000000\n2 3 1000000000\n3 4 1000000000\n4 5 1000000000\n5 6 1000000000\n6 7 1000000000\n7 8 1000000000\n8 9 1000000000\n9 10 1000000000\n1 1\n9 10\n\nSample Output 3\n\n17000000000", "sample_input": "5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5\n"}, "reference_outputs": ["3\n2\n4\n"], "source_document_id": "p03634", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given a tree with N vertices.\n\nHere, a tree is a kind of graph, and more specifically, a connected undirected graph with N-1 edges, where N is the number of its vertices.\n\nThe i-th edge (1≤i≤N-1) connects Vertices a_i and b_i, and has a length of c_i.\n\nYou are also given Q queries and an integer K. In the j-th query (1≤j≤Q):\n\nfind the length of the shortest path from Vertex x_j and Vertex y_j via Vertex K.\n\nConstraints\n\n3≤N≤10^5\n\n1≤a_i,b_i≤N (1≤i≤N-1)\n\n1≤c_i≤10^9 (1≤i≤N-1)\n\nThe given graph is a tree.\n\n1≤Q≤10^5\n\n1≤K≤N\n\n1≤x_j,y_j≤N (1≤j≤Q)\n\nx_j≠y_j (1≤j≤Q)\n\nx_j≠K,y_j≠K (1≤j≤Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\n:\na_{N-1} b_{N-1} c_{N-1}\nQ K\nx_1 y_1\n:\nx_{Q} y_{Q}\n\nOutput\n\nPrint the responses to the queries in Q lines.\n\nIn the j-th line j(1≤j≤Q), print the response to the j-th query.\n\nSample Input 1\n\n5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5\n\nSample Output 1\n\n3\n2\n4\n\nThe shortest paths for the three queries are as follows:\n\nQuery 1: Vertex 2 → Vertex 1 → Vertex 2 → Vertex 4 : Length 1+1+1=3\n\nQuery 2: Vertex 2 → Vertex 1 → Vertex 3 : Length 1+1=2\n\nQuery 3: Vertex 4 → Vertex 2 → Vertex 1 → Vertex 3 → Vertex 5 : Length 1+1+1+1=4\n\nSample Input 2\n\n7\n1 2 1\n1 3 3\n1 4 5\n1 5 7\n1 6 9\n1 7 11\n3 2\n1 3\n4 5\n6 7\n\nSample Output 2\n\n5\n14\n22\n\nThe path for each query must pass Vertex K=2.\n\nSample Input 3\n\n10\n1 2 1000000000\n2 3 1000000000\n3 4 1000000000\n4 5 1000000000\n5 6 1000000000\n6 7 1000000000\n7 8 1000000000\n8 9 1000000000\n9 10 1000000000\n1 1\n9 10\n\nSample Output 3\n\n17000000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2062, "memory_kb": 121472}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s154014571", "group_id": "codeNet:p03636", "input_text": "my $str=;\nchomp $str;\nmy $n=length($str)-2;\nprint substr($str,0,1) . $n . substr($str,-1);", "language": "Perl", "metadata": {"date": 1502067733, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03636.html", "problem_id": "p03636", "resource_group": "low_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/Perl/s154014571.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s154014571", "user_id": "u170302265"}, "prompt_components": {"gold_output": "i18n\n", "input_to_evaluate": "my $str=;\nchomp $str;\nmy $n=length($str)-2;\nprint substr($str,0,1) . $n . substr($str,-1);", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s880761715", "group_id": "codeNet:p03643", "input_text": "print'ABC'.<>", "language": "Perl", "metadata": {"date": 1599682292, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p03643.html", "problem_id": "p03643", "resource_group": "low_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/Perl/s880761715.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s880761715", "user_id": "u636683284"}, "prompt_components": {"gold_output": "ABC100\n", "input_to_evaluate": "print'ABC'.<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 13, "cpu_time_ms": 4, "memory_kb": 4644}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s983970270", "group_id": "codeNet:p03643", "input_text": "print+ABC.<>", "language": "Perl", "metadata": {"date": 1550898069, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03643.html", "problem_id": "p03643", "resource_group": "low_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/Perl/s983970270.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s983970270", "user_id": "u832039789"}, "prompt_components": {"gold_output": "ABC100\n", "input_to_evaluate": "print+ABC.<>", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 12, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s561246192", "group_id": "codeNet:p03644", "input_text": "$n=<>;print 1<>$_,1..9", "language": "Perl", "metadata": {"date": 1534906036, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03644.html", "problem_id": "p03644", "resource_group": "low_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/Perl/s561246192.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s561246192", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$n=<>;print 1<>$_,1..9", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s915852249", "group_id": "codeNet:p03644", "input_text": "my $n = <>;\nmy $i = 1;\nwhile ($i * 2 <= $n) {\n $i *= 2;\n};\nprint $i;", "language": "Perl", "metadata": {"date": 1501803329, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03644.html", "problem_id": "p03644", "resource_group": "low_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/Perl/s915852249.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s915852249", "user_id": "u081594539"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "my $n = <>;\nmy $i = 1;\nwhile ($i * 2 <= $n) {\n $i *= 2;\n};\nprint $i;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s465843837", "group_id": "codeNet:p03645", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($n, $m) = split / /, );\nmy @a;\nfor my $i (1..$m) {\n chomp (my $in = );\n my @c = split ' ', $in;\n $a[$i][0] = $c[0];\n $a[$i][1] = $c[1];\n}\nmy (@s, @que);\npush @que, 1;\n$s[1] = 0;\nwhile (@que) {\n my ($i, $j);\n $i = shift @que;\n my $cnt = $s[$i];\n for my $j (1..$m) {\n next if $a[$j][0] != $i;\n if ($s[$a[$j][1]] <= 0) {\n $s[$a[$j][1]] = $cnt + 1;\n push @que, $a[$j][1];\n }\n }\n}\nif ($s[$n] == 2) {\n say \"POSSIBLE\";\n} else {\n say \"IMPOSSIBLE\";\n}", "language": "Perl", "metadata": {"date": 1587223892, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03645.html", "problem_id": "p03645", "resource_group": "low_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/Perl/s465843837.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s465843837", "user_id": "u979552932"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($n, $m) = split / /, );\nmy @a;\nfor my $i (1..$m) {\n chomp (my $in = );\n my @c = split ' ', $in;\n $a[$i][0] = $c[0];\n $a[$i][1] = $c[1];\n}\nmy (@s, @que);\npush @que, 1;\n$s[1] = 0;\nwhile (@que) {\n my ($i, $j);\n $i = shift @que;\n my $cnt = $s[$i];\n for my $j (1..$m) {\n next if $a[$j][0] != $i;\n if ($s[$a[$j][1]] <= 0) {\n $s[$a[$j][1]] = $cnt + 1;\n push @que, $a[$j][1];\n }\n }\n}\nif ($s[$n] == 2) {\n say \"POSSIBLE\";\n} else {\n say \"IMPOSSIBLE\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2108, "memory_kb": 77568}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s250567359", "group_id": "codeNet:p03645", "input_text": "($n,$m)=glob<>;\nfor(1..$m){\n ($a,$b)=glob<>;\n push(@L,$b) if($a==1);\n push(@L,$a) if($b==$n);\n}\nfor(@L){\n $f=1,last if($c{$_}++);\n}\nprint+$f?\"\":\"IM\",\"POSSIBLE\";", "language": "Perl", "metadata": {"date": 1559158324, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03645.html", "problem_id": "p03645", "resource_group": "low_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/Perl/s250567359.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s250567359", "user_id": "u573154728"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "($n,$m)=glob<>;\nfor(1..$m){\n ($a,$b)=glob<>;\n push(@L,$b) if($a==1);\n push(@L,$a) if($b==$n);\n}\nfor(@L){\n $f=1,last if($c{$_}++);\n}\nprint+$f?\"\":\"IM\",\"POSSIBLE\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1422, "memory_kb": 41216}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s511993359", "group_id": "codeNet:p03647", "input_text": "print!grep($a[$i=<>=~$\"-$`?$'==$#N&&$`:$']++*$i,@N=0..<>)&&IM,POSSIBLE", "language": "Perl", "metadata": {"date": 1542826942, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03647.html", "problem_id": "p03647", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03647/input.txt", "sample_output_relpath": "derived/input_output/data/p03647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03647/Perl/s511993359.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s511993359", "user_id": "u657913472"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "print!grep($a[$i=<>=~$\"-$`?$'==$#N&&$`:$']++*$i,@N=0..<>)&&IM,POSSIBLE", "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": "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 283, "memory_kb": 21120}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s511776764", "group_id": "codeNet:p03647", "input_text": "$N=<>;print!grep($a[$i=<>=~$\"-$`?$'==$N&&$`:$']++&&$i,1..2e5)&&IM,POSSIBLE", "language": "Perl", "metadata": {"date": 1501445516, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03647.html", "problem_id": "p03647", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03647/input.txt", "sample_output_relpath": "derived/input_output/data/p03647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03647/Perl/s511776764.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s511776764", "user_id": "u283869437"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "$N=<>;print!grep($a[$i=<>=~$\"-$`?$'==$N&&$`:$']++&&$i,1..2e5)&&IM,POSSIBLE", "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": "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 415, "memory_kb": 16384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s503748235", "group_id": "codeNet:p03648", "input_text": "use bigint;\n$%=<>;\nprint 2,$/,$%%2?($%+5>>1,$\",$%-1>>1):($%/2+1,$\",$%/2+1),$/\n", "language": "Perl", "metadata": {"date": 1501378277, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03648.html", "problem_id": "p03648", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03648/input.txt", "sample_output_relpath": "derived/input_output/data/p03648/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03648/Perl/s503748235.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s503748235", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n3 3 3 3\n", "input_to_evaluate": "use bigint;\n$%=<>;\nprint 2,$/,$%%2?($%+5>>1,$\",$%-1>>1):($%/2+1,$\",$%/2+1),$/\n", "problem_context": "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", "sample_input": "0\n"}, "reference_outputs": ["4\n3 3 3 3\n"], "source_document_id": "p03648", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 32, "memory_kb": 4992}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s688853670", "group_id": "codeNet:p03649", "input_text": "<>;$%+=$-while$-=(@A=sort{$b-$a}map$_+=$i--?$-:-@A*$-,@A,glob<>)[$i=0]/@A;print$%", "language": "Perl", "metadata": {"date": 1552634068, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03649.html", "problem_id": "p03649", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03649/input.txt", "sample_output_relpath": "derived/input_output/data/p03649/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03649/Perl/s688853670.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s688853670", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "<>;$%+=$-while$-=(@A=sort{$b-$a}map$_+=$i--?$-:-@A*$-,@A,glob<>)[$i=0]/@A;print$%", "problem_context": "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. (The operation is the same as the one in Problem D.)\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 the sequence a_i. Find the number of times we will perform the above operation.\n\nConstraints\n\n2 ≤ N ≤ 50\n\n0 ≤ a_i ≤ 10^{16} + 1000\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 number of times the operation will be performed.\n\nSample Input 1\n\n4\n3 3 3 3\n\nSample Output 1\n\n0\n\nSample Input 2\n\n3\n1 0 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2\n2 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n7\n27 0 0 0 0 0 0\n\nSample Output 4\n\n3\n\nSample Input 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425\n\nSample Output 5\n\n1234567894848", "sample_input": "4\n3 3 3 3\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03649", "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. (The operation is the same as the one in Problem D.)\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 the sequence a_i. Find the number of times we will perform the above operation.\n\nConstraints\n\n2 ≤ N ≤ 50\n\n0 ≤ a_i ≤ 10^{16} + 1000\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 number of times the operation will be performed.\n\nSample Input 1\n\n4\n3 3 3 3\n\nSample Output 1\n\n0\n\nSample Input 2\n\n3\n1 0 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2\n2 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n7\n27 0 0 0 0 0 0\n\nSample Output 4\n\n3\n\nSample Input 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425\n\nSample Output 5\n\n1234567894848", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 29, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s737432924", "group_id": "codeNet:p03651", "input_text": "get~~/\\s.+/;say 'IM'x?($/%[gcd](@($_=+<.max),'POSSIBLE'", "language": "Perl", "metadata": {"date": 1599629936, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03651.html", "problem_id": "p03651", "resource_group": "low_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/Perl/s737432924.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s737432924", "user_id": "u657913472"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "get~~/\\s.+/;say 'IM'x?($/%[gcd](@($_=+<.max),'POSSIBLE'", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 842, "memory_kb": 106740}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s121700968", "group_id": "codeNet:p03651", "input_text": "get~~/\\s.+/;say 'IM'x?($/%[gcd](@($_=+<.max),'POSSIBLE'", "language": "Perl", "metadata": {"date": 1599629914, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03651.html", "problem_id": "p03651", "resource_group": "low_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/Perl/s121700968.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s121700968", "user_id": "u657913472"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "get~~/\\s.+/;say 'IM'x?($/%[gcd](@($_=+<.max),'POSSIBLE'", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 68, "cpu_time_ms": 845, "memory_kb": 106528}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s289390542", "group_id": "codeNet:p03651", "input_text": "get~~/\\s.+/;say 'IM'x($/%[gcd](@($_=+<.max),'POSSIBLE'", "language": "Perl", "metadata": {"date": 1599629789, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03651.html", "problem_id": "p03651", "resource_group": "low_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/Perl/s289390542.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Output Limit Exceeded", "submission_id": "s289390542", "user_id": "u657913472"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "get~~/\\s.+/;say 'IM'x($/%[gcd](@($_=+<.max),'POSSIBLE'", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1600, "memory_kb": 461648}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s379137479", "group_id": "codeNet:p03657", "input_text": "get~~m:g/\\d+/;[$0*$1*($0+$1)%3==0].say", "language": "Perl", "metadata": {"date": 1528363484, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03657.html", "problem_id": "p03657", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03657/input.txt", "sample_output_relpath": "derived/input_output/data/p03657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03657/Perl/s379137479.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s379137479", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Possible\n", "input_to_evaluate": "get~~m:g/\\d+/;[$0*$1*($0+$1)%3==0].say", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is giving cookies to his three goats.\n\nHe has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).\n\nYour task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.\n\nConstraints\n\n1 \\leq A,B \\leq 100\n\nBoth A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nPossible\n\nIf Snuke gives nine cookies, each of the three goats can have three cookies.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nImpossible\n\nSince there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.", "sample_input": "4 5\n"}, "reference_outputs": ["Possible\n"], "source_document_id": "p03657", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is giving cookies to his three goats.\n\nHe has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).\n\nYour task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.\n\nConstraints\n\n1 \\leq A,B \\leq 100\n\nBoth A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nPossible\n\nIf Snuke gives nine cookies, each of the three goats can have three cookies.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nImpossible\n\nSince there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 59, "cpu_time_ms": 307, "memory_kb": 66036}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s459982750", "group_id": "codeNet:p03658", "input_text": "($a,$b) = split/ /,<>;\n@l=split/ /,<>;\n@l=sort {$b cmp $a} @l;\n$sum=0;\nfor($i=0;$i<$b;$i++){\n $sum += $l[$i];\n}\nprint $sum;", "language": "Perl", "metadata": {"date": 1568491586, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03658.html", "problem_id": "p03658", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03658/input.txt", "sample_output_relpath": "derived/input_output/data/p03658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03658/Perl/s459982750.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s459982750", "user_id": "u124498235"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "($a,$b) = split/ /,<>;\n@l=split/ /,<>;\n@l=sort {$b cmp $a} @l;\n$sum=0;\nfor($i=0;$i<$b;$i++){\n $sum += $l[$i];\n}\nprint $sum;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "sample_input": "5 3\n1 2 3 4 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03658", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s569570334", "group_id": "codeNet:p03658", "input_text": "get~~/\\s.*/;get.words.sort(-*)[^$/].sum.say", "language": "Perl", "metadata": {"date": 1542822889, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03658.html", "problem_id": "p03658", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03658/input.txt", "sample_output_relpath": "derived/input_output/data/p03658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03658/Perl/s569570334.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s569570334", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "get~~/\\s.*/;get.words.sort(-*)[^$/].sum.say", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "sample_input": "5 3\n1 2 3 4 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03658", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 284, "memory_kb": 66792}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s070471987", "group_id": "codeNet:p03658", "input_text": "my ($n,$k)=split / /,;\nmy @l=split / /,;\n@l=sort{$b<=>$a}@l;\nsplice @l,$k;\nmy $r=0;\nmap{$r+=$_;}@l;\nprint $r;", "language": "Perl", "metadata": {"date": 1501185680, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03658.html", "problem_id": "p03658", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03658/input.txt", "sample_output_relpath": "derived/input_output/data/p03658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03658/Perl/s070471987.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s070471987", "user_id": "u170302265"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "my ($n,$k)=split / /,;\nmy @l=split / /,;\n@l=sort{$b<=>$a}@l;\nsplice @l,$k;\nmy $r=0;\nmap{$r+=$_;}@l;\nprint $r;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "sample_input": "5 3\n1 2 3 4 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03658", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s387568600", "group_id": "codeNet:p03658", "input_text": "$\\+=$_ for(sort{$b-$a}glob<>)[<>!~$\"..$'-1];print", "language": "Perl", "metadata": {"date": 1500174436, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03658.html", "problem_id": "p03658", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03658/input.txt", "sample_output_relpath": "derived/input_output/data/p03658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03658/Perl/s387568600.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s387568600", "user_id": "u657913472"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "$\\+=$_ for(sort{$b-$a}glob<>)[<>!~$\"..$'-1];print", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "sample_input": "5 3\n1 2 3 4 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03658", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 49, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s733251569", "group_id": "codeNet:p03659", "input_text": "use List::Util qw/sum/;\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nmy $sum = sum(@a);\nmy $x = 0;\nmy $min = 1e15;\nfor my $i (0..$n-2) {\n $x += $a[$i];\n $min = abs($sum - 2 * $x) if $min > abs($sum - 2 * $x);\n}\nprint \"$min\\n\";", "language": "Perl", "metadata": {"date": 1587836208, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03659.html", "problem_id": "p03659", "resource_group": "low_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/Perl/s733251569.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s733251569", "user_id": "u979552932"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "use List::Util qw/sum/;\n\nchomp (my $n = );\nchomp (my @a = split / /, );\nmy $sum = sum(@a);\nmy $x = 0;\nmy $min = 1e15;\nfor my $i (0..$n-2) {\n $x += $a[$i];\n $min = abs($sum - 2 * $x) if $min > abs($sum - 2 * $x);\n}\nprint \"$min\\n\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 115, "memory_kb": 34924}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s280110414", "group_id": "codeNet:p03665", "input_text": "<>;exit<>=~/1 /", "language": "Perl", "metadata": {"date": 1568043569, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03665.html", "problem_id": "p03665", "resource_group": "low_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/Perl/s280110414.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s280110414", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>;exit<>=~/1 /", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 15, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s998413952", "group_id": "codeNet:p03665", "input_text": "print 2**($`+<>!~$\"-(<>=~/[13] /||$'*~0))", "language": "Perl", "metadata": {"date": 1568042445, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03665.html", "problem_id": "p03665", "resource_group": "low_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/Perl/s998413952.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s998413952", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print 2**($`+<>!~$\"-(<>=~/[13] /||$'*~0))", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 41, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s790515935", "group_id": "codeNet:p03666", "input_text": "print grep($2*$_-$'*$N<=$&-$1&$&-$1<=$'*$_-$2*$N--,<>!~/ .* (.*) (.*) /..($N=$`-1))?YES:NO", "language": "Perl", "metadata": {"date": 1520373127, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03666.html", "problem_id": "p03666", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03666/input.txt", "sample_output_relpath": "derived/input_output/data/p03666/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03666/Perl/s790515935.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s790515935", "user_id": "u283869437"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "print grep($2*$_-$'*$N<=$&-$1&$&-$1<=$'*$_-$2*$N--,<>!~/ .* (.*) (.*) /..($N=$`-1))?YES:NO", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares in a row.\nThe leftmost square contains the integer A, and the rightmost contains the integer B. The other squares are empty.\n\nAohashi would like to fill the empty squares with integers so that the following condition is satisfied:\n\nFor any two adjacent squares, the (absolute) difference of the two integers in those squares is between C and D (inclusive).\n\nAs long as the condition is satisfied, it is allowed to use arbitrarily large or small integers to fill the squares.\nDetermine whether it is possible to fill the squares under the condition.\n\nConstraints\n\n3 \\leq N \\leq 500000\n\n0 \\leq A \\leq 10^9\n\n0 \\leq B \\leq 10^9\n\n0 \\leq C \\leq D \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\n\nOutput\n\nPrint YES if it is possible to fill the squares under the condition; print NO otherwise.\n\nSample Input 1\n\n5 1 5 2 4\n\nSample Output 1\n\nYES\n\nFor example, fill the squares with the following integers: 1, -1, 3, 7, 5, from left to right.\n\nSample Input 2\n\n4 7 6 4 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n48792 105960835 681218449 90629745 90632170\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n491995 412925347 825318103 59999126 59999339\n\nSample Output 4\n\nYES", "sample_input": "5 1 5 2 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03666", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares in a row.\nThe leftmost square contains the integer A, and the rightmost contains the integer B. The other squares are empty.\n\nAohashi would like to fill the empty squares with integers so that the following condition is satisfied:\n\nFor any two adjacent squares, the (absolute) difference of the two integers in those squares is between C and D (inclusive).\n\nAs long as the condition is satisfied, it is allowed to use arbitrarily large or small integers to fill the squares.\nDetermine whether it is possible to fill the squares under the condition.\n\nConstraints\n\n3 \\leq N \\leq 500000\n\n0 \\leq A \\leq 10^9\n\n0 \\leq B \\leq 10^9\n\n0 \\leq C \\leq D \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\n\nOutput\n\nPrint YES if it is possible to fill the squares under the condition; print NO otherwise.\n\nSample Input 1\n\n5 1 5 2 4\n\nSample Output 1\n\nYES\n\nFor example, fill the squares with the following integers: 1, -1, 3, 7, 5, from left to right.\n\nSample Input 2\n\n4 7 6 4 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n48792 105960835 681218449 90629745 90632170\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n491995 412925347 825318103 59999126 59999339\n\nSample Output 4\n\nYES", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 779, "memory_kb": 20096}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s911935434", "group_id": "codeNet:p03667", "input_text": "<>;\n$z=@L=1..(@A=glob<>);\n($j=--$L[--$_])<0or$z-=!$B[$j]++for@A;\nmap{\n\t($X,$Y)=split;\n\t($j=$L[$A[--$X]]++)<0or$z+=!--$B[$j];\n\t($j=--$L[$A[$X]=--$Y])<0or$z-=!$B[$j]++;\n\tprint$z,$/\n}<>\n", "language": "Perl", "metadata": {"date": 1562710253, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03667.html", "problem_id": "p03667", "resource_group": "low_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/Perl/s911935434.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s911935434", "user_id": "u283869437"}, "prompt_components": {"gold_output": "0\n1\n1\n", "input_to_evaluate": "<>;\n$z=@L=1..(@A=glob<>);\n($j=--$L[--$_])<0or$z-=!$B[$j]++for@A;\nmap{\n\t($X,$Y)=split;\n\t($j=$L[$A[--$X]]++)<0or$z+=!--$B[$j];\n\t($j=--$L[$A[$X]=--$Y])<0or$z-=!$B[$j]++;\n\tprint$z,$/\n}<>\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 183, "cpu_time_ms": 1315, "memory_kb": 77124}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s037289619", "group_id": "codeNet:p03671", "input_text": "@line = split /|\\R/, ;\nwhile (pop @line) {\n next if @line % 2 != 0;\n $mid = @line / 2;\n print @line if @line[0..$mid-1] ~~ @line[$mid..$#line];\n}", "language": "Perl", "metadata": {"date": 1508281003, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03671.html", "problem_id": "p03671", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03671/input.txt", "sample_output_relpath": "derived/input_output/data/p03671/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03671/Perl/s037289619.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s037289619", "user_id": "u429679664"}, "prompt_components": {"gold_output": "1300\n", "input_to_evaluate": "@line = split /|\\R/, ;\nwhile (pop @line) {\n next if @line % 2 != 0;\n $mid = @line / 2;\n print @line if @line[0..$mid-1] ~~ @line[$mid..$#line];\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c 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 total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "sample_input": "700 600 780\n"}, "reference_outputs": ["1300\n"], "source_document_id": "p03671", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c 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 total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 161, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s566382770", "group_id": "codeNet:p03671", "input_text": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $line = ;\nmy @num = split(/ /, $line);\n@num = sort @num;\n\nmy $ans = $num[0] + $num[1];\nsay $ans;\n", "language": "Perl", "metadata": {"date": 1499384918, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03671.html", "problem_id": "p03671", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03671/input.txt", "sample_output_relpath": "derived/input_output/data/p03671/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03671/Perl/s566382770.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s566382770", "user_id": "u314301316"}, "prompt_components": {"gold_output": "1300\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $line = ;\nmy @num = split(/ /, $line);\n@num = sort @num;\n\nmy $ans = $num[0] + $num[1];\nsay $ans;\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c 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 total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "sample_input": "700 600 780\n"}, "reference_outputs": ["1300\n"], "source_document_id": "p03671", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c 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 total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s270162613", "group_id": "codeNet:p03671", "input_text": "my @b=sort map{$_-0} split / /,;\nprint $b[0]+$b[1];", "language": "Perl", "metadata": {"date": 1499131193, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03671.html", "problem_id": "p03671", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03671/input.txt", "sample_output_relpath": "derived/input_output/data/p03671/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03671/Perl/s270162613.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s270162613", "user_id": "u170302265"}, "prompt_components": {"gold_output": "1300\n", "input_to_evaluate": "my @b=sort map{$_-0} split / /,;\nprint $b[0]+$b[1];", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c 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 total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "sample_input": "700 600 780\n"}, "reference_outputs": ["1300\n"], "source_document_id": "p03671", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c 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 total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s958560308", "group_id": "codeNet:p03672", "input_text": "chomp($s=<>);\n\n$flg=0;\nwhile($flg==0){\n\tchop($s);\n if(length($s)%2 == 0){\n \t$head = substr($s,0,length($s)/2);\n $tail = substr($s,length($s)/2);\n if($head eq $tail){\n \t$ans = length($s);\n $flg = 1;\n }\n }\n}\nprint $ans;\n", "language": "Perl", "metadata": {"date": 1570376567, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03672.html", "problem_id": "p03672", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03672/input.txt", "sample_output_relpath": "derived/input_output/data/p03672/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03672/Perl/s958560308.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s958560308", "user_id": "u124498235"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "chomp($s=<>);\n\n$flg=0;\nwhile($flg==0){\n\tchop($s);\n if(length($s)%2 == 0){\n \t$head = substr($s,0,length($s)/2);\n $tail = substr($s,length($s)/2);\n if($head eq $tail){\n \t$ans = length($s);\n $flg = 1;\n }\n }\n}\nprint $ans;\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "sample_input": "abaababaab\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03672", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s212473049", "group_id": "codeNet:p03672", "input_text": "<>=~/(.*)\\1.+/;print 2*length$1", "language": "Perl", "metadata": {"date": 1534914447, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03672.html", "problem_id": "p03672", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03672/input.txt", "sample_output_relpath": "derived/input_output/data/p03672/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03672/Perl/s212473049.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s212473049", "user_id": "u657913472"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "<>=~/(.*)\\1.+/;print 2*length$1", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "sample_input": "abaababaab\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03672", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 31, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s880174919", "group_id": "codeNet:p03672", "input_text": "#!perl -pl\n0until chop,/^(.*)\\1$/;$_=y///c", "language": "Perl", "metadata": {"date": 1498965995, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03672.html", "problem_id": "p03672", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03672/input.txt", "sample_output_relpath": "derived/input_output/data/p03672/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03672/Perl/s880174919.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s880174919", "user_id": "u283869437"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "#!perl -pl\n0until chop,/^(.*)\\1$/;$_=y///c", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "sample_input": "abaababaab\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03672", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s043737559", "group_id": "codeNet:p03679", "input_text": "<>=~/ .* /;print$&<$'?$`+$&<$'?dangerous:safe:delicious", "language": "Perl", "metadata": {"date": 1528361240, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03679.html", "problem_id": "p03679", "resource_group": "low_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/Perl/s043737559.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s043737559", "user_id": "u657913472"}, "prompt_components": {"gold_output": "safe\n", "input_to_evaluate": "<>=~/ .* /;print$&<$'?$`+$&<$'?dangerous:safe:delicious", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 55, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s379100256", "group_id": "codeNet:p03679", "input_text": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw(say);\n \nmy $line = ;\nmy @num = split(/ /, $line);\nmy $X = $num[0];\nmy $A = $num[1];\nmy $B = $num[2];\n \nmy $date = $B - $A;\n \nif ($X < $date) {\n print \"dangerous\"\n} elsif ($date < 0) {\n print \"delicious\";\n} else {\n print \"safe\";\n}", "language": "Perl", "metadata": {"date": 1498782230, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03679.html", "problem_id": "p03679", "resource_group": "low_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/Perl/s379100256.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s379100256", "user_id": "u931757436"}, "prompt_components": {"gold_output": "safe\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse utf8;\nuse feature qw(say);\n \nmy $line = ;\nmy @num = split(/ /, $line);\nmy $X = $num[0];\nmy $A = $num[1];\nmy $B = $num[2];\n \nmy $date = $B - $A;\n \nif ($X < $date) {\n print \"dangerous\"\n} elsif ($date < 0) {\n print \"delicious\";\n} else {\n print \"safe\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 290, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s151429346", "group_id": "codeNet:p03679", "input_text": "\nmy $input_string = ;\n\nmy $X=0;\nmy $A=0;\nmy $B=0;\n\n($X, $A, $B) = split(/ /, $input_string);\n\nif($A >= $B){\n\tprint \"delicious\\n\";\n}\nelsif($A < $B && $B <= $X+$A){\n\tprint \"safe\\n\";\n}\nelse{\n\tprint \"dangerous\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1498353276, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03679.html", "problem_id": "p03679", "resource_group": "low_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/Perl/s151429346.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s151429346", "user_id": "u494396162"}, "prompt_components": {"gold_output": "safe\n", "input_to_evaluate": "\nmy $input_string = ;\n\nmy $X=0;\nmy $A=0;\nmy $B=0;\n\n($X, $A, $B) = split(/ /, $input_string);\n\nif($A >= $B){\n\tprint \"delicious\\n\";\n}\nelsif($A < $B && $B <= $X+$A){\n\tprint \"safe\\n\";\n}\nelse{\n\tprint \"dangerous\\n\";\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s501372204", "group_id": "codeNet:p03680", "input_text": "#!/usr/bin/perl\n\n$line = 0;\nwhile (<>) {\n chomp;\n if ($line == 0) {\n $n = $_;\n } else {\n push @a, $_;\n }\n $line++;\n}\n\n$i = 1;\n$r{$i}++;\nwhile ($i != 2) {\n $i = $a[$i - 1];\n $cnt++;\n if ($r{$i}) {\n print \"-1\\n\";\n exit;\n }\n if ($cnt > $n) {\n print \"-1\\n\";\n exit;\n }\n}\nprint \"$cnt\\n\";\n", "language": "Perl", "metadata": {"date": 1498356230, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03680.html", "problem_id": "p03680", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03680/input.txt", "sample_output_relpath": "derived/input_output/data/p03680/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03680/Perl/s501372204.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s501372204", "user_id": "u669573977"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\n$line = 0;\nwhile (<>) {\n chomp;\n if ($line == 0) {\n $n = $_;\n } else {\n push @a, $_;\n }\n $line++;\n}\n\n$i = 1;\n$r{$i}++;\nwhile ($i != 2) {\n $i = $a[$i - 1];\n $cnt++;\n if ($r{$i}) {\n print \"-1\\n\";\n exit;\n }\n if ($cnt > $n) {\n print \"-1\\n\";\n exit;\n }\n}\nprint \"$cnt\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "sample_input": "3\n3\n1\n2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03680", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 101, "memory_kb": 8448}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s765380318", "group_id": "codeNet:p03683", "input_text": "my $M=1000000007;\nmy $i=0;\nsub a($p){$i+=1;$p*$i%$M}\nmy @arr = (1,&a...*)[^100002];\nmy @nm = get.words;\nmy $n = @nm[0];\nmy $m = @nm[1];\nif $n == $m {\n say (2 * @arr[$n] * @arr[$m]) % $M\n} elsif ($n - $m).abs == 1 {\n say (@arr[$n] * @arr[$m]) % $M\n} else {\n say 0\n}\n", "language": "Perl", "metadata": {"date": 1520299395, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03683.html", "problem_id": "p03683", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03683/input.txt", "sample_output_relpath": "derived/input_output/data/p03683/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03683/Perl/s765380318.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s765380318", "user_id": "u161323909"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "my $M=1000000007;\nmy $i=0;\nsub a($p){$i+=1;$p*$i%$M}\nmy @arr = (1,&a...*)[^100002];\nmy @nm = get.words;\nmy $n = @nm[0];\nmy $m = @nm[1];\nif $n == $m {\n say (2 * @arr[$n] * @arr[$m]) % $M\n} elsif ($n - $m).abs == 1 {\n say (@arr[$n] * @arr[$m]) % $M\n} else {\n say 0\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N dogs and M monkeys. He wants them to line up in a row.\n\nAs a Japanese saying goes, these dogs and monkeys are on bad terms. (\"ken'en no naka\", literally \"the relationship of dogs and monkeys\", means a relationship of mutual hatred.) Snuke is trying to reconsile them, by arranging the animals so that there are neither two adjacent dogs nor two adjacent monkeys.\n\nHow many such arrangements there are? Find the count modulo 10^9+7 (since animals cannot understand numbers larger than that).\nHere, dogs and monkeys are both distinguishable. Also, two arrangements that result from reversing each other are distinguished.\n\nConstraints\n\n1 ≤ N,M ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of possible arrangements, modulo 10^9+7.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n8\n\nWe will denote the dogs by A and B, and the monkeys by C and D. There are eight possible arrangements: ACBD, ADBC, BCAD, BDAC, CADB, CBDA, DACB and DBCA.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 8\n\nSample Output 3\n\n0\n\nSample Input 4\n\n100000 100000\n\nSample Output 4\n\n530123477", "sample_input": "2 2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03683", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N dogs and M monkeys. He wants them to line up in a row.\n\nAs a Japanese saying goes, these dogs and monkeys are on bad terms. (\"ken'en no naka\", literally \"the relationship of dogs and monkeys\", means a relationship of mutual hatred.) Snuke is trying to reconsile them, by arranging the animals so that there are neither two adjacent dogs nor two adjacent monkeys.\n\nHow many such arrangements there are? Find the count modulo 10^9+7 (since animals cannot understand numbers larger than that).\nHere, dogs and monkeys are both distinguishable. Also, two arrangements that result from reversing each other are distinguished.\n\nConstraints\n\n1 ≤ N,M ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of possible arrangements, modulo 10^9+7.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n8\n\nWe will denote the dogs by A and B, and the monkeys by C and D. There are eight possible arrangements: ACBD, ADBC, BCAD, BDAC, CADB, CBDA, DACB and DBCA.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 8\n\nSample Output 3\n\n0\n\nSample Input 4\n\n100000 100000\n\nSample Output 4\n\n530123477", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2112, "memory_kb": 115964}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s875551160", "group_id": "codeNet:p03688", "input_text": "$N=<>;\n++$a{$_}for glob<>;\nif(%a>2){\n\tprint\"No\\n\"\n}else{\n\t($y,$x)=sort{$b-$a}keys%a;\n\tif($x&&$y-$x>1){\n\t\tprint\"No\\n\"\n\t}else{\n\t\tif($N-$a{$x}>=($y-$a{$x})*2 && $a{$x}<=$x){\n\t\t\tprint\"Yes\\n\"\n\t\t}elsif(!$x&&$y+1==$N){\n\t\t\tprint\"Yes\\n\"\n\t\t}else{\n\t\t\tprint\"No\\n\"\n\t\t}\n\t}\n}\n", "language": "Perl", "metadata": {"date": 1497836444, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03688.html", "problem_id": "p03688", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03688/input.txt", "sample_output_relpath": "derived/input_output/data/p03688/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03688/Perl/s875551160.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s875551160", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$N=<>;\n++$a{$_}for glob<>;\nif(%a>2){\n\tprint\"No\\n\"\n}else{\n\t($y,$x)=sort{$b-$a}keys%a;\n\tif($x&&$y-$x>1){\n\t\tprint\"No\\n\"\n\t}else{\n\t\tif($N-$a{$x}>=($y-$a{$x})*2 && $a{$x}<=$x){\n\t\t\tprint\"Yes\\n\"\n\t\t}elsif(!$x&&$y+1==$N){\n\t\t\tprint\"Yes\\n\"\n\t\t}else{\n\t\t\tprint\"No\\n\"\n\t\t}\n\t}\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nThere are N cats.\nWe number them from 1 through N.\n\nEach of the cats wears a hat.\nCat i says: \"there are exactly a_i different colors among the N - 1 hats worn by the cats except me.\"\n\nDetermine whether there exists a sequence of colors of the hats that is consistent with the remarks of the cats.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N-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\nPrint Yes if there exists a sequence of colors of the hats that is consistent with the remarks of the cats; print No otherwise.\n\nSample Input 1\n\n3\n1 2 2\n\nSample Output 1\n\nYes\n\nFor example, if cat 1, 2 and 3 wears red, blue and blue hats, respectively, it is consistent with the remarks of the cats.\n\nSample Input 2\n\n3\n1 1 2\n\nSample Output 2\n\nNo\n\nFrom the remark of cat 1, we can see that cat 2 and 3 wear hats of the same color.\nAlso, from the remark of cat 2, we can see that cat 1 and 3 wear hats of the same color.\nTherefore, cat 1 and 2 wear hats of the same color, which contradicts the remark of cat 3.\n\nSample Input 3\n\n5\n4 3 4 3 4\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\n2 2 2\n\nSample Output 4\n\nYes\n\nSample Input 5\n\n4\n2 2 2 2\n\nSample Output 5\n\nYes\n\nSample Input 6\n\n5\n3 3 3 3 3\n\nSample Output 6\n\nNo", "sample_input": "3\n1 2 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03688", "source_text": "Score : 700 points\n\nProblem Statement\n\nThere are N cats.\nWe number them from 1 through N.\n\nEach of the cats wears a hat.\nCat i says: \"there are exactly a_i different colors among the N - 1 hats worn by the cats except me.\"\n\nDetermine whether there exists a sequence of colors of the hats that is consistent with the remarks of the cats.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N-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\nPrint Yes if there exists a sequence of colors of the hats that is consistent with the remarks of the cats; print No otherwise.\n\nSample Input 1\n\n3\n1 2 2\n\nSample Output 1\n\nYes\n\nFor example, if cat 1, 2 and 3 wears red, blue and blue hats, respectively, it is consistent with the remarks of the cats.\n\nSample Input 2\n\n3\n1 1 2\n\nSample Output 2\n\nNo\n\nFrom the remark of cat 1, we can see that cat 2 and 3 wear hats of the same color.\nAlso, from the remark of cat 2, we can see that cat 1 and 3 wear hats of the same color.\nTherefore, cat 1 and 2 wear hats of the same color, which contradicts the remark of cat 3.\n\nSample Input 3\n\n5\n4 3 4 3 4\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\n2 2 2\n\nSample Output 4\n\nYes\n\nSample Input 5\n\n4\n2 2 2 2\n\nSample Output 5\n\nYes\n\nSample Input 6\n\n5\n3 3 3 3 3\n\nSample Output 6\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 261, "cpu_time_ms": 261, "memory_kb": 30208}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s963123177", "group_id": "codeNet:p03689", "input_text": "($H,$W,$h,$w)=glob<>;\nif($H%$h|$W%$w){\n\tprint\"Yes\\n\";\n\tfor$y(1..$H){\n\t\tfor$x(1..$W){\n\t\t\tprint$x>1&&$\",~-$x%$w|~-$y%$h?$x%$w|$y%$h?0:-1e9:9x9\n\t\t}\n\t\tprint$/\n\t}\n}else{\n\tprint\"No\\n\"\n}\n", "language": "Perl", "metadata": {"date": 1497846844, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03689.html", "problem_id": "p03689", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03689/input.txt", "sample_output_relpath": "derived/input_output/data/p03689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03689/Perl/s963123177.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s963123177", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n1 1 1\n1 -4 1\n1 1 1\n", "input_to_evaluate": "($H,$W,$h,$w)=glob<>;\nif($H%$h|$W%$w){\n\tprint\"Yes\\n\";\n\tfor$y(1..$H){\n\t\tfor$x(1..$W){\n\t\t\tprint$x>1&&$\",~-$x%$w|~-$y%$h?$x%$w|$y%$h?0:-1e9:9x9\n\t\t}\n\t\tprint$/\n\t}\n}else{\n\tprint\"No\\n\"\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "sample_input": "3 3 2 2\n"}, "reference_outputs": ["Yes\n1 1 1\n1 -4 1\n1 1 1\n"], "source_document_id": "p03689", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 175, "memory_kb": 3584}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s357992028", "group_id": "codeNet:p03689", "input_text": "($H,$W,$h,$w)=glob<>;\nif($H%$h|$W%$w){\n\tprint\"Yes\\n\";\n\tfor$y(0..$H-1){\n\t\tfor$x(0..$W-1){\n\t\t\tprint$x>0&&$\",$x%$w|$y%$h?($x+1)%$w|($y+1)%$h?0:-1e9:9x9\n\t\t}\n\t\tprint$/\n\t}\n}else{\n\tprint\"No\\n\"\n}\n", "language": "Perl", "metadata": {"date": 1497846491, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03689.html", "problem_id": "p03689", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03689/input.txt", "sample_output_relpath": "derived/input_output/data/p03689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03689/Perl/s357992028.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s357992028", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n1 1 1\n1 -4 1\n1 1 1\n", "input_to_evaluate": "($H,$W,$h,$w)=glob<>;\nif($H%$h|$W%$w){\n\tprint\"Yes\\n\";\n\tfor$y(0..$H-1){\n\t\tfor$x(0..$W-1){\n\t\t\tprint$x>0&&$\",$x%$w|$y%$h?($x+1)%$w|($y+1)%$h?0:-1e9:9x9\n\t\t}\n\t\tprint$/\n\t}\n}else{\n\tprint\"No\\n\"\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "sample_input": "3 3 2 2\n"}, "reference_outputs": ["Yes\n1 1 1\n1 -4 1\n1 1 1\n"], "source_document_id": "p03689", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 188, "cpu_time_ms": 182, "memory_kb": 3456}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s737064236", "group_id": "codeNet:p03689", "input_text": "($H,$W,$h,$w)=glob<>;\nif($H%$h|$W%$w){\n\tprint\"Yes\\n\";\n\tfor$y(1..$H){\n\t\tprint$y%$h-1?0:9x9;\n\t\tfor$x(2..$W){\n\t\t\tprint$\",$x%$w-1|$y%$h-1?$x%$w|$y%$h?0:-1e9:9x9\n\t\t}\n\t\tprint$/\n\t}\n}else{\n\tprint\"No\\n\"\n}\n", "language": "Perl", "metadata": {"date": 1497845049, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03689.html", "problem_id": "p03689", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03689/input.txt", "sample_output_relpath": "derived/input_output/data/p03689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03689/Perl/s737064236.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s737064236", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n1 1 1\n1 -4 1\n1 1 1\n", "input_to_evaluate": "($H,$W,$h,$w)=glob<>;\nif($H%$h|$W%$w){\n\tprint\"Yes\\n\";\n\tfor$y(1..$H){\n\t\tprint$y%$h-1?0:9x9;\n\t\tfor$x(2..$W){\n\t\t\tprint$\",$x%$w-1|$y%$h-1?$x%$w|$y%$h?0:-1e9:9x9\n\t\t}\n\t\tprint$/\n\t}\n}else{\n\tprint\"No\\n\"\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "sample_input": "3 3 2 2\n"}, "reference_outputs": ["Yes\n1 1 1\n1 -4 1\n1 1 1\n"], "source_document_id": "p03689", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 154, "memory_kb": 2560}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s888470018", "group_id": "codeNet:p03689", "input_text": "($H,$W,$h,$w)=glob<>;\npush@a,[(1)x$W]for 1..$H;\nfor$y(1..$H/$h){\n\tfor$x(1..$W/$w){\n\t\t$a[$y*$h-1][$x*$w-1]=-$h*$w\n\t}\n}\nfor(@a){\n\t$%+=$_ for@$_\n}\nif($%>0){\n\tprint\"Yes\\n\";\n\tprint\"@$_\\n\"for@a\n}else{\n\tdie;\n\tprint\"No\\n\"\n}\n", "language": "Perl", "metadata": {"date": 1497839139, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03689.html", "problem_id": "p03689", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03689/input.txt", "sample_output_relpath": "derived/input_output/data/p03689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03689/Perl/s888470018.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s888470018", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n1 1 1\n1 -4 1\n1 1 1\n", "input_to_evaluate": "($H,$W,$h,$w)=glob<>;\npush@a,[(1)x$W]for 1..$H;\nfor$y(1..$H/$h){\n\tfor$x(1..$W/$w){\n\t\t$a[$y*$h-1][$x*$w-1]=-$h*$w\n\t}\n}\nfor(@a){\n\t$%+=$_ for@$_\n}\nif($%>0){\n\tprint\"Yes\\n\";\n\tprint\"@$_\\n\"for@a\n}else{\n\tdie;\n\tprint\"No\\n\"\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "sample_input": "3 3 2 2\n"}, "reference_outputs": ["Yes\n1 1 1\n1 -4 1\n1 1 1\n"], "source_document_id": "p03689", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W).\nDetermine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive:\n\nThe matrix has H rows and W columns.\n\nEach element of the matrix is an integer between -10^9 and 10^9 (inclusive).\n\nThe sum of all the elements of the matrix is positive.\n\nThe sum of all the elements within every subrectangle with h rows and w columns in the matrix is negative.\n\nConstraints\n\n1 ≤ h ≤ H ≤ 500\n\n1 ≤ w ≤ W ≤ 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W h w\n\nOutput\n\nIf there does not exist a matrix that satisfies all of the conditions, print No.\n\nOtherwise, print Yes in the first line, and print a matrix in the subsequent lines in the following format:\n\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nHere, a_{ij} represents the (i,\\ j) element of the matrix.\n\nSample Input 1\n\n3 3 2 2\n\nSample Output 1\n\nYes\n1 1 1\n1 -4 1\n1 1 1\n\nThe sum of all the elements of this matrix is 4, which is positive.\nAlso, in this matrix, there are four subrectangles with 2 rows and 2 columns as shown below. For each of them, the sum of all the elements inside is -1, which is negative.\n\nSample Input 2\n\n2 4 1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n3 4 2 3\n\nSample Output 3\n\nYes\n2 -5 8 7\n3 -5 -4 -5\n2 1 -1 7", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 95, "memory_kb": 22912}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s258100951", "group_id": "codeNet:p03693", "input_text": "print<>=~s/ //rg%4?NO:YES", "language": "Perl", "metadata": {"date": 1563827197, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03693.html", "problem_id": "p03693", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03693/input.txt", "sample_output_relpath": "derived/input_output/data/p03693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03693/Perl/s258100951.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s258100951", "user_id": "u573154728"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "print<>=~s/ //rg%4?NO:YES", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer has three cards, one red, one green and one blue.\n\nAn integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.\n\nWe will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.\n\nIs this integer a multiple of 4?\n\nConstraints\n\n1 ≤ r, g, b ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr g b\n\nOutput\n\nIf the three-digit integer is a multiple of 4, print YES (case-sensitive); otherwise, print NO.\n\nSample Input 1\n\n4 3 2\n\nSample Output 1\n\nYES\n\n432 is a multiple of 4, and thus YES should be printed.\n\nSample Input 2\n\n2 3 4\n\nSample Output 2\n\nNO\n\n234 is not a multiple of 4, and thus NO should be printed.", "sample_input": "4 3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03693", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer has three cards, one red, one green and one blue.\n\nAn integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.\n\nWe will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.\n\nIs this integer a multiple of 4?\n\nConstraints\n\n1 ≤ r, g, b ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr g b\n\nOutput\n\nIf the three-digit integer is a multiple of 4, print YES (case-sensitive); otherwise, print NO.\n\nSample Input 1\n\n4 3 2\n\nSample Output 1\n\nYES\n\n432 is a multiple of 4, and thus YES should be printed.\n\nSample Input 2\n\n2 3 4\n\nSample Output 2\n\nNO\n\n234 is not a multiple of 4, and thus NO should be printed.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 25, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s801418501", "group_id": "codeNet:p03693", "input_text": "#!/usr/bin/perl\n\nwhile(<>) {\n ($r, $g, $b) = split /\\s+/, $_;\n}\n\n$t = $r * 100 + $g * 10 + $b;\nif($t % 4 == 0) {\n print \"YES\\n\";\n} else {\n print \"NO\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1497143204, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03693.html", "problem_id": "p03693", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03693/input.txt", "sample_output_relpath": "derived/input_output/data/p03693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03693/Perl/s801418501.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s801418501", "user_id": "u669573977"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "#!/usr/bin/perl\n\nwhile(<>) {\n ($r, $g, $b) = split /\\s+/, $_;\n}\n\n$t = $r * 100 + $g * 10 + $b;\nif($t % 4 == 0) {\n print \"YES\\n\";\n} else {\n print \"NO\\n\";\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer has three cards, one red, one green and one blue.\n\nAn integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.\n\nWe will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.\n\nIs this integer a multiple of 4?\n\nConstraints\n\n1 ≤ r, g, b ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr g b\n\nOutput\n\nIf the three-digit integer is a multiple of 4, print YES (case-sensitive); otherwise, print NO.\n\nSample Input 1\n\n4 3 2\n\nSample Output 1\n\nYES\n\n432 is a multiple of 4, and thus YES should be printed.\n\nSample Input 2\n\n2 3 4\n\nSample Output 2\n\nNO\n\n234 is not a multiple of 4, and thus NO should be printed.", "sample_input": "4 3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03693", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer has three cards, one red, one green and one blue.\n\nAn integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.\n\nWe will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.\n\nIs this integer a multiple of 4?\n\nConstraints\n\n1 ≤ r, g, b ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr g b\n\nOutput\n\nIf the three-digit integer is a multiple of 4, print YES (case-sensitive); otherwise, print NO.\n\nSample Input 1\n\n4 3 2\n\nSample Output 1\n\nYES\n\n432 is a multiple of 4, and thus YES should be printed.\n\nSample Input 2\n\n2 3 4\n\nSample Output 2\n\nNO\n\n234 is not a multiple of 4, and thus NO should be printed.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s736239863", "group_id": "codeNet:p03694", "input_text": "<>;$/=$\";@@=sort{$b-$a}<>;print@@[0]-pop@@", "language": "Perl", "metadata": {"date": 1497147348, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03694.html", "problem_id": "p03694", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03694/input.txt", "sample_output_relpath": "derived/input_output/data/p03694/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03694/Perl/s736239863.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s736239863", "user_id": "u711705317"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "<>;$/=$\";@@=sort{$b-$a}<>;print@@[0]-pop@@", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.\n\nThere are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.\n\nFind the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n0 ≤ a_i ≤ 1000\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 minimum distance to be traveled.\n\nSample Input 1\n\n4\n2 3 7 9\n\nSample Output 1\n\n7\n\nThe travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.\n\nIt is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.\n\nSample Input 2\n\n8\n3 1 4 1 5 9 2 6\n\nSample Output 2\n\n8\n\nThere may be more than one house at a position.", "sample_input": "4\n2 3 7 9\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03694", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.\n\nThere are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.\n\nFind the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n0 ≤ a_i ≤ 1000\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 minimum distance to be traveled.\n\nSample Input 1\n\n4\n2 3 7 9\n\nSample Output 1\n\n7\n\nThe travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.\n\nIt is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.\n\nSample Input 2\n\n8\n3 1 4 1 5 9 2 6\n\nSample Output 2\n\n8\n\nThere may be more than one house at a position.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s554162037", "group_id": "codeNet:p03695", "input_text": "chomp($n=<>);\nchomp($a=<>);\n@a=split/ /,$a;\n\n%hash=();\nfor($i=0;$i<$n;$i++){\n if($a[$i] < 400){\n $hash{1}++;\n }elsif($a[$i] < 800){\n $hash{2}++;\n }elsif($a[$i] < 1200){\n $hash{3}++;\n }elsif($a[$i] < 1600){\n $hash{4}++;\n }elsif($a[$i] < 2000){\n $hash{5}++;\n }elsif($a[$i] < 2400){\n $hash{6}++;\n }elsif($a[$i] < 2800){\n $hash{7}++;\n }elsif($a[$i] < 3200){\n $hash{8}++;\n }else{\n $hash{9}++;\n }\n}\n\nforeach ( keys %hash){\n if($hash{$_} > 0){\n $cnt++;\n }\n}\nif($hash{9} > 0){\n $min = $cnt - 1;\n $max = $cnt - 1 + $hash{9};\n}else{\n $min = $cnt;\n $max = $cnt;\n}\nif($min == 0){\n $min = 1;\n}\n\nprint $min.\" \".$max;", "language": "Perl", "metadata": {"date": 1571101812, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03695.html", "problem_id": "p03695", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03695/input.txt", "sample_output_relpath": "derived/input_output/data/p03695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03695/Perl/s554162037.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s554162037", "user_id": "u124498235"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "chomp($n=<>);\nchomp($a=<>);\n@a=split/ /,$a;\n\n%hash=();\nfor($i=0;$i<$n;$i++){\n if($a[$i] < 400){\n $hash{1}++;\n }elsif($a[$i] < 800){\n $hash{2}++;\n }elsif($a[$i] < 1200){\n $hash{3}++;\n }elsif($a[$i] < 1600){\n $hash{4}++;\n }elsif($a[$i] < 2000){\n $hash{5}++;\n }elsif($a[$i] < 2400){\n $hash{6}++;\n }elsif($a[$i] < 2800){\n $hash{7}++;\n }elsif($a[$i] < 3200){\n $hash{8}++;\n }else{\n $hash{9}++;\n }\n}\n\nforeach ( keys %hash){\n if($hash{$_} > 0){\n $cnt++;\n }\n}\nif($hash{9} > 0){\n $min = $cnt - 1;\n $max = $cnt - 1 + $hash{9};\n}else{\n $min = $cnt;\n $max = $cnt;\n}\nif($min == 0){\n $min = 1;\n}\n\nprint $min.\" \".$max;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\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 minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "sample_input": "4\n2100 2500 2700 2700\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p03695", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\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 minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 723, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s836655201", "group_id": "codeNet:p03696", "input_text": "<>;$s=<>;chop$s;@S=split//,$s;\nforeach(@S){\n if('('eq$_){$l++}else{$r++}\n $-=$r-$l;$x=$->$x?$-:$x;\n}\nforeach(reverse(@S)){\n if(')'eq$_){$p++}else{$q++}\n $-=$q-$p;$y=$->$y?$-:$y;\n}\nprint '('x$x,$s,')'x$y", "language": "Perl", "metadata": {"date": 1563828374, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03696.html", "problem_id": "p03696", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03696/input.txt", "sample_output_relpath": "derived/input_output/data/p03696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03696/Perl/s836655201.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s836655201", "user_id": "u573154728"}, "prompt_components": {"gold_output": "(())\n", "input_to_evaluate": "<>;$s=<>;chop$s;@S=split//,$s;\nforeach(@S){\n if('('eq$_){$l++}else{$r++}\n $-=$r-$l;$x=$->$x?$-:$x;\n}\nforeach(reverse(@S)){\n if(')'eq$_){$p++}else{$q++}\n $-=$q-$p;$y=$->$y?$-:$y;\n}\nprint '('x$x,$s,')'x$y", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of ( and ). Your task is to insert some number of ( and ) into S to obtain a correct bracket sequence.\n\nHere, a correct bracket sequence is defined as follows:\n\n() is a correct bracket sequence.\n\nIf X is a correct bracket sequence, the concatenation of (, X and ) in this order is also a correct bracket sequence.\n\nIf X and Y are correct bracket sequences, the concatenation of X and Y in this order is also a correct bracket sequence.\n\nEvery correct bracket sequence can be derived from the rules above.\n\nFind the shortest correct bracket sequence that can be obtained. If there is more than one such sequence, find the lexicographically smallest one.\n\nConstraints\n\nThe length of S is N.\n\n1 ≤ N ≤ 100\n\nS consists of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the lexicographically smallest string among the shortest correct bracket sequences that can be obtained by inserting some number of ( and ) into S.\n\nSample Input 1\n\n3\n())\n\nSample Output 1\n\n(())\n\nSample Input 2\n\n6\n)))())\n\nSample Output 2\n\n(((()))())\n\nSample Input 3\n\n8\n))))((((\n\nSample Output 3\n\n(((())))(((())))", "sample_input": "3\n())\n"}, "reference_outputs": ["(())\n"], "source_document_id": "p03696", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of ( and ). Your task is to insert some number of ( and ) into S to obtain a correct bracket sequence.\n\nHere, a correct bracket sequence is defined as follows:\n\n() is a correct bracket sequence.\n\nIf X is a correct bracket sequence, the concatenation of (, X and ) in this order is also a correct bracket sequence.\n\nIf X and Y are correct bracket sequences, the concatenation of X and Y in this order is also a correct bracket sequence.\n\nEvery correct bracket sequence can be derived from the rules above.\n\nFind the shortest correct bracket sequence that can be obtained. If there is more than one such sequence, find the lexicographically smallest one.\n\nConstraints\n\nThe length of S is N.\n\n1 ≤ N ≤ 100\n\nS consists of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the lexicographically smallest string among the shortest correct bracket sequences that can be obtained by inserting some number of ( and ) into S.\n\nSample Input 1\n\n3\n())\n\nSample Output 1\n\n(())\n\nSample Input 2\n\n6\n)))())\n\nSample Output 2\n\n(((()))())\n\nSample Input 3\n\n8\n))))((((\n\nSample Output 3\n\n(((())))(((())))", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s342476699", "group_id": "codeNet:p03697", "input_text": "print<>!~$\",$`+$'<10?$`+$':error", "language": "Perl", "metadata": {"date": 1570943958, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03697.html", "problem_id": "p03697", "resource_group": "low_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/Perl/s342476699.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s342476699", "user_id": "u832039789"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "print<>!~$\",$`+$'<10?$`+$':error", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32, "cpu_time_ms": 5, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s526322440", "group_id": "codeNet:p03697", "input_text": "(\"error\",$_=get.words.sum)[10>$_].say", "language": "Perl", "metadata": {"date": 1528358638, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03697.html", "problem_id": "p03697", "resource_group": "low_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/Perl/s526322440.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s526322440", "user_id": "u657913472"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "(\"error\",$_=get.words.sum)[10>$_].say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 285, "memory_kb": 63220}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s630701794", "group_id": "codeNet:p03698", "input_text": "$s1 = <>;\n@s2 = split(//,$s1);\n$h{$_}=1 for (@s2);\nif (length($s1) == (scalar keys %h)) {\n print 'yes';\n}\nelse {\n print 'no';\n}", "language": "Perl", "metadata": {"date": 1599675116, "filename_ext": "pl", "original_language": "Perl (5.26.1)", "problem_description_relpath": "problem_descriptions/p03698.html", "problem_id": "p03698", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03698/input.txt", "sample_output_relpath": "derived/input_output/data/p03698/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03698/Perl/s630701794.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s630701794", "user_id": "u636683284"}, "prompt_components": {"gold_output": "yes\n", "input_to_evaluate": "$s1 = <>;\n@s2 = split(//,$s1);\n$h{$_}=1 for (@s2);\nif (length($s1) == (scalar keys %h)) {\n print 'yes';\n}\nelse {\n print 'no';\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.\n\nConstraints\n\n2 ≤ |S| ≤ 26, where |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\nIf all the characters in S are different, print yes (case-sensitive); otherwise, print no.\n\nSample Input 1\n\nuncopyrightable\n\nSample Output 1\n\nyes\n\nSample Input 2\n\ndifferent\n\nSample Output 2\n\nno\n\nSample Input 3\n\nno\n\nSample Output 3\n\nyes", "sample_input": "uncopyrightable\n"}, "reference_outputs": ["yes\n"], "source_document_id": "p03698", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.\n\nConstraints\n\n2 ≤ |S| ≤ 26, where |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\nIf all the characters in S are different, print yes (case-sensitive); otherwise, print no.\n\nSample Input 1\n\nuncopyrightable\n\nSample Output 1\n\nyes\n\nSample Input 2\n\ndifferent\n\nSample Output 2\n\nno\n\nSample Input 3\n\nno\n\nSample Output 3\n\nyes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 4728}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s620073146", "group_id": "codeNet:p03700", "input_text": "use POSIX;\n($N,$A,$B,@@)=glob`dd`;\n$a=$%=1<<30;\nmap{\n $==$i=$a-$%;\n $=-=ceil(($-=$_-$B*$i)/($A-$B))for@@;\n $a-=$%*($=>=0);\n $%/=2;\n # print\"$% $a $i $=$/\";\n}1..32;\nprint$i;", "language": "Perl", "metadata": {"date": 1496600951, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03700.html", "problem_id": "p03700", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03700/input.txt", "sample_output_relpath": "derived/input_output/data/p03700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03700/Perl/s620073146.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s620073146", "user_id": "u711705317"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use POSIX;\n($N,$A,$B,@@)=glob`dd`;\n$a=$%=1<<30;\nmap{\n $==$i=$a-$%;\n $=-=ceil(($-=$_-$B*$i)/($A-$B))for@@;\n $a-=$%*($=>=0);\n $%/=2;\n # print\"$% $a $i $=$/\";\n}1..32;\nprint$i;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below.\n\nFortunately, you are a skilled magician, capable of causing explosions that damage monsters. In one explosion, you can damage monsters as follows:\n\nSelect an alive monster, and cause an explosion centered at that monster. The health of the monster at the center of the explosion will decrease by A, and the health of each of the other monsters will decrease by B. Here, A and B are predetermined parameters, and A > B holds.\n\nAt least how many explosions do you need to cause in order to vanish all the monsters?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 10^5\n\n1 ≤ B < A ≤ 10^9\n\n1 ≤ h_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum number of explosions that needs to be caused in order to vanish all the monsters.\n\nSample Input 1\n\n4 5 3\n8\n7\n4\n2\n\nSample Output 1\n\n2\n\nYou can vanish all the monsters in two explosion, as follows:\n\nFirst, cause an explosion centered at the monster with 8 health. The healths of the four monsters become 3, 4, 1 and -1, respectively, and the last monster vanishes.\n\nSecond, cause an explosion centered at the monster with 4 health remaining. The healths of the three remaining monsters become 0, -1 and -2, respectively, and all the monsters are now vanished.\n\nSample Input 2\n\n2 10 4\n20\n20\n\nSample Output 2\n\n4\n\nYou need to cause two explosions centered at each monster, for a total of four.\n\nSample Input 3\n\n5 2 1\n900000000\n900000000\n1000000000\n1000000000\n1000000000\n\nSample Output 3\n\n800000000", "sample_input": "4 5 3\n8\n7\n4\n2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03700", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below.\n\nFortunately, you are a skilled magician, capable of causing explosions that damage monsters. In one explosion, you can damage monsters as follows:\n\nSelect an alive monster, and cause an explosion centered at that monster. The health of the monster at the center of the explosion will decrease by A, and the health of each of the other monsters will decrease by B. Here, A and B are predetermined parameters, and A > B holds.\n\nAt least how many explosions do you need to cause in order to vanish all the monsters?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 10^5\n\n1 ≤ B < A ≤ 10^9\n\n1 ≤ h_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum number of explosions that needs to be caused in order to vanish all the monsters.\n\nSample Input 1\n\n4 5 3\n8\n7\n4\n2\n\nSample Output 1\n\n2\n\nYou can vanish all the monsters in two explosion, as follows:\n\nFirst, cause an explosion centered at the monster with 8 health. The healths of the four monsters become 3, 4, 1 and -1, respectively, and the last monster vanishes.\n\nSecond, cause an explosion centered at the monster with 4 health remaining. The healths of the three remaining monsters become 0, -1 and -2, respectively, and all the monsters are now vanished.\n\nSample Input 2\n\n2 10 4\n20\n20\n\nSample Output 2\n\n4\n\nYou need to cause two explosions centered at each monster, for a total of four.\n\nSample Input 3\n\n5 2 1\n900000000\n900000000\n1000000000\n1000000000\n1000000000\n\nSample Output 3\n\n800000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 177, "cpu_time_ms": 1857, "memory_kb": 28684}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s187865225", "group_id": "codeNet:p03700", "input_text": "use POSIX;\n($N,$A,$B,@@)=glob`dd`;\n$a=($%=1<<30)-1;\nmap{\n $==$i=$a-$%;\n $=-=ceil(($-=$_-$B*$i)/($A-$B))for@@;\n $a-=$%*($=>=0);\n $%/=2;\n # print\"$% $a $i $=$/\";\n}1..31;\nprint$i;", "language": "Perl", "metadata": {"date": 1496600824, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03700.html", "problem_id": "p03700", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03700/input.txt", "sample_output_relpath": "derived/input_output/data/p03700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03700/Perl/s187865225.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s187865225", "user_id": "u711705317"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use POSIX;\n($N,$A,$B,@@)=glob`dd`;\n$a=($%=1<<30)-1;\nmap{\n $==$i=$a-$%;\n $=-=ceil(($-=$_-$B*$i)/($A-$B))for@@;\n $a-=$%*($=>=0);\n $%/=2;\n # print\"$% $a $i $=$/\";\n}1..31;\nprint$i;", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below.\n\nFortunately, you are a skilled magician, capable of causing explosions that damage monsters. In one explosion, you can damage monsters as follows:\n\nSelect an alive monster, and cause an explosion centered at that monster. The health of the monster at the center of the explosion will decrease by A, and the health of each of the other monsters will decrease by B. Here, A and B are predetermined parameters, and A > B holds.\n\nAt least how many explosions do you need to cause in order to vanish all the monsters?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 10^5\n\n1 ≤ B < A ≤ 10^9\n\n1 ≤ h_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum number of explosions that needs to be caused in order to vanish all the monsters.\n\nSample Input 1\n\n4 5 3\n8\n7\n4\n2\n\nSample Output 1\n\n2\n\nYou can vanish all the monsters in two explosion, as follows:\n\nFirst, cause an explosion centered at the monster with 8 health. The healths of the four monsters become 3, 4, 1 and -1, respectively, and the last monster vanishes.\n\nSecond, cause an explosion centered at the monster with 4 health remaining. The healths of the three remaining monsters become 0, -1 and -2, respectively, and all the monsters are now vanished.\n\nSample Input 2\n\n2 10 4\n20\n20\n\nSample Output 2\n\n4\n\nYou need to cause two explosions centered at each monster, for a total of four.\n\nSample Input 3\n\n5 2 1\n900000000\n900000000\n1000000000\n1000000000\n1000000000\n\nSample Output 3\n\n800000000", "sample_input": "4 5 3\n8\n7\n4\n2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03700", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below.\n\nFortunately, you are a skilled magician, capable of causing explosions that damage monsters. In one explosion, you can damage monsters as follows:\n\nSelect an alive monster, and cause an explosion centered at that monster. The health of the monster at the center of the explosion will decrease by A, and the health of each of the other monsters will decrease by B. Here, A and B are predetermined parameters, and A > B holds.\n\nAt least how many explosions do you need to cause in order to vanish all the monsters?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 10^5\n\n1 ≤ B < A ≤ 10^9\n\n1 ≤ h_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum number of explosions that needs to be caused in order to vanish all the monsters.\n\nSample Input 1\n\n4 5 3\n8\n7\n4\n2\n\nSample Output 1\n\n2\n\nYou can vanish all the monsters in two explosion, as follows:\n\nFirst, cause an explosion centered at the monster with 8 health. The healths of the four monsters become 3, 4, 1 and -1, respectively, and the last monster vanishes.\n\nSecond, cause an explosion centered at the monster with 4 health remaining. The healths of the three remaining monsters become 0, -1 and -2, respectively, and all the monsters are now vanished.\n\nSample Input 2\n\n2 10 4\n20\n20\n\nSample Output 2\n\n4\n\nYou need to cause two explosions centered at each monster, for a total of four.\n\nSample Input 3\n\n5 2 1\n900000000\n900000000\n1000000000\n1000000000\n1000000000\n\nSample Output 3\n\n800000000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1799, "memory_kb": 28664}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s070131979", "group_id": "codeNet:p03701", "input_text": "<>;@a=grep{$%+=$_;/0$/}`sort -n`;print$%%10?$%:@a&&$%-\"@a\"", "language": "Perl", "metadata": {"date": 1496563201, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03701.html", "problem_id": "p03701", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03701/input.txt", "sample_output_relpath": "derived/input_output/data/p03701/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03701/Perl/s070131979.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s070131979", "user_id": "u283869437"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "<>;@a=grep{$%+=$_;/0$/}`sort -n`;print$%%10?$%:@a&&$%-\"@a\"", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\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 maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "sample_input": "3\n5\n10\n15\n"}, "reference_outputs": ["25\n"], "source_document_id": "p03701", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\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 maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 5, "memory_kb": 820}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s070135048", "group_id": "codeNet:p03708", "input_text": "use bigint;\n(sprintf'%060b %060b',<>)=~/(.*)(.*) \\1(.*)/;\n$A=$2;$B=$3;\nprintf\"%d\\n\",\n+(eval'0b'.$B=~y/0/1/r)-(eval\"0b$A\")+1\n-($-=(eval'0b'.$A=~s/0/1/r)-(eval'0b'.$B=~s/1.*?1\\K.*/$&=~y!0!1!r/er)-1)\n", "language": "Perl", "metadata": {"date": 1495964645, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03708.html", "problem_id": "p03708", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03708/input.txt", "sample_output_relpath": "derived/input_output/data/p03708/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03708/Perl/s070135048.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s070135048", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "use bigint;\n(sprintf'%060b %060b',<>)=~/(.*)(.*) \\1(.*)/;\n$A=$2;$B=$3;\nprintf\"%d\\n\",\n+(eval'0b'.$B=~y/0/1/r)-(eval\"0b$A\")+1\n-($-=(eval'0b'.$A=~s/0/1/r)-(eval'0b'.$B=~s/1.*?1\\K.*/$&=~y!0!1!r/er)-1)\n", "problem_context": "Score : 900 points\n\nProblem Statement\n\nNukes has an integer that can be represented as the bitwise OR of one or more integers between A and B (inclusive).\nHow many possible candidates of the value of Nukes's integer there are?\n\nConstraints\n\n1 ≤ A ≤ B < 2^{60}\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the number of possible candidates of the value of Nukes's integer.\n\nSample Input 1\n\n7\n9\n\nSample Output 1\n\n4\n\nIn this case, A=7 and B=9. There are four integers that can be represented as the bitwise OR of a non-empty subset of {7, 8, 9}: 7, 8, 9 and 15.\n\nSample Input 2\n\n65\n98\n\nSample Output 2\n\n63\n\nSample Input 3\n\n271828182845904523\n314159265358979323\n\nSample Output 3\n\n68833183630578410", "sample_input": "7\n9\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03708", "source_text": "Score : 900 points\n\nProblem Statement\n\nNukes has an integer that can be represented as the bitwise OR of one or more integers between A and B (inclusive).\nHow many possible candidates of the value of Nukes's integer there are?\n\nConstraints\n\n1 ≤ A ≤ B < 2^{60}\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the number of possible candidates of the value of Nukes's integer.\n\nSample Input 1\n\n7\n9\n\nSample Output 1\n\n4\n\nIn this case, A=7 and B=9. There are four integers that can be represented as the bitwise OR of a non-empty subset of {7, 8, 9}: 7, 8, 9 and 15.\n\nSample Input 2\n\n65\n98\n\nSample Output 2\n\n63\n\nSample Input 3\n\n271828182845904523\n314159265358979323\n\nSample Output 3\n\n68833183630578410", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 197, "cpu_time_ms": 34, "memory_kb": 4992}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s432233634", "group_id": "codeNet:p03711", "input_text": "@a=split//,DACABABAABABA;print<>!~$\",$a[$`]ne$a[$']?No:Yes", "language": "Perl", "metadata": {"date": 1564166697, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03711.html", "problem_id": "p03711", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03711/input.txt", "sample_output_relpath": "derived/input_output/data/p03711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03711/Perl/s432233634.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s432233634", "user_id": "u573154728"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "@a=split//,DACABABAABABA;print<>!~$\",$a[$`]ne$a[$']?No:Yes", "problem_context": "Score : 100 points\n\nProblem Statement\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.\nGiven two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.\n\nConstraints\n\nx and y are integers.\n\n1 ≤ x < y ≤ 12\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nIf x and y belong to the same group, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\nNo", "sample_input": "1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03711", "source_text": "Score : 100 points\n\nProblem Statement\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.\nGiven two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.\n\nConstraints\n\nx and y are integers.\n\n1 ≤ x < y ≤ 12\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nIf x and y belong to the same group, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 58, "cpu_time_ms": 6, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s949450770", "group_id": "codeNet:p03711", "input_text": "get~~m:g/\\d+/;my$a=(0,0,2,|(0,1,0,1,0)xx 2);[$a[$0]==$a[$1]].say", "language": "Perl", "metadata": {"date": 1535210423, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03711.html", "problem_id": "p03711", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03711/input.txt", "sample_output_relpath": "derived/input_output/data/p03711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03711/Perl/s949450770.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s949450770", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "get~~m:g/\\d+/;my$a=(0,0,2,|(0,1,0,1,0)xx 2);[$a[$0]==$a[$1]].say", "problem_context": "Score : 100 points\n\nProblem Statement\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.\nGiven two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.\n\nConstraints\n\nx and y are integers.\n\n1 ≤ x < y ≤ 12\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nIf x and y belong to the same group, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\nNo", "sample_input": "1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03711", "source_text": "Score : 100 points\n\nProblem Statement\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.\nGiven two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.\n\nConstraints\n\nx and y are integers.\n\n1 ≤ x < y ≤ 12\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nIf x and y belong to the same group, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 340, "memory_kb": 68108}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s492157910", "group_id": "codeNet:p03712", "input_text": "#!/usr/bin/perl\n\n$line = 0;\nwhile(<>) {\n if($line == 0) {\n ($h, $w) = split /\\s/, $_;\n } else {\n chomp;\n push @a, $_;\n }\n $line++;\n}\n\nforeach (1 .. $w + 2) {\n print \"#\";\n}\nprint \"\\n\";\n\nforeach (@a) {\n print \"#$_#\";\n print \"\\n\";\n}\nforeach (1 .. $w + 2) {\n print \"#\";\n}\nprint \"\\n\";\n", "language": "Perl", "metadata": {"date": 1495329482, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03712.html", "problem_id": "p03712", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03712/input.txt", "sample_output_relpath": "derived/input_output/data/p03712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03712/Perl/s492157910.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s492157910", "user_id": "u669573977"}, "prompt_components": {"gold_output": "#####\n#abc#\n#arc#\n#####\n", "input_to_evaluate": "#!/usr/bin/perl\n\n$line = 0;\nwhile(<>) {\n if($line == 0) {\n ($h, $w) = split /\\s/, $_;\n } else {\n chomp;\n push @a, $_;\n }\n $line++;\n}\n\nforeach (1 .. $w + 2) {\n print \"#\";\n}\nprint \"\\n\";\n\nforeach (@a) {\n print \"#$_#\";\n print \"\\n\";\n}\nforeach (1 .. $w + 2) {\n print \"#\";\n}\nprint \"\\n\";\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a image with a height of H pixels and a width of W pixels.\nEach pixel is represented by a lowercase English letter.\nThe pixel at the i-th row from the top and j-th column from the left is a_{ij}.\n\nPut a box around this image and output the result. The box should consist of # and have a thickness of 1.\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_{1W}\n:\na_{H1} ... a_{HW}\n\nOutput\n\nPrint the image surrounded by a box that consists of # and has a thickness of 1.\n\nSample Input 1\n\n2 3\nabc\narc\n\nSample Output 1\n\n#####\n#abc#\n#arc#\n#####\n\nSample Input 2\n\n1 1\nz\n\nSample Output 2\n\n###\n#z#\n###", "sample_input": "2 3\nabc\narc\n"}, "reference_outputs": ["#####\n#abc#\n#arc#\n#####\n"], "source_document_id": "p03712", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a image with a height of H pixels and a width of W pixels.\nEach pixel is represented by a lowercase English letter.\nThe pixel at the i-th row from the top and j-th column from the left is a_{ij}.\n\nPut a box around this image and output the result. The box should consist of # and have a thickness of 1.\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_{1W}\n:\na_{H1} ... a_{HW}\n\nOutput\n\nPrint the image surrounded by a box that consists of # and has a thickness of 1.\n\nSample Input 1\n\n2 3\nabc\narc\n\nSample Output 1\n\n#####\n#abc#\n#arc#\n#####\n\nSample Input 2\n\n1 1\nz\n\nSample Output 2\n\n###\n#z#\n###", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 325, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s592678019", "group_id": "codeNet:p03713", "input_text": "#!/usr/bin/perl -w\n\nwhile(<>) {\n ($h, $w) = split /\\s/, $_;\n}\n\nif($h % 3 == 0 || $w % 3 == 0) {\n print \"0\\n\";\n exit;\n}\n\n$m = 0;\nif($h % 2 == 0 && $w % 2 == 0) {\n if($h > $w) {\n $x = $h;\n $y = $w;\n } else {\n $x = $w;\n $y = $h;\n }\n $m = 1;\n} elsif($h % 2 == 0) {\n $x = $w;\n $y = $h;\n $m = 1;\n} elsif ($w % 2 == 0) {\n $x = $h;\n $y = $w;\n $m = 1;\n} elsif ($w % 3 == 1) {\n $x = $w;\n $y = $h;\n} else {\n $x = $h;\n $y = $w;\n}\n\nif($m == 1) {\n if($x % 3 == 1) {\n $l = sprintf(\"%d\", $x / 3) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * $y / 2;\n } elsif($x % 3 == 2) {\n $l = (sprintf(\"%d\", $x / 3) + 1) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * $y / 2;\n }\n print abs($l - $s), \"\\n\";\n} else {\n if($x % 3 == 1) {\n $l = sprintf(\"%d\", $x / 3) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * sprintf(\"%d\", $y / 2);\n } elsif($x % 3 == 2) {\n $l = (sprintf(\"%d\", $x / 3) + 1) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * sprintf(\"%d\", $y / 2);\n }\n print $l - $s, \"\\n\";\n}\n", "language": "Perl", "metadata": {"date": 1495333875, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03713.html", "problem_id": "p03713", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03713/input.txt", "sample_output_relpath": "derived/input_output/data/p03713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03713/Perl/s592678019.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s592678019", "user_id": "u669573977"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "#!/usr/bin/perl -w\n\nwhile(<>) {\n ($h, $w) = split /\\s/, $_;\n}\n\nif($h % 3 == 0 || $w % 3 == 0) {\n print \"0\\n\";\n exit;\n}\n\n$m = 0;\nif($h % 2 == 0 && $w % 2 == 0) {\n if($h > $w) {\n $x = $h;\n $y = $w;\n } else {\n $x = $w;\n $y = $h;\n }\n $m = 1;\n} elsif($h % 2 == 0) {\n $x = $w;\n $y = $h;\n $m = 1;\n} elsif ($w % 2 == 0) {\n $x = $h;\n $y = $w;\n $m = 1;\n} elsif ($w % 3 == 1) {\n $x = $w;\n $y = $h;\n} else {\n $x = $h;\n $y = $w;\n}\n\nif($m == 1) {\n if($x % 3 == 1) {\n $l = sprintf(\"%d\", $x / 3) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * $y / 2;\n } elsif($x % 3 == 2) {\n $l = (sprintf(\"%d\", $x / 3) + 1) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * $y / 2;\n }\n print abs($l - $s), \"\\n\";\n} else {\n if($x % 3 == 1) {\n $l = sprintf(\"%d\", $x / 3) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * sprintf(\"%d\", $y / 2);\n } elsif($x % 3 == 2) {\n $l = (sprintf(\"%d\", $x / 3) + 1) * $y;\n $s = (sprintf(\"%d\", $x / 3) * 2 + 1) * sprintf(\"%d\", $y / 2);\n }\n print $l - $s, \"\\n\";\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03713", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s266679669", "group_id": "codeNet:p03715", "input_text": "get~~m:g/\\d+/;say min |map({$_%3&&$_+>($_%%2)},$0,$1),$0+($1==$0)*+^$0/6", "language": "Perl", "metadata": {"date": 1538068000, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03715.html", "problem_id": "p03715", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03715/input.txt", "sample_output_relpath": "derived/input_output/data/p03715/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03715/Perl/s266679669.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s266679669", "user_id": "u283869437"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "get~~m:g/\\d+/;say min |map({$_%3&&$_+>($_%%2)},$0,$1),$0+($1==$0)*+^$0/6", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03715", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 169, "memory_kb": 54980}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s083568520", "group_id": "codeNet:p03715", "input_text": "($H,$W)=glob<>;\n$%=1e16;\nfor(1,2){\n\t$t=($H/3|0);\n\tfor($t-1,$t,$t+1){\n\t\tif($_>0){\n\t\t\t@_=sort{$a-$b}$_*$W,($H-$_)*($W>>1),($H-$_)*($W-($W>>1));\n\t\t\t$%-=$-=$%-($_[2]-$_[0]);\n\t\t\t@_=sort{$a-$b}$_*$W,($H-$_>>1)*$W,($H-$_-($H-$_>>1))*$W;\n\t\t\t$%-=$-=$%-($_[2]-$_[0]);\n\t\t}\n\t}\n\t($H,$W)=($W,$H);\n}\nprint$%,$/\n", "language": "Perl", "metadata": {"date": 1495329428, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03715.html", "problem_id": "p03715", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03715/input.txt", "sample_output_relpath": "derived/input_output/data/p03715/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03715/Perl/s083568520.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s083568520", "user_id": "u283869437"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "($H,$W)=glob<>;\n$%=1e16;\nfor(1,2){\n\t$t=($H/3|0);\n\tfor($t-1,$t,$t+1){\n\t\tif($_>0){\n\t\t\t@_=sort{$a-$b}$_*$W,($H-$_)*($W>>1),($H-$_)*($W-($W>>1));\n\t\t\t$%-=$-=$%-($_[2]-$_[0]);\n\t\t\t@_=sort{$a-$b}$_*$W,($H-$_>>1)*$W,($H-$_-($H-$_>>1))*$W;\n\t\t\t$%-=$-=$%-($_[2]-$_[0]);\n\t\t}\n\t}\n\t($H,$W)=($W,$H);\n}\nprint$%,$/\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03715", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 296, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s668785439", "group_id": "codeNet:p03716", "input_text": "$N=<>;\n$/=$\";\n$_.=$\".$%++for@a=<>;\n@s=sort{$b-$a}@a;\n\n$X=-inf;\nfor$m($N..2*$N){\n\t$x=0;\n\t$c=0;\n\tfor($i=0;$c<$N;++$i){\n\t\t$s[$i]=~$\";\n\t\tif($'<$m){\n\t\t\t$x+=$`;\n\t\t\t++$c;\n\t\t}\n\t}\n\t$c=0;\n\tfor($i=3*$N-1;$c<$N;--$i){\n\t\t$s[$i]=~$\";\n\t\tif($'>=$m){\n\t\t\t$x-=$`;\n\t\t\t++$c;\n\t\t}\n\t}\n\tif($x>$X){$X=$x;}\n}\nprint$X,v10\n", "language": "Perl", "metadata": {"date": 1495333857, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03716.html", "problem_id": "p03716", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03716/input.txt", "sample_output_relpath": "derived/input_output/data/p03716/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03716/Perl/s668785439.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s668785439", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "$N=<>;\n$/=$\";\n$_.=$\".$%++for@a=<>;\n@s=sort{$b-$a}@a;\n\n$X=-inf;\nfor$m($N..2*$N){\n\t$x=0;\n\t$c=0;\n\tfor($i=0;$c<$N;++$i){\n\t\t$s[$i]=~$\";\n\t\tif($'<$m){\n\t\t\t$x+=$`;\n\t\t\t++$c;\n\t\t}\n\t}\n\t$c=0;\n\tfor($i=3*$N-1;$c<$N;--$i){\n\t\t$s[$i]=~$\";\n\t\tif($'>=$m){\n\t\t\t$x-=$`;\n\t\t\t++$c;\n\t\t}\n\t}\n\tif($x>$X){$X=$x;}\n}\nprint$X,v10\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nLet N be a positive integer.\n\nThere is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}).\nSnuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements.\nHere, the score of a' is defined as follows: (the sum of the elements in the first half of a') - (the sum of the elements in the second half of a').\n\nFind the maximum possible score of a'.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nPartial Score\n\nIn the test set worth 300 points, N ≤ 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{3N}\n\nOutput\n\nPrint the maximum possible score of a'.\n\nSample Input 1\n\n2\n3 1 4 1 5 9\n\nSample Output 1\n\n1\n\nWhen a_2 and a_6 are removed, a' will be (3, 4, 1, 5), which has a score of (3 + 4) - (1 + 5) = 1.\n\nSample Input 2\n\n1\n1 2 3\n\nSample Output 2\n\n-1\n\nFor example, when a_1 are removed, a' will be (2, 3), which has a score of 2 - 3 = -1.\n\nSample Input 3\n\n3\n8 2 2 7 4 6 5 3 8\n\nSample Output 3\n\n5\n\nFor example, when a_2, a_3 and a_9 are removed, a' will be (8, 7, 4, 6, 5, 3), which has a score of (8 + 7 + 4) - (6 + 5 + 3) = 5.", "sample_input": "2\n3 1 4 1 5 9\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03716", "source_text": "Score : 500 points\n\nProblem Statement\n\nLet N be a positive integer.\n\nThere is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}).\nSnuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements.\nHere, the score of a' is defined as follows: (the sum of the elements in the first half of a') - (the sum of the elements in the second half of a').\n\nFind the maximum possible score of a'.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nPartial Score\n\nIn the test set worth 300 points, N ≤ 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{3N}\n\nOutput\n\nPrint the maximum possible score of a'.\n\nSample Input 1\n\n2\n3 1 4 1 5 9\n\nSample Output 1\n\n1\n\nWhen a_2 and a_6 are removed, a' will be (3, 4, 1, 5), which has a score of (3 + 4) - (1 + 5) = 1.\n\nSample Input 2\n\n1\n1 2 3\n\nSample Output 2\n\n-1\n\nFor example, when a_1 are removed, a' will be (2, 3), which has a score of 2 - 3 = -1.\n\nSample Input 3\n\n3\n8 2 2 7 4 6 5 3 8\n\nSample Output 3\n\n5\n\nFor example, when a_2, a_3 and a_9 are removed, a' will be (8, 7, 4, 6, 5, 3), which has a score of (8 + 7 + 4) - (6 + 5 + 3) = 5.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2108, "memory_kb": 82392}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s680747818", "group_id": "codeNet:p03719", "input_text": "chomp($n=<>);\n($a,$b,$c) = split/ /,$n;\nif($c>=$a && $c<=$b){\n\tprint \"Yes\";\n}else{\n\tprint \"No\";\n}\n", "language": "Perl", "metadata": {"date": 1569544923, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03719.html", "problem_id": "p03719", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03719/input.txt", "sample_output_relpath": "derived/input_output/data/p03719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03719/Perl/s680747818.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s680747818", "user_id": "u124498235"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "chomp($n=<>);\n($a,$b,$c) = split/ /,$n;\nif($c>=$a && $c<=$b){\n\tprint \"Yes\";\n}else{\n\tprint \"No\";\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "sample_input": "1 3 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03719", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 98, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s155434186", "group_id": "codeNet:p03719", "input_text": "get~~m:g/\\S+/;[$1>=$2>=$0].say", "language": "Perl", "metadata": {"date": 1528290597, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03719.html", "problem_id": "p03719", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03719/input.txt", "sample_output_relpath": "derived/input_output/data/p03719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03719/Perl/s155434186.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s155434186", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "get~~m:g/\\S+/;[$1>=$2>=$0].say", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "sample_input": "1 3 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03719", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 153, "memory_kb": 52860}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s130465038", "group_id": "codeNet:p03720", "input_text": "use strict;\nuse warnings;\n\nmy %road;\nmy ($n, $m);\n\nwhile(<>){\n\tchomp;\n\tunless($. == 1){\n\t\t($n, $m) = split(/ /);\n\t\t$road{$n}++;\n\t\t$road{$m}++;\n\t}\n}\n\nforeach my $key (sort {$a <=> $b} keys %road){\n\tprint \"$road{$key}\\n\";\n}\n\n", "language": "Perl", "metadata": {"date": 1565842018, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03720.html", "problem_id": "p03720", "resource_group": "low_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/Perl/s130465038.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s130465038", "user_id": "u609426052"}, "prompt_components": {"gold_output": "2\n2\n1\n1\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy %road;\nmy ($n, $m);\n\nwhile(<>){\n\tchomp;\n\tunless($. == 1){\n\t\t($n, $m) = split(/ /);\n\t\t$road{$n}++;\n\t\t$road{$m}++;\n\t}\n}\n\nforeach my $key (sort {$a <=> $b} keys %road){\n\tprint \"$road{$key}\\n\";\n}\n\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s408260695", "group_id": "codeNet:p03720", "input_text": "get;map *.value.say,(+<;\n \n($N, $K) = split(/ /, $input_string);\n \nmy @input_count = ();\n \nfor(my $i = 0; $i < $N; $i++){\n\tpush(@input_count, 0);\n}\n \nmy @array = ();\nfor(my $i = 0; $i <= $N; $i++){\n\t$array[$i] = 0;\n}\n\n\nmy $aa = 0;\nmy $bb = 0;\n\nuntil($input_count[-1] == 1){\n\tmy $row_ab = ;\n \n\tchomp($row_ab);\n\n\t($aa, $bb) = split(/ /, $row_ab);\n\n\t$array[$aa] += $bb;\n\t\n\t$input_count[$j] = 1;\n\t$j++;\n}\n\nmy $th = 0;\nmy $i = 0;\nfor($i = 1; $i <= $N; $i++){\n\t$th += $array[$i];\n\t\n\tif($th >= $K){\n\t\tlast;\n\t}\n}\n\nprint \"$i\\n\";", "language": "Perl", "metadata": {"date": 1494797225, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03721.html", "problem_id": "p03721", "resource_group": "low_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/Perl/s398649317.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s398649317", "user_id": "u494396162"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my $N = 0;\nmy $K = 0;\n \nmy $input_string = ;\n \n($N, $K) = split(/ /, $input_string);\n \nmy @input_count = ();\n \nfor(my $i = 0; $i < $N; $i++){\n\tpush(@input_count, 0);\n}\n \nmy @array = ();\nfor(my $i = 0; $i <= $N; $i++){\n\t$array[$i] = 0;\n}\n\n\nmy $aa = 0;\nmy $bb = 0;\n\nuntil($input_count[-1] == 1){\n\tmy $row_ab = ;\n \n\tchomp($row_ab);\n\n\t($aa, $bb) = split(/ /, $row_ab);\n\n\t$array[$aa] += $bb;\n\t\n\t$input_count[$j] = 1;\n\t$j++;\n}\n\nmy $th = 0;\nmy $i = 0;\nfor($i = 1; $i <= $N; $i++){\n\t$th += $array[$i];\n\t\n\tif($th >= $K){\n\t\tlast;\n\t}\n}\n\nprint \"$i\\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 553, "cpu_time_ms": 126, "memory_kb": 6912}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s642101551", "group_id": "codeNet:p03721", "input_text": "<>=~$\";$K=$';/ /,($i+=$')>=$K and$\\=$`.$/,last for sort{$a-$b}<>;print", "language": "Perl", "metadata": {"date": 1494724271, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03721.html", "problem_id": "p03721", "resource_group": "low_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/Perl/s642101551.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s642101551", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>=~$\";$K=$';/ /,($i+=$')>=$K and$\\=$`.$/,last for sort{$a-$b}<>;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 194, "memory_kb": 19200}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s564864890", "group_id": "codeNet:p03722", "input_text": "@s=(0,0,(-1e15)x<>);map{$s=$s[-2];/ .* /,$s[$&]+=$-=$s[$`]+$'-$s[$&]for@D}@D=<>;print$s<$s[-2]?inf:$s", "language": "Perl", "metadata": {"date": 1543658077, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03722.html", "problem_id": "p03722", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03722/input.txt", "sample_output_relpath": "derived/input_output/data/p03722/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03722/Perl/s564864890.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s564864890", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "@s=(0,0,(-1e15)x<>);map{$s=$s[-2];/ .* /,$s[$&]+=$-=$s[$`]+$'-$s[$&]for@D}@D=<>;print$s<$s[-2]?inf:$s", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a directed graph with N vertices and M edges.\nThe i-th edge (1≤i≤M) points from vertex a_i to vertex b_i, and has a weight c_i.\nWe will play the following single-player game using this graph and a piece.\n\nInitially, the piece is placed at vertex 1, and the score of the player is set to 0.\nThe player can move the piece as follows:\n\nWhen the piece is placed at vertex a_i, move the piece along the i-th edge to vertex b_i. After this move, the score of the player is increased by c_i.\n\nThe player can end the game only when the piece is placed at vertex N.\nThe given graph guarantees that it is possible to traverse from vertex 1 to vertex N.\n\nWhen the player acts optimally to maximize the score at the end of the game, what will the score be?\nIf it is possible to increase the score indefinitely, print inf.\n\nConstraints\n\n2≤N≤1000\n\n1≤M≤min(N(N-1),2000)\n\n1≤a_i,b_i≤N (1≤i≤M)\n\na_i≠b_i (1≤i≤M)\n\na_i≠a_j or b_i≠b_j (1≤i;\n$_=[glob]for@D;\nfor(2..2*(@s=(_,0,(-1e15)x$%))){\n\t$s[$$_[1]]+=$-=$s[$$_[0]]+$$_[2]-$s[$$_[1]]for@D;$_-$%or$s=$s[-2]\n}\nprint$s<$s[-2]?inf:$s\n", "language": "Perl", "metadata": {"date": 1494762148, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03722.html", "problem_id": "p03722", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03722/input.txt", "sample_output_relpath": "derived/input_output/data/p03722/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03722/Perl/s904016377.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s904016377", "user_id": "u283869437"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "($%,@D)=<>;\n$_=[glob]for@D;\nfor(2..2*(@s=(_,0,(-1e15)x$%))){\n\t$s[$$_[1]]+=$-=$s[$$_[0]]+$$_[2]-$s[$$_[1]]for@D;$_-$%or$s=$s[-2]\n}\nprint$s<$s[-2]?inf:$s\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a directed graph with N vertices and M edges.\nThe i-th edge (1≤i≤M) points from vertex a_i to vertex b_i, and has a weight c_i.\nWe will play the following single-player game using this graph and a piece.\n\nInitially, the piece is placed at vertex 1, and the score of the player is set to 0.\nThe player can move the piece as follows:\n\nWhen the piece is placed at vertex a_i, move the piece along the i-th edge to vertex b_i. After this move, the score of the player is increased by c_i.\n\nThe player can end the game only when the piece is placed at vertex N.\nThe given graph guarantees that it is possible to traverse from vertex 1 to vertex N.\n\nWhen the player acts optimally to maximize the score at the end of the game, what will the score be?\nIf it is possible to increase the score indefinitely, print inf.\n\nConstraints\n\n2≤N≤1000\n\n1≤M≤min(N(N-1),2000)\n\n1≤a_i,b_i≤N (1≤i≤M)\n\na_i≠b_i (1≤i≤M)\n\na_i≠a_j or b_i≠b_j (1≤i;\n$_=[split]for@D;\n@s=(_,0,(-1e15)x--$%);\nfor(1..2*$%){\n\tfor(@D){\n\t\t$s[$$_[1]]+=$-=$s[$$_[0]]+$$_[2]-$s[$$_[1]]\n\t}\n\t$_-$%or$s=$s[-1]\n}\nprint$s<$s[-1]?inf:$s\n", "language": "Perl", "metadata": {"date": 1494761514, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03722.html", "problem_id": "p03722", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03722/input.txt", "sample_output_relpath": "derived/input_output/data/p03722/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03722/Perl/s412057178.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s412057178", "user_id": "u283869437"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "($%,@D)=<>;\n$_=[split]for@D;\n@s=(_,0,(-1e15)x--$%);\nfor(1..2*$%){\n\tfor(@D){\n\t\t$s[$$_[1]]+=$-=$s[$$_[0]]+$$_[2]-$s[$$_[1]]\n\t}\n\t$_-$%or$s=$s[-1]\n}\nprint$s<$s[-1]?inf:$s\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a directed graph with N vertices and M edges.\nThe i-th edge (1≤i≤M) points from vertex a_i to vertex b_i, and has a weight c_i.\nWe will play the following single-player game using this graph and a piece.\n\nInitially, the piece is placed at vertex 1, and the score of the player is set to 0.\nThe player can move the piece as follows:\n\nWhen the piece is placed at vertex a_i, move the piece along the i-th edge to vertex b_i. After this move, the score of the player is increased by c_i.\n\nThe player can end the game only when the piece is placed at vertex N.\nThe given graph guarantees that it is possible to traverse from vertex 1 to vertex N.\n\nWhen the player acts optimally to maximize the score at the end of the game, what will the score be?\nIf it is possible to increase the score indefinitely, print inf.\n\nConstraints\n\n2≤N≤1000\n\n1≤M≤min(N(N-1),2000)\n\n1≤a_i,b_i≤N (1≤i≤M)\n\na_i≠b_i (1≤i≤M)\n\na_i≠a_j or b_i≠b_j (1≤i;print$=-=grep({!!grep$_%2*($_=$_+\"@a\">>1),@a}1..$=)||61", "language": "Perl", "metadata": {"date": 1579659142, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03723.html", "problem_id": "p03723", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03723/input.txt", "sample_output_relpath": "derived/input_output/data/p03723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03723/Perl/s747290008.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s747290008", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "@a=glob<>;print$=-=grep({!!grep$_%2*($_=$_+\"@a\">>1),@a}1..$=)||61", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:\n\nEach person simultaneously divides his cookies in half and gives one half to each of the other two persons.\n\nThis action will be repeated until there is a person with odd number of cookies in hand.\n\nHow many times will they repeat this action?\nNote that the answer may not be finite.\n\nConstraints\n\n1 ≤ A,B,C ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the number of times the action will be performed by the three people, if this number is finite.\nIf it is infinite, print -1 instead.\n\nSample Input 1\n\n4 12 20\n\nSample Output 1\n\n3\n\nInitially, Takahashi, Aoki and Snuke have 4, 12 and 20 cookies. Then,\n\nAfter the first action, they have 16, 12 and 8.\n\nAfter the second action, they have 10, 12 and 14.\n\nAfter the third action, they have 13, 12 and 11.\n\nNow, Takahashi and Snuke have odd number of cookies, and therefore the answer is 3.\n\nSample Input 2\n\n14 14 14\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n454 414 444\n\nSample Output 3\n\n1", "sample_input": "4 12 20\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03723", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:\n\nEach person simultaneously divides his cookies in half and gives one half to each of the other two persons.\n\nThis action will be repeated until there is a person with odd number of cookies in hand.\n\nHow many times will they repeat this action?\nNote that the answer may not be finite.\n\nConstraints\n\n1 ≤ A,B,C ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the number of times the action will be performed by the three people, if this number is finite.\nIf it is infinite, print -1 instead.\n\nSample Input 1\n\n4 12 20\n\nSample Output 1\n\n3\n\nInitially, Takahashi, Aoki and Snuke have 4, 12 and 20 cookies. Then,\n\nAfter the first action, they have 16, 12 and 8.\n\nAfter the second action, they have 10, 12 and 14.\n\nAfter the third action, they have 13, 12 and 11.\n\nNow, Takahashi and Snuke have odd number of cookies, and therefore the answer is 3.\n\nSample Input 2\n\n14 14 14\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n454 414 444\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s028757895", "group_id": "codeNet:p03723", "input_text": "($A,$B,$C)=glob<>;\n++$i,($A,$B,$C)=(($B+$C)/2,($C+$A)/2,($A+$B)/2)until$A&1|$B&1|$C&1|$i>60;\nprint$i<61?$i:-1\n", "language": "Perl", "metadata": {"date": 1514948126, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03723.html", "problem_id": "p03723", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03723/input.txt", "sample_output_relpath": "derived/input_output/data/p03723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03723/Perl/s028757895.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s028757895", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "($A,$B,$C)=glob<>;\n++$i,($A,$B,$C)=(($B+$C)/2,($C+$A)/2,($A+$B)/2)until$A&1|$B&1|$C&1|$i>60;\nprint$i<61?$i:-1\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:\n\nEach person simultaneously divides his cookies in half and gives one half to each of the other two persons.\n\nThis action will be repeated until there is a person with odd number of cookies in hand.\n\nHow many times will they repeat this action?\nNote that the answer may not be finite.\n\nConstraints\n\n1 ≤ A,B,C ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the number of times the action will be performed by the three people, if this number is finite.\nIf it is infinite, print -1 instead.\n\nSample Input 1\n\n4 12 20\n\nSample Output 1\n\n3\n\nInitially, Takahashi, Aoki and Snuke have 4, 12 and 20 cookies. Then,\n\nAfter the first action, they have 16, 12 and 8.\n\nAfter the second action, they have 10, 12 and 14.\n\nAfter the third action, they have 13, 12 and 11.\n\nNow, Takahashi and Snuke have odd number of cookies, and therefore the answer is 3.\n\nSample Input 2\n\n14 14 14\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n454 414 444\n\nSample Output 3\n\n1", "sample_input": "4 12 20\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03723", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:\n\nEach person simultaneously divides his cookies in half and gives one half to each of the other two persons.\n\nThis action will be repeated until there is a person with odd number of cookies in hand.\n\nHow many times will they repeat this action?\nNote that the answer may not be finite.\n\nConstraints\n\n1 ≤ A,B,C ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the number of times the action will be performed by the three people, if this number is finite.\nIf it is infinite, print -1 instead.\n\nSample Input 1\n\n4 12 20\n\nSample Output 1\n\n3\n\nInitially, Takahashi, Aoki and Snuke have 4, 12 and 20 cookies. Then,\n\nAfter the first action, they have 16, 12 and 8.\n\nAfter the second action, they have 10, 12 and 14.\n\nAfter the third action, they have 13, 12 and 11.\n\nNow, Takahashi and Snuke have odd number of cookies, and therefore the answer is 3.\n\nSample Input 2\n\n14 14 14\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n454 414 444\n\nSample Output 3\n\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s248186334", "group_id": "codeNet:p03724", "input_text": "<>;\n/ /,$_[$`]^=1,$_[$']^=1for<>;\nprint grep($_,@_)?NO:YES\n", "language": "Perl", "metadata": {"date": 1521700717, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03724.html", "problem_id": "p03724", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03724/input.txt", "sample_output_relpath": "derived/input_output/data/p03724/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03724/Perl/s248186334.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s248186334", "user_id": "u283869437"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "<>;\n/ /,$_[$`]^=1,$_[$']^=1for<>;\nprint grep($_,@_)?NO:YES\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi is not good at problems about trees in programming contests, and Aoki is helping him practice.\n\nFirst, Takahashi created a tree with N vertices numbered 1 through N, and wrote 0 at each edge.\n\nThen, Aoki gave him M queries. The i-th of them is as follows:\n\nIncrement the number written at each edge along the path connecting vertices a_i and b_i, by one.\n\nAfter Takahashi executed all of the queries, he told Aoki that, for every edge, the written number became an even number.\nHowever, Aoki forgot to confirm that the graph Takahashi created was actually a tree, and it is possible that Takahashi made a mistake in creating a tree or executing queries.\n\nDetermine whether there exists a tree that has the property mentioned by Takahashi.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ M ≤ 10^5\n\n1 ≤ a_i,b_i ≤ N\n\na_i ≠ b_i\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 YES if there exists a tree that has the property mentioned by Takahashi; print NO otherwise.\n\nSample Input 1\n\n4 4\n1 2\n2 4\n1 3\n3 4\n\nSample Output 1\n\nYES\n\nFor example, Takahashi's graph has the property mentioned by him if it has the following edges: 1-2, 1-3 and 1-4.\nIn this case, the number written at every edge will become 2.\n\nSample Input 2\n\n5 5\n1 2\n3 5\n5 1\n3 4\n2 3\n\nSample Output 2\n\nNO", "sample_input": "4 4\n1 2\n2 4\n1 3\n3 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03724", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi is not good at problems about trees in programming contests, and Aoki is helping him practice.\n\nFirst, Takahashi created a tree with N vertices numbered 1 through N, and wrote 0 at each edge.\n\nThen, Aoki gave him M queries. The i-th of them is as follows:\n\nIncrement the number written at each edge along the path connecting vertices a_i and b_i, by one.\n\nAfter Takahashi executed all of the queries, he told Aoki that, for every edge, the written number became an even number.\nHowever, Aoki forgot to confirm that the graph Takahashi created was actually a tree, and it is possible that Takahashi made a mistake in creating a tree or executing queries.\n\nDetermine whether there exists a tree that has the property mentioned by Takahashi.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ M ≤ 10^5\n\n1 ≤ a_i,b_i ≤ N\n\na_i ≠ b_i\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 YES if there exists a tree that has the property mentioned by Takahashi; print NO otherwise.\n\nSample Input 1\n\n4 4\n1 2\n2 4\n1 3\n3 4\n\nSample Output 1\n\nYES\n\nFor example, Takahashi's graph has the property mentioned by him if it has the following edges: 1-2, 1-3 and 1-4.\nIn this case, the number written at every edge will become 2.\n\nSample Input 2\n\n5 5\n1 2\n3 5\n5 1\n3 4\n2 3\n\nSample Output 2\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 59, "cpu_time_ms": 109, "memory_kb": 18304}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s747797301", "group_id": "codeNet:p03726", "input_text": "sub f{my($i,$p,$x)=@_;$x+=$_-$p&&f($_,$i)for@$i;$x>1?2:!$x}<>;map{push@$_,$_[--$|]for@_=glob}<>;print f(1)?First:Second", "language": "Perl", "metadata": {"date": 1554343954, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03726.html", "problem_id": "p03726", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03726/input.txt", "sample_output_relpath": "derived/input_output/data/p03726/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03726/Perl/s747797301.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s747797301", "user_id": "u283869437"}, "prompt_components": {"gold_output": "First\n", "input_to_evaluate": "sub f{my($i,$p,$x)=@_;$x+=$_-$p&&f($_,$i)for@$i;$x>1?2:!$x}<>;map{push@$_,$_[--$|]for@_=glob}<>;print f(1)?First:Second", "problem_context": "Score : 900 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\nInitially, each vertex is uncolored.\n\nTakahashi and Aoki is playing a game by painting the vertices. In this game, they alternately perform the following operation, starting from Takahashi:\n\nSelect a vertex that is not painted yet.\n\nIf it is Takahashi who is performing this operation, paint the vertex white; paint it black if it is Aoki.\n\nThen, after all the vertices are colored, the following procedure takes place:\n\nRepaint every white vertex that is adjacent to a black vertex, in black.\n\nNote that all such white vertices are repainted simultaneously, not one at a time.\n\nIf there are still one or more white vertices remaining, Takahashi wins; if all the vertices are now black, Aoki wins.\nDetermine the winner of the game, assuming that both persons play optimally.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i,b_i ≤ N\n\na_i ≠ b_i\n\nThe input 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\nPrint First if Takahashi wins; print Second if Aoki wins.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\nFirst\n\nBelow is a possible progress of the game:\n\nFirst, Takahashi paint vertex 2 white.\n\nThen, Aoki paint vertex 1 black.\n\nLastly, Takahashi paint vertex 3 white.\n\nIn this case, the colors of vertices 1, 2 and 3 after the final procedure are black, black and white, resulting in Takahashi's victory.\n\nSample Input 2\n\n4\n1 2\n2 3\n2 4\n\nSample Output 2\n\nFirst\n\nSample Input 3\n\n6\n1 2\n2 3\n3 4\n2 5\n5 6\n\nSample Output 3\n\nSecond", "sample_input": "3\n1 2\n2 3\n"}, "reference_outputs": ["First\n"], "source_document_id": "p03726", "source_text": "Score : 900 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\nInitially, each vertex is uncolored.\n\nTakahashi and Aoki is playing a game by painting the vertices. In this game, they alternately perform the following operation, starting from Takahashi:\n\nSelect a vertex that is not painted yet.\n\nIf it is Takahashi who is performing this operation, paint the vertex white; paint it black if it is Aoki.\n\nThen, after all the vertices are colored, the following procedure takes place:\n\nRepaint every white vertex that is adjacent to a black vertex, in black.\n\nNote that all such white vertices are repainted simultaneously, not one at a time.\n\nIf there are still one or more white vertices remaining, Takahashi wins; if all the vertices are now black, Aoki wins.\nDetermine the winner of the game, assuming that both persons play optimally.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i,b_i ≤ N\n\na_i ≠ b_i\n\nThe input 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\nPrint First if Takahashi wins; print Second if Aoki wins.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\nFirst\n\nBelow is a possible progress of the game:\n\nFirst, Takahashi paint vertex 2 white.\n\nThen, Aoki paint vertex 1 black.\n\nLastly, Takahashi paint vertex 3 white.\n\nIn this case, the colors of vertices 1, 2 and 3 after the final procedure are black, black and white, resulting in Takahashi's victory.\n\nSample Input 2\n\n4\n1 2\n2 3\n2 4\n\nSample Output 2\n\nFirst\n\nSample Input 3\n\n6\n1 2\n2 3\n3 4\n2 5\n5 6\n\nSample Output 3\n\nSecond", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1469, "memory_kb": 82944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s893706075", "group_id": "codeNet:p03729", "input_text": "$l=<>;print($l=~/^[^ ]*(.) \\1/&&$l=~/(.) \\1[^ ]*$/)?\"YES\":\"NO\"", "language": "Perl", "metadata": {"date": 1568950487, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03729.html", "problem_id": "p03729", "resource_group": "low_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/Perl/s893706075.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s893706075", "user_id": "u926866194"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "$l=<>;print($l=~/^[^ ]*(.) \\1/&&$l=~/(.) \\1[^ ]*$/)?\"YES\":\"NO\"", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s773088819", "group_id": "codeNet:p03729", "input_text": "chomp($l=<>);printf\"%s\\n\",($l=~/^[^ ]*(.) \\1/&&$l=~/(.) \\1[^ ]*$/)?\"YES\":\"NO\"", "language": "Perl", "metadata": {"date": 1568950237, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03729.html", "problem_id": "p03729", "resource_group": "low_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/Perl/s773088819.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s773088819", "user_id": "u926866194"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "chomp($l=<>);printf\"%s\\n\",($l=~/^[^ ]*(.) \\1/&&$l=~/(.) \\1[^ ]*$/)?\"YES\":\"NO\"", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 77, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s967034871", "group_id": "codeNet:p03729", "input_text": "/(.) (.)(??{$a+=$1 eq$2})/ for<>;print$a>1?YES:NO", "language": "Perl", "metadata": {"date": 1528286971, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03729.html", "problem_id": "p03729", "resource_group": "low_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/Perl/s967034871.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s967034871", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "/(.) (.)(??{$a+=$1 eq$2})/ for<>;print$a>1?YES:NO", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 49, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s124628678", "group_id": "codeNet:p03730", "input_text": "#!/usr/bin/perl\n\nsub main() {\n my($A,$B,$C)=split(/ /,<>);\n chomp($C);\n my $ans = prob($A,$B,$C);\n print $ans;\n}\n\nsub prob() {\n my($A,$B,$C) = @_;\n for my $i(1..$A){\n my $tmp = $B * $i + $C;\n if($tmp%$A == 0){\n return \"YES\";\n }\n }\n return \"NO\";\n}\n\n&main();", "language": "Perl", "metadata": {"date": 1567298252, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03730.html", "problem_id": "p03730", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03730/input.txt", "sample_output_relpath": "derived/input_output/data/p03730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03730/Perl/s124628678.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s124628678", "user_id": "u555298461"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "#!/usr/bin/perl\n\nsub main() {\n my($A,$B,$C)=split(/ /,<>);\n chomp($C);\n my $ans = prob($A,$B,$C);\n print $ans;\n}\n\nsub prob() {\n my($A,$B,$C) = @_;\n for my $i(1..$A){\n my $tmp = $B * $i + $C;\n if($tmp%$A == 0){\n return \"YES\";\n }\n }\n return \"NO\";\n}\n\n&main();", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe ask you to select some number of positive integers, and calculate the sum of them.\n\nIt is allowed to select as many integers as you like, and as large integers as you wish.\nYou have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.\n\nYour objective is to make the sum congruent to C modulo B.\nDetermine whether this is possible.\n\nIf the objective is achievable, print YES. Otherwise, print NO.\n\nConstraints\n\n1 ≤ A ≤ 100\n\n1 ≤ B ≤ 100\n\n0 ≤ C < B\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\n7 5 1\n\nSample Output 1\n\nYES\n\nFor example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.\n\nSample Input 2\n\n2 2 1\n\nSample Output 2\n\nNO\n\nThe sum of even numbers, no matter how many, is never odd.\n\nSample Input 3\n\n1 100 97\n\nSample Output 3\n\nYES\n\nYou can select 97, since you may select multiples of 1, that is, all integers.\n\nSample Input 4\n\n40 98 58\n\nSample Output 4\n\nYES\n\nSample Input 5\n\n77 42 36\n\nSample Output 5\n\nNO", "sample_input": "7 5 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03730", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe ask you to select some number of positive integers, and calculate the sum of them.\n\nIt is allowed to select as many integers as you like, and as large integers as you wish.\nYou have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.\n\nYour objective is to make the sum congruent to C modulo B.\nDetermine whether this is possible.\n\nIf the objective is achievable, print YES. Otherwise, print NO.\n\nConstraints\n\n1 ≤ A ≤ 100\n\n1 ≤ B ≤ 100\n\n0 ≤ C < B\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\n7 5 1\n\nSample Output 1\n\nYES\n\nFor example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.\n\nSample Input 2\n\n2 2 1\n\nSample Output 2\n\nNO\n\nThe sum of even numbers, no matter how many, is never odd.\n\nSample Input 3\n\n1 100 97\n\nSample Output 3\n\nYES\n\nYou can select 97, since you may select multiples of 1, that is, all integers.\n\nSample Input 4\n\n40 98 58\n\nSample Output 4\n\nYES\n\nSample Input 5\n\n77 42 36\n\nSample Output 5\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s955704747", "group_id": "codeNet:p03731", "input_text": "<>=~$\";$\\+=$_-$%<$'&&$_?$_-$%:$',$%=$_ for glob<>;print", "language": "Perl", "metadata": {"date": 1571757342, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03731.html", "problem_id": "p03731", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03731/input.txt", "sample_output_relpath": "derived/input_output/data/p03731/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03731/Perl/s955704747.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s955704747", "user_id": "u843175622"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "<>=~$\";$\\+=$_-$%<$'&&$_?$_-$%:$',$%=$_ for glob<>;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn a public bath, there is a shower which emits water for T seconds when the switch is pushed.\n\nIf the switch is pushed when the shower is already emitting water, from that moment it will be emitting water for T seconds.\nNote that it does not mean that the shower emits water for T additional seconds.\n\nN people will push the switch while passing by the shower.\nThe i-th person will push the switch t_i seconds after the first person pushes it.\n\nHow long will the shower emit water in total?\n\nConstraints\n\n1 ≤ N ≤ 200,000\n\n1 ≤ T ≤ 10^9\n\n0 = t_1 < t_2 < t_3 < , ..., < t_{N-1} < t_N ≤ 10^9\n\nT and each t_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nt_1 t_2 ... t_N\n\nOutput\n\nAssume that the shower will emit water for a total of X seconds. Print X.\n\nSample Input 1\n\n2 4\n0 3\n\nSample Output 1\n\n7\n\nThree seconds after the first person pushes the water, the switch is pushed again and the shower emits water for four more seconds, for a total of seven seconds.\n\nSample Input 2\n\n2 4\n0 5\n\nSample Output 2\n\n8\n\nOne second after the shower stops emission of water triggered by the first person, the switch is pushed again.\n\nSample Input 3\n\n4 1000000000\n0 1000 1000000 1000000000\n\nSample Output 3\n\n2000000000\n\nSample Input 4\n\n1 1\n0\n\nSample Output 4\n\n1\n\nSample Input 5\n\n9 10\n0 3 5 7 100 110 200 300 311\n\nSample Output 5\n\n67", "sample_input": "2 4\n0 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03731", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn a public bath, there is a shower which emits water for T seconds when the switch is pushed.\n\nIf the switch is pushed when the shower is already emitting water, from that moment it will be emitting water for T seconds.\nNote that it does not mean that the shower emits water for T additional seconds.\n\nN people will push the switch while passing by the shower.\nThe i-th person will push the switch t_i seconds after the first person pushes it.\n\nHow long will the shower emit water in total?\n\nConstraints\n\n1 ≤ N ≤ 200,000\n\n1 ≤ T ≤ 10^9\n\n0 = t_1 < t_2 < t_3 < , ..., < t_{N-1} < t_N ≤ 10^9\n\nT and each t_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nt_1 t_2 ... t_N\n\nOutput\n\nAssume that the shower will emit water for a total of X seconds. Print X.\n\nSample Input 1\n\n2 4\n0 3\n\nSample Output 1\n\n7\n\nThree seconds after the first person pushes the water, the switch is pushed again and the shower emits water for four more seconds, for a total of seven seconds.\n\nSample Input 2\n\n2 4\n0 5\n\nSample Output 2\n\n8\n\nOne second after the shower stops emission of water triggered by the first person, the switch is pushed again.\n\nSample Input 3\n\n4 1000000000\n0 1000 1000000 1000000000\n\nSample Output 3\n\n2000000000\n\nSample Input 4\n\n1 1\n0\n\nSample Output 4\n\n1\n\nSample Input 5\n\n9 10\n0 3 5 7 100 110 200 300 311\n\nSample Output 5\n\n67", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 55, "cpu_time_ms": 622, "memory_kb": 42284}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s158311615", "group_id": "codeNet:p03733", "input_text": "<>=~$\";$\\+=$'-($--=$_),$-=$_+$' for glob<>;print", "language": "Perl", "metadata": {"date": 1550969869, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03733.html", "problem_id": "p03733", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03733/input.txt", "sample_output_relpath": "derived/input_output/data/p03733/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03733/Perl/s158311615.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s158311615", "user_id": "u019489252"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "<>=~$\";$\\+=$'-($--=$_),$-=$_+$' for glob<>;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn a public bath, there is a shower which emits water for T seconds when the switch is pushed.\n\nIf the switch is pushed when the shower is already emitting water, from that moment it will be emitting water for T seconds.\nNote that it does not mean that the shower emits water for T additional seconds.\n\nN people will push the switch while passing by the shower.\nThe i-th person will push the switch t_i seconds after the first person pushes it.\n\nHow long will the shower emit water in total?\n\nConstraints\n\n1 ≤ N ≤ 200,000\n\n1 ≤ T ≤ 10^9\n\n0 = t_1 < t_2 < t_3 < , ..., < t_{N-1} < t_N ≤ 10^9\n\nT and each t_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nt_1 t_2 ... t_N\n\nOutput\n\nAssume that the shower will emit water for a total of X seconds. Print X.\n\nSample Input 1\n\n2 4\n0 3\n\nSample Output 1\n\n7\n\nThree seconds after the first person pushes the water, the switch is pushed again and the shower emits water for four more seconds, for a total of seven seconds.\n\nSample Input 2\n\n2 4\n0 5\n\nSample Output 2\n\n8\n\nOne second after the shower stops emission of water triggered by the first person, the switch is pushed again.\n\nSample Input 3\n\n4 1000000000\n0 1000 1000000 1000000000\n\nSample Output 3\n\n2000000000\n\nSample Input 4\n\n1 1\n0\n\nSample Output 4\n\n1\n\nSample Input 5\n\n9 10\n0 3 5 7 100 110 200 300 311\n\nSample Output 5\n\n67", "sample_input": "2 4\n0 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03733", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn a public bath, there is a shower which emits water for T seconds when the switch is pushed.\n\nIf the switch is pushed when the shower is already emitting water, from that moment it will be emitting water for T seconds.\nNote that it does not mean that the shower emits water for T additional seconds.\n\nN people will push the switch while passing by the shower.\nThe i-th person will push the switch t_i seconds after the first person pushes it.\n\nHow long will the shower emit water in total?\n\nConstraints\n\n1 ≤ N ≤ 200,000\n\n1 ≤ T ≤ 10^9\n\n0 = t_1 < t_2 < t_3 < , ..., < t_{N-1} < t_N ≤ 10^9\n\nT and each t_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nt_1 t_2 ... t_N\n\nOutput\n\nAssume that the shower will emit water for a total of X seconds. Print X.\n\nSample Input 1\n\n2 4\n0 3\n\nSample Output 1\n\n7\n\nThree seconds after the first person pushes the water, the switch is pushed again and the shower emits water for four more seconds, for a total of seven seconds.\n\nSample Input 2\n\n2 4\n0 5\n\nSample Output 2\n\n8\n\nOne second after the shower stops emission of water triggered by the first person, the switch is pushed again.\n\nSample Input 3\n\n4 1000000000\n0 1000 1000000 1000000000\n\nSample Output 3\n\n2000000000\n\nSample Input 4\n\n1 1\n0\n\nSample Output 4\n\n1\n\nSample Input 5\n\n9 10\n0 3 5 7 100 110 200 300 311\n\nSample Output 5\n\n67", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 48, "cpu_time_ms": 722, "memory_kb": 42284}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s006153707", "group_id": "codeNet:p03734", "input_text": "$%{$'}=<>!~$\";//,%E=%%,map$\\+=$-=($%{$_}+=$-=$E{$_}+$'-$%{$_-=$`})*!/-/-$\\,keys%%for<>;print", "language": "Perl", "metadata": {"date": 1578655524, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03734.html", "problem_id": "p03734", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03734/input.txt", "sample_output_relpath": "derived/input_output/data/p03734/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03734/Perl/s006153707.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s006153707", "user_id": "u657913472"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "$%{$'}=<>!~$\";//,%E=%%,map$\\+=$-=($%{$_}+=$-=$E{$_}+$'-$%{$_-=$`})*!/-/-$\\,keys%%for<>;print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\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 total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "sample_input": "4 6\n2 1\n3 4\n4 10\n3 4\n"}, "reference_outputs": ["11\n"], "source_document_id": "p03734", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\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 total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 92, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s840824479", "group_id": "codeNet:p03734", "input_text": "$D{<>=~$\"*$'}=0;/ /,map{($a=$D{$_}+$')<$D{$i=$_-$`}|$i<0or$%+=$-=($D{$i}=$a)-$%}keys%D for<>;print$%", "language": "Perl", "metadata": {"date": 1578654967, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03734.html", "problem_id": "p03734", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03734/input.txt", "sample_output_relpath": "derived/input_output/data/p03734/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03734/Perl/s840824479.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s840824479", "user_id": "u657913472"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "$D{<>=~$\"*$'}=0;/ /,map{($a=$D{$_}+$')<$D{$i=$_-$`}|$i<0or$%+=$-=($D{$i}=$a)-$%}keys%D for<>;print$%", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\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 total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "sample_input": "4 6\n2 1\n3 4\n4 10\n3 4\n"}, "reference_outputs": ["11\n"], "source_document_id": "p03734", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\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 total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 100, "cpu_time_ms": 91, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s528869261", "group_id": "codeNet:p03738", "input_text": "@s=split//,<>;@t=split//,<>;\n@a=(LESS,GREATER,EQUAL);\nif(@s!=@t){\n\tprint$a[@s>@t];\n}\nelse{\n\t$f=$a[2];\n\tfor(0..@s-1){\n\t\tif($s[$_]+0!=0+$t[$_]){\n\t\t\t$f=$a[$s[$_]+0>0+$t[$_]];\n\t\t\tbreak;\n\t\t}\n\t}\n\tprint$f\n}\n", "language": "Perl", "metadata": {"date": 1534993929, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03738.html", "problem_id": "p03738", "resource_group": "low_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/Perl/s528869261.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s528869261", "user_id": "u657913472"}, "prompt_components": {"gold_output": "GREATER\n", "input_to_evaluate": "@s=split//,<>;@t=split//,<>;\n@a=(LESS,GREATER,EQUAL);\nif(@s!=@t){\n\tprint$a[@s>@t];\n}\nelse{\n\t$f=$a[2];\n\tfor(0..@s-1){\n\t\tif($s[$_]+0!=0+$t[$_]){\n\t\t\t$f=$a[$s[$_]+0>0+$t[$_]];\n\t\t\tbreak;\n\t\t}\n\t}\n\tprint$f\n}\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s041788426", "group_id": "codeNet:p03741", "input_text": "<>;for(glob<>){\n\t//;\n\t$$_+=$',${;uc}+=$-=1-($%=2*--$|-1)*$$_,$-and$$_=$%for a..c\n}\nprint$A<$B?$A:$B", "language": "Perl", "metadata": {"date": 1492919528, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03741.html", "problem_id": "p03741", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03741/input.txt", "sample_output_relpath": "derived/input_output/data/p03741/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03741/Perl/s041788426.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s041788426", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "<>;for(glob<>){\n\t//;\n\t$$_+=$',${;uc}+=$-=1-($%=2*--$|-1)*$$_,$-and$$_=$%for a..c\n}\nprint$A<$B?$A:$B", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_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 minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "sample_input": "4\n1 -3 1 0\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03741", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_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 minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 755, "memory_kb": 19180}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s205190460", "group_id": "codeNet:p03741", "input_text": "<>;\n@a=glob<>;\nfor$a(@a){\n\t$x+=$a;\n\t$y+=$a;\n\tif(--$|){\n\t\tif($x<=0){\n\t\t\t$X+=1-$x;\n\t\t\t$x=1;\n\t\t}\n\t\tif($y>=0){\n\t\t\t$Y+=1+$y;\n\t\t\t$y=-1;\n\t\t}\n\t}else{\n\t\tif($x>=0){\n\t\t\t$X+=1+$x;\n\t\t\t$x=-1;\n\t\t}\n\t\tif($y<=0){\n\t\t\t$Y+=1-$y;\n\t\t\t$y=1;\n\t\t}\n\t}\n}\nprint$X<$Y?$X+0:$Y+0,$/\n", "language": "Perl", "metadata": {"date": 1492910988, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03741.html", "problem_id": "p03741", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03741/input.txt", "sample_output_relpath": "derived/input_output/data/p03741/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03741/Perl/s205190460.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s205190460", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "<>;\n@a=glob<>;\nfor$a(@a){\n\t$x+=$a;\n\t$y+=$a;\n\tif(--$|){\n\t\tif($x<=0){\n\t\t\t$X+=1-$x;\n\t\t\t$x=1;\n\t\t}\n\t\tif($y>=0){\n\t\t\t$Y+=1+$y;\n\t\t\t$y=-1;\n\t\t}\n\t}else{\n\t\tif($x>=0){\n\t\t\t$X+=1+$x;\n\t\t\t$x=-1;\n\t\t}\n\t\tif($y<=0){\n\t\t\t$Y+=1-$y;\n\t\t\t$y=1;\n\t\t}\n\t}\n}\nprint$X<$Y?$X+0:$Y+0,$/\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_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 minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "sample_input": "4\n1 -3 1 0\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03741", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_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 minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 311, "memory_kb": 27008}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s551207078", "group_id": "codeNet:p03742", "input_text": "[2>abs([-] get.words)].say", "language": "Perl", "metadata": {"date": 1532570772, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03742.html", "problem_id": "p03742", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03742/input.txt", "sample_output_relpath": "derived/input_output/data/p03742/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03742/Perl/s551207078.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s551207078", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Brown\n", "input_to_evaluate": "[2>abs([-] get.words)].say", "problem_context": "Score : 500 points\n\nProblem Statement\n\nAlice and Brown loves games. Today, they will play the following game.\n\nIn this game, there are two piles initially consisting of X and Y stones, respectively.\nAlice and Bob alternately perform the following operation, starting from Alice:\n\nTake 2i stones from one of the piles. Then, throw away i of them, and put the remaining i in the other pile. Here, the integer i (1≤i) can be freely chosen as long as there is a sufficient number of stones in the pile.\n\nThe player who becomes unable to perform the operation, loses the game.\n\nGiven X and Y, determine the winner of the game, assuming that both players play optimally.\n\nConstraints\n\n0 ≤ X, Y ≤ 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the winner: either Alice or Brown.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\nBrown\n\nAlice can do nothing but taking two stones from the pile containing two stones. As a result, the piles consist of zero and two stones, respectively. Then, Brown will take the two stones, and the piles will consist of one and zero stones, respectively. Alice will be unable to perform the operation anymore, which means Brown's victory.\n\nSample Input 2\n\n5 0\n\nSample Output 2\n\nAlice\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\nBrown\n\nSample Input 4\n\n4 8\n\nSample Output 4\n\nAlice", "sample_input": "2 1\n"}, "reference_outputs": ["Brown\n"], "source_document_id": "p03742", "source_text": "Score : 500 points\n\nProblem Statement\n\nAlice and Brown loves games. Today, they will play the following game.\n\nIn this game, there are two piles initially consisting of X and Y stones, respectively.\nAlice and Bob alternately perform the following operation, starting from Alice:\n\nTake 2i stones from one of the piles. Then, throw away i of them, and put the remaining i in the other pile. Here, the integer i (1≤i) can be freely chosen as long as there is a sufficient number of stones in the pile.\n\nThe player who becomes unable to perform the operation, loses the game.\n\nGiven X and Y, determine the winner of the game, assuming that both players play optimally.\n\nConstraints\n\n0 ≤ X, Y ≤ 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the winner: either Alice or Brown.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\nBrown\n\nAlice can do nothing but taking two stones from the pile containing two stones. As a result, the piles consist of zero and two stones, respectively. Then, Brown will take the two stones, and the piles will consist of one and zero stones, respectively. Alice will be unable to perform the operation anymore, which means Brown's victory.\n\nSample Input 2\n\n5 0\n\nSample Output 2\n\nAlice\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\nBrown\n\nSample Input 4\n\n4 8\n\nSample Output 4\n\nAlice", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 288, "memory_kb": 62964}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s793593183", "group_id": "codeNet:p03745", "input_text": "$n = <>;\n@A = split / /, <>;\n\n$base = shift @A;\n$flg = 0;\n$count = 1;\n\nfor my $a (@A) {\n next if $base == $a;\n\n if ($a > $base ) {\n if ($flg == -1) {\n $count++;\n $flg = 0;\n }\n else {\n $flg = 1;\n }\n }\n else {\n if ($flg == 1) {\n $count++;\n $flg = 0;\n }\n else {\n $flg = -1;\n }\n }\n\n $base = $a;\n}\n\nprint $count;\n", "language": "Perl", "metadata": {"date": 1527808792, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03745.html", "problem_id": "p03745", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03745/input.txt", "sample_output_relpath": "derived/input_output/data/p03745/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03745/Perl/s793593183.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s793593183", "user_id": "u698551366"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$n = <>;\n@A = split / /, <>;\n\n$base = shift @A;\n$flg = 0;\n$count = 1;\n\nfor my $a (@A) {\n next if $base == $a;\n\n if ($a > $base ) {\n if ($flg == -1) {\n $count++;\n $flg = 0;\n }\n else {\n $flg = 1;\n }\n }\n else {\n if ($flg == 1) {\n $count++;\n $flg = 0;\n }\n else {\n $flg = -1;\n }\n }\n\n $base = $a;\n}\n\nprint $count;\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an array A of length N.\nYour task is to divide it into several contiguous subarrays.\nHere, all subarrays obtained must be sorted in either non-decreasing or non-increasing order.\nAt least how many subarrays do you need to divide A into?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nEach A_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 minimum possible number of subarrays after division of A.\n\nSample Input 1\n\n6\n1 2 3 2 2 1\n\nSample Output 1\n\n2\n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\nSample Input 2\n\n9\n1 2 1 2 1 2 1 2 1\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1 2 3 2 1 999999999 1000000000\n\nSample Output 3\n\n3", "sample_input": "6\n1 2 3 2 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03745", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an array A of length N.\nYour task is to divide it into several contiguous subarrays.\nHere, all subarrays obtained must be sorted in either non-decreasing or non-increasing order.\nAt least how many subarrays do you need to divide A into?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nEach A_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 minimum possible number of subarrays after division of A.\n\nSample Input 1\n\n6\n1 2 3 2 2 1\n\nSample Output 1\n\n2\n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\nSample Input 2\n\n9\n1 2 1 2 1 2 1 2 1\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1 2 3 2 1 999999999 1000000000\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 59, "memory_kb": 11724}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s859927870", "group_id": "codeNet:p03746", "input_text": "($n, $m) = split / /, <>;\n\nmy $key;\nmy @base = split / /, <>;\n\nfor (1..$m-1) {\n @vers = split / /,<>;\n\n for my $index (0,1) {\n my $match_index = grep { $base[$_] == $vers[$index] } (0,1);\n if (defined $match_index) {\n print $vers[1-$index] . \" \" . $vers[$index] . \" \" . $base[1-$match_index];\n exit;\n }\n }\n}\n", "language": "Perl", "metadata": {"date": 1527810394, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03746.html", "problem_id": "p03746", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03746/input.txt", "sample_output_relpath": "derived/input_output/data/p03746/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03746/Perl/s859927870.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s859927870", "user_id": "u698551366"}, "prompt_components": {"gold_output": "4\n2 3 1 4\n", "input_to_evaluate": "($n, $m) = split / /, <>;\n\nmy $key;\nmy @base = split / /, <>;\n\nfor (1..$m-1) {\n @vers = split / /,<>;\n\n for my $index (0,1) {\n my $match_index = grep { $base[$_] == $vers[$index] } (0,1);\n if (defined $match_index) {\n print $vers[1-$index] . \" \" . $vers[$index] . \" \" . $base[1-$match_index];\n exit;\n }\n }\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a connected undirected simple graph, which has N vertices and M edges.\nThe vertices are numbered 1 through N, and the edges are numbered 1 through M.\nEdge i connects vertices A_i and B_i.\nYour task is to find a path that satisfies the following conditions:\n\nThe path traverses two or more vertices.\n\nThe path does not traverse the same vertex more than once.\n\nA vertex directly connected to at least one of the endpoints of the path, is always contained in the path.\n\nIt can be proved that such a path always exists.\nAlso, if there are more than one solution, any of them will be accepted.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nThe given graph is connected and simple (that is, for every pair of vertices, there is at most one edge that directly connects them).\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\nFind one path that satisfies the conditions, and print it in the following format.\nIn the first line, print the count of the vertices contained in the path.\nIn the second line, print a space-separated list of the indices of the vertices, in order of appearance in the path.\n\nSample Input 1\n\n5 6\n1 3\n1 4\n2 3\n1 5\n3 5\n2 4\n\nSample Output 1\n\n4\n2 3 1 4\n\nThere are two vertices directly connected to vertex 2: vertices 3 and 4.\nThere are also two vertices directly connected to vertex 4: vertices 1 and 2.\nHence, the path 2 → 3 → 1 → 4 satisfies the conditions.\n\nSample Input 2\n\n7 8\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n3 5\n2 6\n\nSample Output 2\n\n7\n1 2 3 4 5 6 7", "sample_input": "5 6\n1 3\n1 4\n2 3\n1 5\n3 5\n2 4\n"}, "reference_outputs": ["4\n2 3 1 4\n"], "source_document_id": "p03746", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a connected undirected simple graph, which has N vertices and M edges.\nThe vertices are numbered 1 through N, and the edges are numbered 1 through M.\nEdge i connects vertices A_i and B_i.\nYour task is to find a path that satisfies the following conditions:\n\nThe path traverses two or more vertices.\n\nThe path does not traverse the same vertex more than once.\n\nA vertex directly connected to at least one of the endpoints of the path, is always contained in the path.\n\nIt can be proved that such a path always exists.\nAlso, if there are more than one solution, any of them will be accepted.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nThe given graph is connected and simple (that is, for every pair of vertices, there is at most one edge that directly connects them).\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\nFind one path that satisfies the conditions, and print it in the following format.\nIn the first line, print the count of the vertices contained in the path.\nIn the second line, print a space-separated list of the indices of the vertices, in order of appearance in the path.\n\nSample Input 1\n\n5 6\n1 3\n1 4\n2 3\n1 5\n3 5\n2 4\n\nSample Output 1\n\n4\n2 3 1 4\n\nThere are two vertices directly connected to vertex 2: vertices 3 and 4.\nThere are also two vertices directly connected to vertex 4: vertices 1 and 2.\nHence, the path 2 → 3 → 1 → 4 satisfies the conditions.\n\nSample Input 2\n\n7 8\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n3 5\n2 6\n\nSample Output 2\n\n7\n1 2 3 4 5 6 7", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 360, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s096363591", "group_id": "codeNet:p03751", "input_text": "put +($/=|lines).grep({TR/?/z/lt$/[*-1]})..^+$/.grep({TR/?/a/le$/[*-1]})", "language": "Perl", "metadata": {"date": 1598495258, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03751.html", "problem_id": "p03751", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03751/input.txt", "sample_output_relpath": "derived/input_output/data/p03751/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03751/Perl/s096363591.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s096363591", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "put +($/=|lines).grep({TR/?/z/lt$/[*-1]})..^+$/.grep({TR/?/a/le$/[*-1]})", "problem_context": "Max Score: 250 Points\n\nProblem Statement\n\nMr.X, who the handle name is T, looked at the list which written N handle names, S_1, S_2, ..., S_N.\n\nBut he couldn't see some parts of the list. Invisible part is denoted ?.\n\nPlease calculate all possible index of the handle name of Mr.X when you sort N+1 handle names (S_1, S_2, ..., S_N and T) in lexicographical order.\n\nNote: If there are pair of people with same handle name, either one may come first.\n\nInput\n\nThe input is given from standard input in the following format.\n\nN\nS_1\nS_2\n:\nS_N\nT\n\nOutput\n\nCalculate the possible index and print in sorted order. The output should be separated with a space. Don't print a space after last number.\n\nPut a line break in the end.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n1 ≤ |S_i|, |T| ≤ 20 (|A| is the length of A.)\n\nS_i consists from lower-case alphabet and ?.\n\nT consists from lower-case alphabet.\n\nScoring\n\nSubtask 1 [ 130 points ]\n\nThere are no ?'s.\n\nSubtask 2 [ 120 points ]\n\nThere are no additional constraints.\n\nSample Input 1\n\n2\ntourist\npetr\ne\n\nSample Output 1\n\n1\n\nThere are no invisible part, so there are only one possibility.\nThe sorted handle names are e, petr, tourist, so e comes first.\n\nSample Input 2\n\n2\n?o?r?s?\n?et?\ne", "sample_input": "2\ntourist\npetr\ne\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03751", "source_text": "Max Score: 250 Points\n\nProblem Statement\n\nMr.X, who the handle name is T, looked at the list which written N handle names, S_1, S_2, ..., S_N.\n\nBut he couldn't see some parts of the list. Invisible part is denoted ?.\n\nPlease calculate all possible index of the handle name of Mr.X when you sort N+1 handle names (S_1, S_2, ..., S_N and T) in lexicographical order.\n\nNote: If there are pair of people with same handle name, either one may come first.\n\nInput\n\nThe input is given from standard input in the following format.\n\nN\nS_1\nS_2\n:\nS_N\nT\n\nOutput\n\nCalculate the possible index and print in sorted order. The output should be separated with a space. Don't print a space after last number.\n\nPut a line break in the end.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n1 ≤ |S_i|, |T| ≤ 20 (|A| is the length of A.)\n\nS_i consists from lower-case alphabet and ?.\n\nT consists from lower-case alphabet.\n\nScoring\n\nSubtask 1 [ 130 points ]\n\nThere are no ?'s.\n\nSubtask 2 [ 120 points ]\n\nThere are no additional constraints.\n\nSample Input 1\n\n2\ntourist\npetr\ne\n\nSample Output 1\n\n1\n\nThere are no invisible part, so there are only one possibility.\nThe sorted handle names are e, petr, tourist, so e comes first.\n\nSample Input 2\n\n2\n?o?r?s?\n?et?\ne", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 440, "memory_kb": 100248}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s420703633", "group_id": "codeNet:p03759", "input_text": "<>=~/ .* /,print$&*2-$`-$'?NO:YES", "language": "Perl", "metadata": {"date": 1491707389, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03759.html", "problem_id": "p03759", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03759/input.txt", "sample_output_relpath": "derived/input_output/data/p03759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03759/Perl/s420703633.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s420703633", "user_id": "u657913472"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "<>=~/ .* /,print$&*2-$`-$'?NO:YES", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.\nWe will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.\n\nDetermine whether the arrangement of the poles is beautiful.\n\nConstraints\n\n1 \\leq a,b,c \\leq 100\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint YES if the arrangement of the poles is beautiful; print NO otherwise.\n\nSample Input 1\n\n2 4 6\n\nSample Output 1\n\nYES\n\nSince 4-2 = 6-4, this arrangement of poles is beautiful.\n\nSample Input 2\n\n2 5 6\n\nSample Output 2\n\nNO\n\nSince 5-2 \\neq 6-5, this arrangement of poles is not beautiful.\n\nSample Input 3\n\n3 2 1\n\nSample Output 3\n\nYES\n\nSince 1-2 = 2-3, this arrangement of poles is beautiful.", "sample_input": "2 4 6\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03759", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.\nWe will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.\n\nDetermine whether the arrangement of the poles is beautiful.\n\nConstraints\n\n1 \\leq a,b,c \\leq 100\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint YES if the arrangement of the poles is beautiful; print NO otherwise.\n\nSample Input 1\n\n2 4 6\n\nSample Output 1\n\nYES\n\nSince 4-2 = 6-4, this arrangement of poles is beautiful.\n\nSample Input 2\n\n2 5 6\n\nSample Output 2\n\nNO\n\nSince 5-2 \\neq 6-5, this arrangement of poles is not beautiful.\n\nSample Input 3\n\n3 2 1\n\nSample Output 3\n\nYES\n\nSince 1-2 = 2-3, this arrangement of poles is beautiful.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s436068147", "group_id": "codeNet:p03763", "input_text": "say |[(&)](get.comb.Bag xx get).kxxv.sort", "language": "Perl", "metadata": {"date": 1592660087, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03763.html", "problem_id": "p03763", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03763/input.txt", "sample_output_relpath": "derived/input_output/data/p03763/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03763/Perl/s436068147.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s436068147", "user_id": "u657913472"}, "prompt_components": {"gold_output": "aac\n", "input_to_evaluate": "say |[(&)](get.comb.Bag xx get).kxxv.sort", "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": "p03763", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 41, "cpu_time_ms": 208, "memory_kb": 86308}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s703971625", "group_id": "codeNet:p03763", "input_text": "say |([(&)] get.comb xx get).kxxv.sort", "language": "Perl", "metadata": {"date": 1538033665, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03763.html", "problem_id": "p03763", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03763/input.txt", "sample_output_relpath": "derived/input_output/data/p03763/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03763/Perl/s703971625.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s703971625", "user_id": "u657913472"}, "prompt_components": {"gold_output": "aac\n", "input_to_evaluate": "say |([(&)] get.comb xx get).kxxv.sort", "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": "p03763", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 318, "memory_kb": 77064}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s846119847", "group_id": "codeNet:p03763", "input_text": "say |([(&)] (get.comb.Bag)xx get).kxxv.sort", "language": "Perl", "metadata": {"date": 1535011931, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03763.html", "problem_id": "p03763", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03763/input.txt", "sample_output_relpath": "derived/input_output/data/p03763/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03763/Perl/s846119847.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s846119847", "user_id": "u657913472"}, "prompt_components": {"gold_output": "aac\n", "input_to_evaluate": "say |([(&)] (get.comb.Bag)xx get).kxxv.sort", "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": "p03763", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 43, "cpu_time_ms": 474, "memory_kb": 72992}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s318944791", "group_id": "codeNet:p03763", "input_text": "<>;@s=<>;for$;(a..z){print$;x(sort{$a-$b}map s/$;//g,@s)[0]}", "language": "Perl", "metadata": {"date": 1491764258, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03763.html", "problem_id": "p03763", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03763/input.txt", "sample_output_relpath": "derived/input_output/data/p03763/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03763/Perl/s318944791.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s318944791", "user_id": "u283869437"}, "prompt_components": {"gold_output": "aac\n", "input_to_evaluate": "<>;@s=<>;for$;(a..z){print$;x(sort{$a-$b}map s/$;//g,@s)[0]}", "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": "p03763", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 60, "cpu_time_ms": 3, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s709126323", "group_id": "codeNet:p03767", "input_text": "use strict;\nuse warnings;\nuse 5.010;\n\nmy $n = <>;\nmy $ans = 0;\nmy $flag = 1;\nchomp $n;\nmy @arr = split / /, <>;\nchomp $arr[-1];\n@arr = sort{$a <=> $b} @arr;\n\nfor(my $i = $n; $i < $n *3; $i++) {\n\tif($flag) {\n\t\t$ans += $arr[$i];\n\t\t$flag = 0;\n\t} else {\n\t\t$flag = 1;\n\t}\n}\nsay $ans;\n\nexit;", "language": "Perl", "metadata": {"date": 1492816274, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03767.html", "problem_id": "p03767", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03767/input.txt", "sample_output_relpath": "derived/input_output/data/p03767/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03767/Perl/s709126323.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s709126323", "user_id": "u092665151"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "use strict;\nuse warnings;\nuse 5.010;\n\nmy $n = <>;\nmy $ans = 0;\nmy $flag = 1;\nchomp $n;\nmy @arr = split / /, <>;\nchomp $arr[-1];\n@arr = sort{$a <=> $b} @arr;\n\nfor(my $i = $n; $i < $n *3; $i++) {\n\tif($flag) {\n\t\t$ans += $arr[$i];\n\t\t$flag = 0;\n\t} else {\n\t\t$flag = 1;\n\t}\n}\nsay $ans;\n\nexit;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are 3N participants in AtCoder Group Contest.\nThe strength of the i-th participant is represented by an integer a_i.\nThey will form N teams, each consisting of three participants.\nNo participant may belong to multiple teams.\n\nThe strength of a team is defined as the second largest strength among its members.\nFor example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3.\n\nFind the maximum possible sum of the strengths of N teams.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ 10^{9}\n\na_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{3N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2\n5 2 8 5 1 5\n\nSample Output 1\n\n10\n\nThe following is one formation of teams that maximizes the sum of the strengths of teams:\n\nTeam 1: consists of the first, fourth and fifth participants.\n\nTeam 2: consists of the second, third and sixth participants.\n\nSample Input 2\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 2\n\n10000000000\n\nThe sum of the strengths can be quite large.", "sample_input": "2\n5 2 8 5 1 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are 3N participants in AtCoder Group Contest.\nThe strength of the i-th participant is represented by an integer a_i.\nThey will form N teams, each consisting of three participants.\nNo participant may belong to multiple teams.\n\nThe strength of a team is defined as the second largest strength among its members.\nFor example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3.\n\nFind the maximum possible sum of the strengths of N teams.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ 10^{9}\n\na_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{3N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2\n5 2 8 5 1 5\n\nSample Output 1\n\n10\n\nThe following is one formation of teams that maximizes the sum of the strengths of teams:\n\nTeam 1: consists of the first, fourth and fifth participants.\n\nTeam 2: consists of the second, third and sixth participants.\n\nSample Input 2\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 2\n\n10000000000\n\nThe sum of the strengths can be quite large.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 309, "memory_kb": 54308}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s220705758", "group_id": "codeNet:p03768", "input_text": "sub f{my$d=pop;\n\t$c[$_-1]||=$';\n\tif($d>$d[$_]&&$d>0){\n\t\t$d[$_]=$d;\n\t\tf($d-1)for@$_\n\t}\n}\n<>=~$\";\n@c=(0)x$`;\nmap{push@$_,$_[--$|]for@_=<>=~/\\d+/g}1..$';\n$_*=/ .* /,f$&for reverse<>;\nprint\"@c\"\n", "language": "Perl", "metadata": {"date": 1521708833, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03768.html", "problem_id": "p03768", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03768/input.txt", "sample_output_relpath": "derived/input_output/data/p03768/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03768/Perl/s220705758.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s220705758", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n2\n2\n2\n2\n1\n0\n", "input_to_evaluate": "sub f{my$d=pop;\n\t$c[$_-1]||=$';\n\tif($d>$d[$_]&&$d>0){\n\t\t$d[$_]=$d;\n\t\tf($d-1)for@$_\n\t}\n}\n<>=~$\";\n@c=(0)x$`;\nmap{push@$_,$_[--$|]for@_=<>=~/\\d+/g}1..$';\n$_*=/ .* /,f$&for reverse<>;\nprint\"@c\"\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nSquid loves painting vertices in graphs.\n\nThere is a simple undirected graph consisting of N vertices numbered 1 through N, and M edges.\nInitially, all the vertices are painted in color 0. The i-th edge bidirectionally connects two vertices a_i and b_i. The length of every edge is 1.\n\nSquid performed Q operations on this graph. In the i-th operation, he repaints all the vertices within a distance of d_i from vertex v_i, in color c_i.\n\nFind the color of each vertex after the Q operations.\n\nConstraints\n\n1 ≤ N,M,Q ≤ 10^5\n\n1 ≤ a_i,b_i,v_i ≤ N\n\na_i ≠ b_i\n\n0 ≤ d_i ≤ 10\n\n1 ≤ c_i ≤10^5\n\nd_i and c_i are all integers.\n\nThere are no self-loops or multiple edges in the given graph.\n\nPartial Score\n\n200 points will be awarded for passing the testset satisfying 1 ≤ N,M,Q ≤ 2{,}000.\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}\nQ\nv_1 d_1 c_1\n:\nv_{Q} d_{Q} c_{Q}\n\nOutput\n\nPrint the answer in N lines.\nIn the i-th line, print the color of vertex i after the Q operations.\n\nSample Input 1\n\n7 7\n1 2\n1 3\n1 4\n4 5\n5 6\n5 7\n2 3\n2\n6 1 1\n1 2 2\n\nSample Output 1\n\n2\n2\n2\n2\n2\n1\n0\n\nInitially, each vertex is painted in color 0.\nIn the first operation, vertices 5 and 6 are repainted in color 1.\nIn the second operation, vertices 1, 2, 3, 4 and 5 are repainted in color 2.\n\nSample Input 2\n\n14 10\n1 4\n5 7\n7 11\n4 10\n14 7\n14 3\n6 14\n8 11\n5 13\n8 3\n8\n8 6 2\n9 7 85\n6 9 3\n6 7 5\n10 3 1\n12 9 4\n9 6 6\n8 2 3\n\nSample Output 2\n\n1\n0\n3\n1\n5\n5\n3\n3\n6\n1\n3\n4\n5\n3\n\nThe given graph may not be connected.", "sample_input": "7 7\n1 2\n1 3\n1 4\n4 5\n5 6\n5 7\n2 3\n2\n6 1 1\n1 2 2\n"}, "reference_outputs": ["2\n2\n2\n2\n2\n1\n0\n"], "source_document_id": "p03768", "source_text": "Score : 700 points\n\nProblem Statement\n\nSquid loves painting vertices in graphs.\n\nThere is a simple undirected graph consisting of N vertices numbered 1 through N, and M edges.\nInitially, all the vertices are painted in color 0. The i-th edge bidirectionally connects two vertices a_i and b_i. The length of every edge is 1.\n\nSquid performed Q operations on this graph. In the i-th operation, he repaints all the vertices within a distance of d_i from vertex v_i, in color c_i.\n\nFind the color of each vertex after the Q operations.\n\nConstraints\n\n1 ≤ N,M,Q ≤ 10^5\n\n1 ≤ a_i,b_i,v_i ≤ N\n\na_i ≠ b_i\n\n0 ≤ d_i ≤ 10\n\n1 ≤ c_i ≤10^5\n\nd_i and c_i are all integers.\n\nThere are no self-loops or multiple edges in the given graph.\n\nPartial Score\n\n200 points will be awarded for passing the testset satisfying 1 ≤ N,M,Q ≤ 2{,}000.\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}\nQ\nv_1 d_1 c_1\n:\nv_{Q} d_{Q} c_{Q}\n\nOutput\n\nPrint the answer in N lines.\nIn the i-th line, print the color of vertex i after the Q operations.\n\nSample Input 1\n\n7 7\n1 2\n1 3\n1 4\n4 5\n5 6\n5 7\n2 3\n2\n6 1 1\n1 2 2\n\nSample Output 1\n\n2\n2\n2\n2\n2\n1\n0\n\nInitially, each vertex is painted in color 0.\nIn the first operation, vertices 5 and 6 are repainted in color 1.\nIn the second operation, vertices 1, 2, 3, 4 and 5 are repainted in color 2.\n\nSample Input 2\n\n14 10\n1 4\n5 7\n7 11\n4 10\n14 7\n14 3\n6 14\n8 11\n5 13\n8 3\n8\n8 6 2\n9 7 85\n6 9 3\n6 7 5\n10 3 1\n12 9 4\n9 6 6\n8 2 3\n\nSample Output 2\n\n1\n0\n3\n1\n5\n5\n3\n3\n6\n1\n3\n4\n5\n3\n\nThe given graph may not be connected.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1661, "memory_kb": 107392}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s009871641", "group_id": "codeNet:p03774", "input_text": "push(@c,<>),$m=1e9,print/ /*(grep{($c,$d)=glob;$m-=$-=$m-abs($c-$`)-abs$d-$';$-}@c)[-1],$/for map~~<>,1..<>", "language": "Perl", "metadata": {"date": 1535351374, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03774.html", "problem_id": "p03774", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03774/input.txt", "sample_output_relpath": "derived/input_output/data/p03774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03774/Perl/s009871641.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s009871641", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n1\n", "input_to_evaluate": "push(@c,<>),$m=1e9,print/ /*(grep{($c,$d)=glob;$m-=$-=$m-abs($c-$`)-abs$d-$';$-}@c)[-1],$/for map~~<>,1..<>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N students and M checkpoints on the xy-plane.\n\nThe coordinates of the i-th student (1 \\leq i \\leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \\leq j \\leq M) is (c_j,d_j).\n\nWhen the teacher gives a signal, each student has to go to the nearest checkpoint measured in Manhattan distance.\n\nThe Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.\n\nHere, |x| denotes the absolute value of x.\n\nIf there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.\n\nWhich checkpoint will each student go to?\n\nConstraints\n\n1 \\leq N,M \\leq 50\n\n-10^8 \\leq a_i,b_i,c_j,d_j \\leq 10^8\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_N b_N\nc_1 d_1\n:\nc_M d_M\n\nOutput\n\nPrint N lines.\n\nThe i-th line (1 \\leq i \\leq N) should contain the index of the checkpoint for the i-th student to go.\n\nSample Input 1\n\n2 2\n2 0\n0 0\n-1 0\n1 0\n\nSample Output 1\n\n2\n1\n\nThe Manhattan distance between the first student and each checkpoint is:\n\nFor checkpoint 1: |2-(-1)|+|0-0|=3\n\nFor checkpoint 2: |2-1|+|0-0|=1\n\nThe nearest checkpoint is checkpoint 2. Thus, the first line in the output should contain 2.\n\nThe Manhattan distance between the second student and each checkpoint is:\n\nFor checkpoint 1: |0-(-1)|+|0-0|=1\n\nFor checkpoint 2: |0-1|+|0-0|=1\n\nWhen there are multiple nearest checkpoints, the student will go to the checkpoint with the smallest index. Thus, the second line in the output should contain 1.\n\nSample Input 2\n\n3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5\n\nSample Output 2\n\n3\n1\n2\n\nThere can be multiple checkpoints at the same coordinates.\n\nSample Input 3\n\n5 5\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100000000\n0 0\n0 0\n100000000 100000000\n100000000 -100000000\n-100000000 100000000\n-100000000 -100000000\n\nSample Output 3\n\n5\n4\n3\n2\n1", "sample_input": "2 2\n2 0\n0 0\n-1 0\n1 0\n"}, "reference_outputs": ["2\n1\n"], "source_document_id": "p03774", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N students and M checkpoints on the xy-plane.\n\nThe coordinates of the i-th student (1 \\leq i \\leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \\leq j \\leq M) is (c_j,d_j).\n\nWhen the teacher gives a signal, each student has to go to the nearest checkpoint measured in Manhattan distance.\n\nThe Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.\n\nHere, |x| denotes the absolute value of x.\n\nIf there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.\n\nWhich checkpoint will each student go to?\n\nConstraints\n\n1 \\leq N,M \\leq 50\n\n-10^8 \\leq a_i,b_i,c_j,d_j \\leq 10^8\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_N b_N\nc_1 d_1\n:\nc_M d_M\n\nOutput\n\nPrint N lines.\n\nThe i-th line (1 \\leq i \\leq N) should contain the index of the checkpoint for the i-th student to go.\n\nSample Input 1\n\n2 2\n2 0\n0 0\n-1 0\n1 0\n\nSample Output 1\n\n2\n1\n\nThe Manhattan distance between the first student and each checkpoint is:\n\nFor checkpoint 1: |2-(-1)|+|0-0|=3\n\nFor checkpoint 2: |2-1|+|0-0|=1\n\nThe nearest checkpoint is checkpoint 2. Thus, the first line in the output should contain 2.\n\nThe Manhattan distance between the second student and each checkpoint is:\n\nFor checkpoint 1: |0-(-1)|+|0-0|=1\n\nFor checkpoint 2: |0-1|+|0-0|=1\n\nWhen there are multiple nearest checkpoints, the student will go to the checkpoint with the smallest index. Thus, the second line in the output should contain 1.\n\nSample Input 2\n\n3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5\n\nSample Output 2\n\n3\n1\n2\n\nThere can be multiple checkpoints at the same coordinates.\n\nSample Input 3\n\n5 5\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100000000\n0 0\n0 0\n100000000 100000000\n100000000 -100000000\n-100000000 100000000\n-100000000 -100000000\n\nSample Output 3\n\n5\n4\n3\n2\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 18, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s322102815", "group_id": "codeNet:p03774", "input_text": "@a=<>;($x,$y,$i)=glob,(sort{$a-$b}map/ /*abs($x-$`)+abs($y-$').a.++$i,@a[\"@a\"+1..$#a])[0]=~a,print$',$/for@a[1..\"@a\"]", "language": "Perl", "metadata": {"date": 1535349967, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03774.html", "problem_id": "p03774", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03774/input.txt", "sample_output_relpath": "derived/input_output/data/p03774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03774/Perl/s322102815.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s322102815", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n1\n", "input_to_evaluate": "@a=<>;($x,$y,$i)=glob,(sort{$a-$b}map/ /*abs($x-$`)+abs($y-$').a.++$i,@a[\"@a\"+1..$#a])[0]=~a,print$',$/for@a[1..\"@a\"]", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N students and M checkpoints on the xy-plane.\n\nThe coordinates of the i-th student (1 \\leq i \\leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \\leq j \\leq M) is (c_j,d_j).\n\nWhen the teacher gives a signal, each student has to go to the nearest checkpoint measured in Manhattan distance.\n\nThe Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.\n\nHere, |x| denotes the absolute value of x.\n\nIf there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.\n\nWhich checkpoint will each student go to?\n\nConstraints\n\n1 \\leq N,M \\leq 50\n\n-10^8 \\leq a_i,b_i,c_j,d_j \\leq 10^8\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_N b_N\nc_1 d_1\n:\nc_M d_M\n\nOutput\n\nPrint N lines.\n\nThe i-th line (1 \\leq i \\leq N) should contain the index of the checkpoint for the i-th student to go.\n\nSample Input 1\n\n2 2\n2 0\n0 0\n-1 0\n1 0\n\nSample Output 1\n\n2\n1\n\nThe Manhattan distance between the first student and each checkpoint is:\n\nFor checkpoint 1: |2-(-1)|+|0-0|=3\n\nFor checkpoint 2: |2-1|+|0-0|=1\n\nThe nearest checkpoint is checkpoint 2. Thus, the first line in the output should contain 2.\n\nThe Manhattan distance between the second student and each checkpoint is:\n\nFor checkpoint 1: |0-(-1)|+|0-0|=1\n\nFor checkpoint 2: |0-1|+|0-0|=1\n\nWhen there are multiple nearest checkpoints, the student will go to the checkpoint with the smallest index. Thus, the second line in the output should contain 1.\n\nSample Input 2\n\n3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5\n\nSample Output 2\n\n3\n1\n2\n\nThere can be multiple checkpoints at the same coordinates.\n\nSample Input 3\n\n5 5\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100000000\n0 0\n0 0\n100000000 100000000\n100000000 -100000000\n-100000000 100000000\n-100000000 -100000000\n\nSample Output 3\n\n5\n4\n3\n2\n1", "sample_input": "2 2\n2 0\n0 0\n-1 0\n1 0\n"}, "reference_outputs": ["2\n1\n"], "source_document_id": "p03774", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N students and M checkpoints on the xy-plane.\n\nThe coordinates of the i-th student (1 \\leq i \\leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \\leq j \\leq M) is (c_j,d_j).\n\nWhen the teacher gives a signal, each student has to go to the nearest checkpoint measured in Manhattan distance.\n\nThe Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.\n\nHere, |x| denotes the absolute value of x.\n\nIf there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.\n\nWhich checkpoint will each student go to?\n\nConstraints\n\n1 \\leq N,M \\leq 50\n\n-10^8 \\leq a_i,b_i,c_j,d_j \\leq 10^8\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_N b_N\nc_1 d_1\n:\nc_M d_M\n\nOutput\n\nPrint N lines.\n\nThe i-th line (1 \\leq i \\leq N) should contain the index of the checkpoint for the i-th student to go.\n\nSample Input 1\n\n2 2\n2 0\n0 0\n-1 0\n1 0\n\nSample Output 1\n\n2\n1\n\nThe Manhattan distance between the first student and each checkpoint is:\n\nFor checkpoint 1: |2-(-1)|+|0-0|=3\n\nFor checkpoint 2: |2-1|+|0-0|=1\n\nThe nearest checkpoint is checkpoint 2. Thus, the first line in the output should contain 2.\n\nThe Manhattan distance between the second student and each checkpoint is:\n\nFor checkpoint 1: |0-(-1)|+|0-0|=1\n\nFor checkpoint 2: |0-1|+|0-0|=1\n\nWhen there are multiple nearest checkpoints, the student will go to the checkpoint with the smallest index. Thus, the second line in the output should contain 1.\n\nSample Input 2\n\n3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5\n\nSample Output 2\n\n3\n1\n2\n\nThere can be multiple checkpoints at the same coordinates.\n\nSample Input 3\n\n5 5\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100000000\n0 0\n0 0\n100000000 100000000\n100000000 -100000000\n-100000000 100000000\n-100000000 -100000000\n\nSample Output 3\n\n5\n4\n3\n2\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 117, "cpu_time_ms": 10, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s488268192", "group_id": "codeNet:p03775", "input_text": "$/=+get;say min map {$/%$_??99:+(~($//$_)).comb},1..sqrt($/)", "language": "Perl", "metadata": {"date": 1538032974, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03775.html", "problem_id": "p03775", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03775/input.txt", "sample_output_relpath": "derived/input_output/data/p03775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03775/Perl/s488268192.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s488268192", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$/=+get;say min map {$/%$_??99:+(~($//$_)).comb},1..sqrt($/)", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "sample_input": "10000\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03775", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 60, "cpu_time_ms": 120, "memory_kb": 48284}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s448598988", "group_id": "codeNet:p03775", "input_text": "$/=+get;say min map {$/%$_??99:+(~($//$_)).comb},1..sqrt $/", "language": "Perl", "metadata": {"date": 1538032947, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03775.html", "problem_id": "p03775", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03775/input.txt", "sample_output_relpath": "derived/input_output/data/p03775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03775/Perl/s448598988.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s448598988", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "$/=+get;say min map {$/%$_??99:+(~($//$_)).comb},1..sqrt $/", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "sample_input": "10000\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03775", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 59, "cpu_time_ms": 120, "memory_kb": 48408}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s952076514", "group_id": "codeNet:p03775", "input_text": "print length$N/(grep$N%$_<1,1..sqrt$N=<>)[-1]", "language": "Perl", "metadata": {"date": 1538032812, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03775.html", "problem_id": "p03775", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03775/input.txt", "sample_output_relpath": "derived/input_output/data/p03775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03775/Perl/s952076514.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s952076514", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "print length$N/(grep$N%$_<1,1..sqrt$N=<>)[-1]", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "sample_input": "10000\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03775", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s501347242", "group_id": "codeNet:p03776", "input_text": "$/=get.words;$_=sort -*,get.words;$!={+.grep(*==.[$1-1])};\n#say .[^$1].sum/$1;($!(.[^$1]),+$1..($!()min+$2))[.[$1-1]==.[0]]>>.&{combinations($!(),$_).elems}.sum.say\n(.[^$1].sum/$1,($!(.[^$1]),+$1..($!()min+$2))[.[$1-1]==.[0]]>>.&{combinations($!(),$_).elems}.sum).put", "language": "Perl", "metadata": {"date": 1541933796, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03776.html", "problem_id": "p03776", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03776/input.txt", "sample_output_relpath": "derived/input_output/data/p03776/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03776/Perl/s501347242.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s501347242", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4.500000\n1\n", "input_to_evaluate": "$/=get.words;$_=sort -*,get.words;$!={+.grep(*==.[$1-1])};\n#say .[^$1].sum/$1;($!(.[^$1]),+$1..($!()min+$2))[.[$1-1]==.[0]]>>.&{combinations($!(),$_).elems}.sum.say\n(.[^$1].sum/$1,($!(.[^$1]),+$1..($!()min+$2))[.[$1-1]==.[0]]>>.&{combinations($!(),$_).elems}.sum).put", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given N items.\n\nThe value of the i-th item (1 \\leq i \\leq N) is v_i.\n\nYour have to select at least A and at most B of these items.\n\nUnder this condition, find the maximum possible arithmetic mean of the values of selected items.\n\nAdditionally, find the number of ways to select items so that the mean of the values of selected items is maximized.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A,B \\leq N\n\n1 \\leq v_i \\leq 10^{15}\n\nEach v_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A B\nv_1\nv_2\n...\nv_N\n\nOutput\n\nPrint two lines.\n\nThe first line should contain the maximum possible arithmetic mean of the values of selected items. The output should be considered correct if the absolute or relative error is at most 10^{-6}.\n\nThe second line should contain the number of ways to select items so that the mean of the values of selected items is maximized.\n\nSample Input 1\n\n5 2 2\n1 2 3 4 5\n\nSample Output 1\n\n4.500000\n1\n\nThe mean of the values of selected items will be maximized when selecting the fourth and fifth items. Hence, the first line of the output should contain 4.5.\n\nThere is no other way to select items so that the mean of the values will be 4.5, and thus the second line of the output should contain 1.\n\nSample Input 2\n\n4 2 3\n10 20 10 10\n\nSample Output 2\n\n15.000000\n3\n\nThere can be multiple ways to select items so that the mean of the values will be maximized.\n\nSample Input 3\n\n5 1 5\n1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996\n\nSample Output 3\n\n1000000000000000.000000\n1", "sample_input": "5 2 2\n1 2 3 4 5\n"}, "reference_outputs": ["4.500000\n1\n"], "source_document_id": "p03776", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given N items.\n\nThe value of the i-th item (1 \\leq i \\leq N) is v_i.\n\nYour have to select at least A and at most B of these items.\n\nUnder this condition, find the maximum possible arithmetic mean of the values of selected items.\n\nAdditionally, find the number of ways to select items so that the mean of the values of selected items is maximized.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A,B \\leq N\n\n1 \\leq v_i \\leq 10^{15}\n\nEach v_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A B\nv_1\nv_2\n...\nv_N\n\nOutput\n\nPrint two lines.\n\nThe first line should contain the maximum possible arithmetic mean of the values of selected items. The output should be considered correct if the absolute or relative error is at most 10^{-6}.\n\nThe second line should contain the number of ways to select items so that the mean of the values of selected items is maximized.\n\nSample Input 1\n\n5 2 2\n1 2 3 4 5\n\nSample Output 1\n\n4.500000\n1\n\nThe mean of the values of selected items will be maximized when selecting the fourth and fifth items. Hence, the first line of the output should contain 4.5.\n\nThere is no other way to select items so that the mean of the values will be 4.5, and thus the second line of the output should contain 1.\n\nSample Input 2\n\n4 2 3\n10 20 10 10\n\nSample Output 2\n\n15.000000\n3\n\nThere can be multiple ways to select items so that the mean of the values will be maximized.\n\nSample Input 3\n\n5 1 5\n1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996\n\nSample Output 3\n\n1000000000000000.000000\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1091, "memory_kb": 80752}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s272515220", "group_id": "codeNet:p03776", "input_text": "sub nCk{my($n,$k)=@_;\nmy$r=1;\n\t$r*=$n+1-$_,$r/=$_ for 1..$k;\n\t$r\n}\n($N,$A,$B)=glob<>;\n@v=sort{$b<=>$a}glob<>;\n$s+=$_ for@v[0..$A-1];\n$l=$r=$A-1;\n$l--while$l-1>=0&&$v[$l-1]==$v[$A-1];\n$r++while$r+1<$N&&$v[$r+1]==$v[$A-1];\n$p+=nCk($r-$l+1,$_-$l)for$A..($l?$A:$B);\nprintf\"%f\\n%d\",$s/$A,$p\n", "language": "Perl", "metadata": {"date": 1506734792, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03776.html", "problem_id": "p03776", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03776/input.txt", "sample_output_relpath": "derived/input_output/data/p03776/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03776/Perl/s272515220.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272515220", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4.500000\n1\n", "input_to_evaluate": "sub nCk{my($n,$k)=@_;\nmy$r=1;\n\t$r*=$n+1-$_,$r/=$_ for 1..$k;\n\t$r\n}\n($N,$A,$B)=glob<>;\n@v=sort{$b<=>$a}glob<>;\n$s+=$_ for@v[0..$A-1];\n$l=$r=$A-1;\n$l--while$l-1>=0&&$v[$l-1]==$v[$A-1];\n$r++while$r+1<$N&&$v[$r+1]==$v[$A-1];\n$p+=nCk($r-$l+1,$_-$l)for$A..($l?$A:$B);\nprintf\"%f\\n%d\",$s/$A,$p\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given N items.\n\nThe value of the i-th item (1 \\leq i \\leq N) is v_i.\n\nYour have to select at least A and at most B of these items.\n\nUnder this condition, find the maximum possible arithmetic mean of the values of selected items.\n\nAdditionally, find the number of ways to select items so that the mean of the values of selected items is maximized.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A,B \\leq N\n\n1 \\leq v_i \\leq 10^{15}\n\nEach v_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A B\nv_1\nv_2\n...\nv_N\n\nOutput\n\nPrint two lines.\n\nThe first line should contain the maximum possible arithmetic mean of the values of selected items. The output should be considered correct if the absolute or relative error is at most 10^{-6}.\n\nThe second line should contain the number of ways to select items so that the mean of the values of selected items is maximized.\n\nSample Input 1\n\n5 2 2\n1 2 3 4 5\n\nSample Output 1\n\n4.500000\n1\n\nThe mean of the values of selected items will be maximized when selecting the fourth and fifth items. Hence, the first line of the output should contain 4.5.\n\nThere is no other way to select items so that the mean of the values will be 4.5, and thus the second line of the output should contain 1.\n\nSample Input 2\n\n4 2 3\n10 20 10 10\n\nSample Output 2\n\n15.000000\n3\n\nThere can be multiple ways to select items so that the mean of the values will be maximized.\n\nSample Input 3\n\n5 1 5\n1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996\n\nSample Output 3\n\n1000000000000000.000000\n1", "sample_input": "5 2 2\n1 2 3 4 5\n"}, "reference_outputs": ["4.500000\n1\n"], "source_document_id": "p03776", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given N items.\n\nThe value of the i-th item (1 \\leq i \\leq N) is v_i.\n\nYour have to select at least A and at most B of these items.\n\nUnder this condition, find the maximum possible arithmetic mean of the values of selected items.\n\nAdditionally, find the number of ways to select items so that the mean of the values of selected items is maximized.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A,B \\leq N\n\n1 \\leq v_i \\leq 10^{15}\n\nEach v_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A B\nv_1\nv_2\n...\nv_N\n\nOutput\n\nPrint two lines.\n\nThe first line should contain the maximum possible arithmetic mean of the values of selected items. The output should be considered correct if the absolute or relative error is at most 10^{-6}.\n\nThe second line should contain the number of ways to select items so that the mean of the values of selected items is maximized.\n\nSample Input 1\n\n5 2 2\n1 2 3 4 5\n\nSample Output 1\n\n4.500000\n1\n\nThe mean of the values of selected items will be maximized when selecting the fourth and fifth items. Hence, the first line of the output should contain 4.5.\n\nThere is no other way to select items so that the mean of the values will be 4.5, and thus the second line of the output should contain 1.\n\nSample Input 2\n\n4 2 3\n10 20 10 10\n\nSample Output 2\n\n15.000000\n3\n\nThere can be multiple ways to select items so that the mean of the values will be maximized.\n\nSample Input 3\n\n5 1 5\n1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996\n\nSample Output 3\n\n1000000000000000.000000\n1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s090042664", "group_id": "codeNet:p03777", "input_text": "$line = split(/ /, <>);\nmy $a = $line[0];\nmy $b = $line[1];\nmy $ans = 0;\n$ans = 1 - $ans if $a == 'D';\n$ans = 1 - $ans if $b == 'D';\nprint substr(\"HD\", $ans, 1).\"\\n\";", "language": "Perl", "metadata": {"date": 1490370756, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03777.html", "problem_id": "p03777", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03777/input.txt", "sample_output_relpath": "derived/input_output/data/p03777/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03777/Perl/s090042664.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s090042664", "user_id": "u045939752"}, "prompt_components": {"gold_output": "H\n", "input_to_evaluate": "$line = split(/ /, <>);\nmy $a = $line[0];\nmy $b = $line[1];\nmy $ans = 0;\n$ans = 1 - $ans if $a == 'D';\n$ans = 1 - $ans if $b == 'D';\nprint substr(\"HD\", $ans, 1).\"\\n\";", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTwo deer, AtCoDeer and TopCoDeer, are playing a game called Honest or Dishonest.\nIn this game, an honest player always tells the truth, and an dishonest player always tell lies.\nYou are given two characters a and b as the input. Each of them is either H or D, and carries the following information:\n\nIf a=H, AtCoDeer is honest; if a=D, AtCoDeer is dishonest.\nIf b=H, AtCoDeer is saying that TopCoDeer is honest; if b=D, AtCoDeer is saying that TopCoDeer is dishonest.\n\nGiven this information, determine whether TopCoDeer is honest.\n\nConstraints\n\na=H or a=D.\n\nb=H or b=D.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf TopCoDeer is honest, print H. If he is dishonest, print D.\n\nSample Input 1\n\nH H\n\nSample Output 1\n\nH\n\nIn this input, AtCoDeer is honest. Hence, as he says, TopCoDeer is honest.\n\nSample Input 2\n\nD H\n\nSample Output 2\n\nD\n\nIn this input, AtCoDeer is dishonest. Hence, contrary to what he says, TopCoDeer is dishonest.\n\nSample Input 3\n\nD D\n\nSample Output 3\n\nH", "sample_input": "H H\n"}, "reference_outputs": ["H\n"], "source_document_id": "p03777", "source_text": "Score : 100 points\n\nProblem Statement\n\nTwo deer, AtCoDeer and TopCoDeer, are playing a game called Honest or Dishonest.\nIn this game, an honest player always tells the truth, and an dishonest player always tell lies.\nYou are given two characters a and b as the input. Each of them is either H or D, and carries the following information:\n\nIf a=H, AtCoDeer is honest; if a=D, AtCoDeer is dishonest.\nIf b=H, AtCoDeer is saying that TopCoDeer is honest; if b=D, AtCoDeer is saying that TopCoDeer is dishonest.\n\nGiven this information, determine whether TopCoDeer is honest.\n\nConstraints\n\na=H or a=D.\n\nb=H or b=D.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf TopCoDeer is honest, print H. If he is dishonest, print D.\n\nSample Input 1\n\nH H\n\nSample Output 1\n\nH\n\nIn this input, AtCoDeer is honest. Hence, as he says, TopCoDeer is honest.\n\nSample Input 2\n\nD H\n\nSample Output 2\n\nD\n\nIn this input, AtCoDeer is dishonest. Hence, contrary to what he says, TopCoDeer is dishonest.\n\nSample Input 3\n\nD D\n\nSample Output 3\n\nH", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s838065043", "group_id": "codeNet:p03778", "input_text": "get~~m:g/\\d+/;say max abs($1-$2)-$0,0", "language": "Perl", "metadata": {"date": 1535369335, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03778.html", "problem_id": "p03778", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03778/input.txt", "sample_output_relpath": "derived/input_output/data/p03778/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03778/Perl/s838065043.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s838065043", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "get~~m:g/\\d+/;say max abs($1-$2)-$0,0", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.\nIf we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], and the second rectangle covers the vertical range of [1,2] and the horizontal range of [b,b+W], as shown in the following figure:\n\nAtCoDeer will move the second rectangle horizontally so that it connects with the first rectangle.\nFind the minimum distance it needs to be moved.\n\nConstraints\n\nAll input values are integers.\n\n1≤W≤10^5\n\n1≤a,b≤10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW a b\n\nOutput\n\nPrint the minimum distance the second rectangle needs to be moved.\n\nSample Input 1\n\n3 2 6\n\nSample Output 1\n\n1\n\nThis input corresponds to the figure in the statement. In this case, the second rectangle should be moved to the left by a distance of 1.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n0\n\nThe rectangles are already connected, and thus no move is needed.\n\nSample Input 3\n\n5 10 1\n\nSample Output 3\n\n4", "sample_input": "3 2 6\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03778", "source_text": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.\nIf we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], and the second rectangle covers the vertical range of [1,2] and the horizontal range of [b,b+W], as shown in the following figure:\n\nAtCoDeer will move the second rectangle horizontally so that it connects with the first rectangle.\nFind the minimum distance it needs to be moved.\n\nConstraints\n\nAll input values are integers.\n\n1≤W≤10^5\n\n1≤a,b≤10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW a b\n\nOutput\n\nPrint the minimum distance the second rectangle needs to be moved.\n\nSample Input 1\n\n3 2 6\n\nSample Output 1\n\n1\n\nThis input corresponds to the figure in the statement. In this case, the second rectangle should be moved to the left by a distance of 1.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n0\n\nThe rectangles are already connected, and thus no move is needed.\n\nSample Input 3\n\n5 10 1\n\nSample Output 3\n\n4", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 153, "memory_kb": 53104}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s321291006", "group_id": "codeNet:p03779", "input_text": "#!/usr/bin/perl\n\nwhile (<>) {\n ($x) = split /\\s/, $_;\n}\n\n$i = 0;\n$d = 0;\nwhile (1) {\n $i++;\n $d += $i;\n if ($x == $d) {\n print \"$i\\n\";\n exit;\n } elsif ($x < $d) {\n print \"$i\\n\";\n exit;\n }\n}\n", "language": "Perl", "metadata": {"date": 1489887962, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03779.html", "problem_id": "p03779", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03779/input.txt", "sample_output_relpath": "derived/input_output/data/p03779/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03779/Perl/s321291006.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s321291006", "user_id": "u669573977"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nwhile (<>) {\n ($x) = split /\\s/, $_;\n}\n\n$i = 0;\n$d = 0;\nwhile (1) {\n $i++;\n $d += $i;\n if ($x == $d) {\n print \"$i\\n\";\n exit;\n } elsif ($x < $d) {\n print \"$i\\n\";\n exit;\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0.\nDuring the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.\nThat is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i.\nThe kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible.\nFind the earliest possible time to reach coordinate X.\n\nConstraints\n\nX is an integer.\n\n1≤X≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the earliest possible time for the kangaroo to reach coordinate X.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThe kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nHe can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.\n\nSample Input 3\n\n11\n\nSample Output 3\n\n5", "sample_input": "6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03779", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0.\nDuring the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.\nThat is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i.\nThe kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible.\nFind the earliest possible time to reach coordinate X.\n\nConstraints\n\nX is an integer.\n\n1≤X≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the earliest possible time for the kangaroo to reach coordinate X.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThe kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nHe can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.\n\nSample Input 3\n\n11\n\nSample Output 3\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 236, "cpu_time_ms": 8, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s697185002", "group_id": "codeNet:p03781", "input_text": "print.5+.5*sqrt~-<>*8+1|0", "language": "Perl", "metadata": {"date": 1489926788, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03781.html", "problem_id": "p03781", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03781/input.txt", "sample_output_relpath": "derived/input_output/data/p03781/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03781/Perl/s697185002.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s697185002", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "print.5+.5*sqrt~-<>*8+1|0", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0.\nDuring the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.\nThat is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i.\nThe kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible.\nFind the earliest possible time to reach coordinate X.\n\nConstraints\n\nX is an integer.\n\n1≤X≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the earliest possible time for the kangaroo to reach coordinate X.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThe kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nHe can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.\n\nSample Input 3\n\n11\n\nSample Output 3\n\n5", "sample_input": "6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03781", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0.\nDuring the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.\nThat is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i.\nThe kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible.\nFind the earliest possible time to reach coordinate X.\n\nConstraints\n\nX is an integer.\n\n1≤X≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the earliest possible time for the kangaroo to reach coordinate X.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThe kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nHe can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.\n\nSample Input 3\n\n11\n\nSample Output 3\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 25, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s945289690", "group_id": "codeNet:p03785", "input_text": "($N,$C,$K)=glob<>;\nfor(sort{$a-$b}<>){\n\tif($_<=$k&&$c<$C){\n\t\t++$c;\n\t}else{\n\t\t++$%;\n\t\t$k=$_+$K;\n\t\t$c=1;\n\t}\n}\nprint$%,$/\n", "language": "Perl", "metadata": {"date": 1489367713, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03785.html", "problem_id": "p03785", "resource_group": "low_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/Perl/s945289690.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s945289690", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "($N,$C,$K)=glob<>;\nfor(sort{$a-$b}<>){\n\tif($_<=$k&&$c<$C){\n\t\t++$c;\n\t}else{\n\t\t++$%;\n\t\t$k=$_+$K;\n\t\t$c=1;\n\t}\n}\nprint$%,$/\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 159, "memory_kb": 18688}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s713408515", "group_id": "codeNet:p03786", "input_text": "print<>-(grep 2*($p+=$t)<($t=$a[$_]),0..(@a=sort{$a-$b}glob<>))[-1]", "language": "Perl", "metadata": {"date": 1552529550, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03786.html", "problem_id": "p03786", "resource_group": "low_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/Perl/s713408515.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s713408515", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "print<>-(grep 2*($p+=$t)<($t=$a[$_]),0..(@a=sort{$a-$b}glob<>))[-1]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 411, "memory_kb": 33392}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s628748442", "group_id": "codeNet:p03786", "input_text": "use v5.18;\nuse warnings;\nuse utf8;\nsub line { chomp(my $str = <>); $str; }\nsub split_line { (split / /, line) }\n\nmy $n = line;\nmy @creatures = sort { $a <=> $b } split_line;\nmy @sums;\nmy $sum = 0;\nfor my $i (0 .. $#creatures) {\n $sum += $creatures[$i];\n $sums[$i] = $sum;\n}\nmy $index = 0;\nfor my $i (0 .. $#creatures - 1) {\n if ($sums[$i] * 2 < $creatures[$i + 1]) {\n $index = $i + 1;\n }\n}\nsay $n - $index;\n", "language": "Perl", "metadata": {"date": 1519332933, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03786.html", "problem_id": "p03786", "resource_group": "low_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/Perl/s628748442.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s628748442", "user_id": "u376692089"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nuse utf8;\nsub line { chomp(my $str = <>); $str; }\nsub split_line { (split / /, line) }\n\nmy $n = line;\nmy @creatures = sort { $a <=> $b } split_line;\nmy @sums;\nmy $sum = 0;\nfor my $i (0 .. $#creatures) {\n $sum += $creatures[$i];\n $sums[$i] = $sum;\n}\nmy $index = 0;\nfor my $i (0 .. $#creatures - 1) {\n if ($sums[$i] * 2 < $creatures[$i + 1]) {\n $index = $i + 1;\n }\n}\nsay $n - $index;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 112, "memory_kb": 23956}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s353950548", "group_id": "codeNet:p03786", "input_text": "$N=<>;\n$i++&&$p*2<$_&&($%=$i-1),$p+=$_ for sort{$a-$b}glob<>;\nprint$N-$%,$/\n", "language": "Perl", "metadata": {"date": 1489369282, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03786.html", "problem_id": "p03786", "resource_group": "low_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/Perl/s353950548.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s353950548", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$N=<>;\n$i++&&$p*2<$_&&($%=$i-1),$p+=$_ for sort{$a-$b}glob<>;\nprint$N-$%,$/\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 338, "memory_kb": 22400}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s402226497", "group_id": "codeNet:p03787", "input_text": "sub f{\n\tmy$s;\n\t$v[$_]=$.;\n\t$.^=2;\n\t$s+=$v[$_]?$v[$_]-$.:f()for@$_;\n\t$.^=2;\n\t$s\n}\n@n=1..<>;\nmap{push@$_,$_[--$|]for@_=glob}<>;\n$v[$_]||${@$_?&f?b:a:c}++for@n;\nprint@n*2*$c-$c*$c+2*$a*$a+$b*$b+2*$a*$b", "language": "Perl", "metadata": {"date": 1552531624, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03787.html", "problem_id": "p03787", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03787/input.txt", "sample_output_relpath": "derived/input_output/data/p03787/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03787/Perl/s402226497.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s402226497", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "sub f{\n\tmy$s;\n\t$v[$_]=$.;\n\t$.^=2;\n\t$s+=$v[$_]?$v[$_]-$.:f()for@$_;\n\t$.^=2;\n\t$s\n}\n@n=1..<>;\nmap{push@$_,$_[--$|]for@_=glob}<>;\n$v[$_]||${@$_?&f?b:a:c}++for@n;\nprint@n*2*$c-$c*$c+2*$a*$a+$b*$b+2*$a*$b", "problem_context": "Score : 800 points\n\nProblem Statement\n\nTakahashi has received an undirected graph with N vertices, numbered 1, 2, ..., N.\nThe edges in this graph are represented by (u_i, v_i).\nThere are no self-loops and multiple edges in this graph.\n\nBased on this graph, Takahashi is now constructing a new graph with N^2 vertices, where each vertex is labeled with a pair of integers (a, b) (1 \\leq a \\leq N, 1 \\leq b \\leq N).\nThe edges in this new graph are generated by the following rule:\n\nSpan an edge between vertices (a, b) and (a', b') if and only if both of the following two edges exist in the original graph: an edge between vertices a and a', and an edge between vertices b and b'.\n\nHow many connected components are there in this new graph?\n\nConstraints\n\n2 \\leq N \\leq 100,000\n\n0 \\leq M \\leq 200,000\n\n1 \\leq u_i < v_i \\leq N\n\nThere exists no pair of distinct integers i and j such that u_i = u_j and v_i = v_j.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nu_1 v_1\nu_2 v_2\n:\nu_M v_M\n\nOutput\n\nPrint the number of the connected components in the graph constructed by Takahashi.\n\nSample Input 1\n\n3 1\n1 2\n\nSample Output 1\n\n7\n\nThe graph constructed by Takahashi is as follows.\n\nSample Input 2\n\n7 5\n1 2\n3 4\n3 5\n4 5\n2 6\n\nSample Output 2\n\n18", "sample_input": "3 1\n1 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03787", "source_text": "Score : 800 points\n\nProblem Statement\n\nTakahashi has received an undirected graph with N vertices, numbered 1, 2, ..., N.\nThe edges in this graph are represented by (u_i, v_i).\nThere are no self-loops and multiple edges in this graph.\n\nBased on this graph, Takahashi is now constructing a new graph with N^2 vertices, where each vertex is labeled with a pair of integers (a, b) (1 \\leq a \\leq N, 1 \\leq b \\leq N).\nThe edges in this new graph are generated by the following rule:\n\nSpan an edge between vertices (a, b) and (a', b') if and only if both of the following two edges exist in the original graph: an edge between vertices a and a', and an edge between vertices b and b'.\n\nHow many connected components are there in this new graph?\n\nConstraints\n\n2 \\leq N \\leq 100,000\n\n0 \\leq M \\leq 200,000\n\n1 \\leq u_i < v_i \\leq N\n\nThere exists no pair of distinct integers i and j such that u_i = u_j and v_i = v_j.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nu_1 v_1\nu_2 v_2\n:\nu_M v_M\n\nOutput\n\nPrint the number of the connected components in the graph constructed by Takahashi.\n\nSample Input 1\n\n3 1\n1 2\n\nSample Output 1\n\n7\n\nThe graph constructed by Takahashi is as follows.\n\nSample Input 2\n\n7 5\n1 2\n3 4\n3 5\n4 5\n2 6\n\nSample Output 2\n\n18", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2114, "memory_kb": 115968}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s100755796", "group_id": "codeNet:p03787", "input_text": "# WA\n($N,$M)=glob<>;\nprint$N**2-$M*($M+1),$/\n", "language": "Perl", "metadata": {"date": 1489370830, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03787.html", "problem_id": "p03787", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03787/input.txt", "sample_output_relpath": "derived/input_output/data/p03787/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03787/Perl/s100755796.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s100755796", "user_id": "u283869437"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "# WA\n($N,$M)=glob<>;\nprint$N**2-$M*($M+1),$/\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nTakahashi has received an undirected graph with N vertices, numbered 1, 2, ..., N.\nThe edges in this graph are represented by (u_i, v_i).\nThere are no self-loops and multiple edges in this graph.\n\nBased on this graph, Takahashi is now constructing a new graph with N^2 vertices, where each vertex is labeled with a pair of integers (a, b) (1 \\leq a \\leq N, 1 \\leq b \\leq N).\nThe edges in this new graph are generated by the following rule:\n\nSpan an edge between vertices (a, b) and (a', b') if and only if both of the following two edges exist in the original graph: an edge between vertices a and a', and an edge between vertices b and b'.\n\nHow many connected components are there in this new graph?\n\nConstraints\n\n2 \\leq N \\leq 100,000\n\n0 \\leq M \\leq 200,000\n\n1 \\leq u_i < v_i \\leq N\n\nThere exists no pair of distinct integers i and j such that u_i = u_j and v_i = v_j.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nu_1 v_1\nu_2 v_2\n:\nu_M v_M\n\nOutput\n\nPrint the number of the connected components in the graph constructed by Takahashi.\n\nSample Input 1\n\n3 1\n1 2\n\nSample Output 1\n\n7\n\nThe graph constructed by Takahashi is as follows.\n\nSample Input 2\n\n7 5\n1 2\n3 4\n3 5\n4 5\n2 6\n\nSample Output 2\n\n18", "sample_input": "3 1\n1 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03787", "source_text": "Score : 800 points\n\nProblem Statement\n\nTakahashi has received an undirected graph with N vertices, numbered 1, 2, ..., N.\nThe edges in this graph are represented by (u_i, v_i).\nThere are no self-loops and multiple edges in this graph.\n\nBased on this graph, Takahashi is now constructing a new graph with N^2 vertices, where each vertex is labeled with a pair of integers (a, b) (1 \\leq a \\leq N, 1 \\leq b \\leq N).\nThe edges in this new graph are generated by the following rule:\n\nSpan an edge between vertices (a, b) and (a', b') if and only if both of the following two edges exist in the original graph: an edge between vertices a and a', and an edge between vertices b and b'.\n\nHow many connected components are there in this new graph?\n\nConstraints\n\n2 \\leq N \\leq 100,000\n\n0 \\leq M \\leq 200,000\n\n1 \\leq u_i < v_i \\leq N\n\nThere exists no pair of distinct integers i and j such that u_i = u_j and v_i = v_j.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nu_1 v_1\nu_2 v_2\n:\nu_M v_M\n\nOutput\n\nPrint the number of the connected components in the graph constructed by Takahashi.\n\nSample Input 1\n\n3 1\n1 2\n\nSample Output 1\n\n7\n\nThe graph constructed by Takahashi is as follows.\n\nSample Input 2\n\n7 5\n1 2\n3 4\n3 5\n4 5\n2 6\n\nSample Output 2\n\n18", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s693928660", "group_id": "codeNet:p03791", "input_text": "<>;$/=$\";$%=1;($%*=~-($t+=!!$_)*2<$_||$t--)%=1e9+7while($_=<>)||$t;print$%", "language": "Perl", "metadata": {"date": 1566813916, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03791.html", "problem_id": "p03791", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03791/input.txt", "sample_output_relpath": "derived/input_output/data/p03791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03791/Perl/s693928660.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s693928660", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "<>;$/=$\";$%=1;($%*=~-($t+=!!$_)*2<$_||$t--)%=1e9+7while($_=<>)||$t;print$%", "problem_context": "Score : 900 points\n\nProblem Statement\n\nYou are developing frog-shaped robots, and decided to race them against each other.\n\nFirst, you placed N robots onto a number line.\nThese robots are numbered 1 through N.\nThe current coordinate of robot i is x_i.\nHere, all x_i are integers, and 0 < x_1 < x_2 < ... < x_N.\n\nYou will repeatedly perform the following operation:\n\nSelect a robot on the number line. Let the coordinate of the robot be x. Select the destination coordinate, either x-1 or x-2, that is not occupied by another robot. The robot now jumps to the selected coordinate.\n\nWhen the coordinate of a robot becomes 0 or less, the robot is considered finished and will be removed from the number line immediately.\nYou will repeat the operation until all the robots finish the race.\n\nDepending on your choice in the operation, the N robots can finish the race in different orders.\nIn how many different orders can the N robots finish the race?\nFind the answer modulo 10^9+7.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\nx_i is an integer.\n\n0 < x_1 < x_2 < ... < x_N ≤ 10^9\n\nPartial Score\n\nIn a test set worth 500 points, N ≤ 8.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the number of the different orders in which the N robots can finish the race, modulo 10^9+7.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n4\n\nThere are four different orders in which the three robots can finish the race:\n\n(Robot 1 → Robot 2 → Robot 3)\n\n(Robot 1 → Robot 3 → Robot 2)\n\n(Robot 2 → Robot 1 → Robot 3)\n\n(Robot 2 → Robot 3 → Robot 1)\n\nSample Input 2\n\n3\n2 3 4\n\nSample Output 2\n\n6\n\nThere are six different orders in which the three robots can finish the race:\n\n(Robot 1 → Robot 2 → Robot 3)\n\n(Robot 1 → Robot 3 → Robot 2)\n\n(Robot 2 → Robot 1 → Robot 3)\n\n(Robot 2 → Robot 3 → Robot 1)\n\n(Robot 3 → Robot 1 → Robot 2)\n\n(Robot 3 → Robot 2 → Robot 1)\n\nFor example, the order (Robot 3 → Robot 2 → Robot 1) can be achieved as shown in the figure below:\n\nSample Input 3\n\n8\n1 2 3 5 7 11 13 17\n\nSample Output 3\n\n10080\n\nSample Input 4\n\n13\n4 6 8 9 10 12 14 15 16 18 20 21 22\n\nSample Output 4\n\n311014372\n\nRemember to print the answer modulo 10^9+7.\nThis case is not included in the test set for the partial score.", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03791", "source_text": "Score : 900 points\n\nProblem Statement\n\nYou are developing frog-shaped robots, and decided to race them against each other.\n\nFirst, you placed N robots onto a number line.\nThese robots are numbered 1 through N.\nThe current coordinate of robot i is x_i.\nHere, all x_i are integers, and 0 < x_1 < x_2 < ... < x_N.\n\nYou will repeatedly perform the following operation:\n\nSelect a robot on the number line. Let the coordinate of the robot be x. Select the destination coordinate, either x-1 or x-2, that is not occupied by another robot. The robot now jumps to the selected coordinate.\n\nWhen the coordinate of a robot becomes 0 or less, the robot is considered finished and will be removed from the number line immediately.\nYou will repeat the operation until all the robots finish the race.\n\nDepending on your choice in the operation, the N robots can finish the race in different orders.\nIn how many different orders can the N robots finish the race?\nFind the answer modulo 10^9+7.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\nx_i is an integer.\n\n0 < x_1 < x_2 < ... < x_N ≤ 10^9\n\nPartial Score\n\nIn a test set worth 500 points, N ≤ 8.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the number of the different orders in which the N robots can finish the race, modulo 10^9+7.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n4\n\nThere are four different orders in which the three robots can finish the race:\n\n(Robot 1 → Robot 2 → Robot 3)\n\n(Robot 1 → Robot 3 → Robot 2)\n\n(Robot 2 → Robot 1 → Robot 3)\n\n(Robot 2 → Robot 3 → Robot 1)\n\nSample Input 2\n\n3\n2 3 4\n\nSample Output 2\n\n6\n\nThere are six different orders in which the three robots can finish the race:\n\n(Robot 1 → Robot 2 → Robot 3)\n\n(Robot 1 → Robot 3 → Robot 2)\n\n(Robot 2 → Robot 1 → Robot 3)\n\n(Robot 2 → Robot 3 → Robot 1)\n\n(Robot 3 → Robot 1 → Robot 2)\n\n(Robot 3 → Robot 2 → Robot 1)\n\nFor example, the order (Robot 3 → Robot 2 → Robot 1) can be achieved as shown in the figure below:\n\nSample Input 3\n\n8\n1 2 3 5 7 11 13 17\n\nSample Output 3\n\n10080\n\nSample Input 4\n\n13\n4 6 8 9 10 12 14 15 16 18 20 21 22\n\nSample Output 4\n\n311014372\n\nRemember to print the answer modulo 10^9+7.\nThis case is not included in the test set for the partial score.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 214, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s865284608", "group_id": "codeNet:p03792", "input_text": "@in1=in();\n$n=$in1[0];\nfor($i=0;$i<$n;$i++){\n@in2=in();\n$x[$i]=$in2[0];\nif(substr($x[$i],$i,1)eq\".\"){next;}\n$cnt=0;\nfor($j=0;$j<$n;$j++){\nif(substr($x[$i],$j,1)eq\"#\"){$cnt++;}\n}if($max<$cnt) {$max=$cnt;}\n}\nif($max==0){print \"-1\";exit;}\n$max=$n-$max;\n\nfor($i=0;$i<$n;$i++){\n$cnt=0;for($j=0;$j<$n;$j++){\nif(substr($x[$j],$i,1)eq\".\"){$cnt++;\nlast;}\n}if($cnt>0){$max++;}\n}\nprint \"$max\";\nsub in {\n$t=;\n$t=~s/[¥r¥n]+//;\nreturn split / /, $t;\n}", "language": "Perl", "metadata": {"date": 1576609780, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03792.html", "problem_id": "p03792", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03792/input.txt", "sample_output_relpath": "derived/input_output/data/p03792/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03792/Perl/s865284608.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s865284608", "user_id": "u004311543"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "@in1=in();\n$n=$in1[0];\nfor($i=0;$i<$n;$i++){\n@in2=in();\n$x[$i]=$in2[0];\nif(substr($x[$i],$i,1)eq\".\"){next;}\n$cnt=0;\nfor($j=0;$j<$n;$j++){\nif(substr($x[$i],$j,1)eq\"#\"){$cnt++;}\n}if($max<$cnt) {$max=$cnt;}\n}\nif($max==0){print \"-1\";exit;}\n$max=$n-$max;\n\nfor($i=0;$i<$n;$i++){\n$cnt=0;for($j=0;$j<$n;$j++){\nif(substr($x[$j],$i,1)eq\".\"){$cnt++;\nlast;}\n}if($cnt>0){$max++;}\n}\nprint \"$max\";\nsub in {\n$t=;\n$t=~s/[¥r¥n]+//;\nreturn split / /, $t;\n}", "problem_context": "Score : 1300 points\n\nProblem Statement\n\nThere is a square-shaped grid with N vertical rows and N horizontal columns.\nWe will denote the square at the i-th row from the top and the j-th column from the left as (i,\\ j).\n\nInitially, each square is either white or black.\nThe initial color of the grid is given to you as characters a_{ij}, arranged in a square shape.\nIf the square (i,\\ j) is white, a_{ij} is .. If it is black, a_{ij} is #.\n\nYou are developing a robot that repaints the grid.\nIt can repeatedly perform the following operation:\n\nSelect two integers i, j (1 ≤ i,\\ j ≤ N). Memorize the colors of the squares (i,\\ 1), (i,\\ 2), ..., (i,\\ N) as c_1, c_2, ..., c_N, respectively. Then, repaint the squares (1,\\ j), (2,\\ j), ..., (N,\\ j) with the colors c_1, c_2, ..., c_N, respectively.\n\nYour objective is to turn all the squares black.\nDetermine whether it is possible, and find the minimum necessary number of operations to achieve it if the answer is positive.\n\nConstraints\n\n2 ≤ N ≤ 500\n\na_{ij} is either . or #.\n\nPartial Score\n\nIn a test set worth 300 points, N ≤ 3.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_{11}...a_{1N}\n:\na_{N1}...a_{NN}\n\nOutput\n\nIf it is possible to turn all the squares black, print the minimum necessary number of operations to achieve the objective.\nIf it is impossible, print -1 instead.\n\nSample Input 1\n\n2\n#.\n.#\n\nSample Output 1\n\n3\n\nFor example, perform the operation as follows:\n\nSelect i = 1, j = 2.\n\nSelect i = 1, j = 1.\n\nSelect i = 1, j = 2.\n\nThe transition of the colors of the squares is shown in the figure below:\n\nSample Input 2\n\n2\n..\n..\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n##\n##\n\nSample Output 3\n\n0\n\nSample Input 4\n\n3\n.#.\n###\n.#.\n\nSample Output 4\n\n2\n\nSample Input 5\n\n3\n...\n.#.\n...\n\nSample Output 5\n\n5", "sample_input": "2\n#.\n.#\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03792", "source_text": "Score : 1300 points\n\nProblem Statement\n\nThere is a square-shaped grid with N vertical rows and N horizontal columns.\nWe will denote the square at the i-th row from the top and the j-th column from the left as (i,\\ j).\n\nInitially, each square is either white or black.\nThe initial color of the grid is given to you as characters a_{ij}, arranged in a square shape.\nIf the square (i,\\ j) is white, a_{ij} is .. If it is black, a_{ij} is #.\n\nYou are developing a robot that repaints the grid.\nIt can repeatedly perform the following operation:\n\nSelect two integers i, j (1 ≤ i,\\ j ≤ N). Memorize the colors of the squares (i,\\ 1), (i,\\ 2), ..., (i,\\ N) as c_1, c_2, ..., c_N, respectively. Then, repaint the squares (1,\\ j), (2,\\ j), ..., (N,\\ j) with the colors c_1, c_2, ..., c_N, respectively.\n\nYour objective is to turn all the squares black.\nDetermine whether it is possible, and find the minimum necessary number of operations to achieve it if the answer is positive.\n\nConstraints\n\n2 ≤ N ≤ 500\n\na_{ij} is either . or #.\n\nPartial Score\n\nIn a test set worth 300 points, N ≤ 3.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_{11}...a_{1N}\n:\na_{N1}...a_{NN}\n\nOutput\n\nIf it is possible to turn all the squares black, print the minimum necessary number of operations to achieve the objective.\nIf it is impossible, print -1 instead.\n\nSample Input 1\n\n2\n#.\n.#\n\nSample Output 1\n\n3\n\nFor example, perform the operation as follows:\n\nSelect i = 1, j = 2.\n\nSelect i = 1, j = 1.\n\nSelect i = 1, j = 2.\n\nThe transition of the colors of the squares is shown in the figure below:\n\nSample Input 2\n\n2\n..\n..\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n##\n##\n\nSample Output 3\n\n0\n\nSample Input 4\n\n3\n.#.\n###\n.#.\n\nSample Output 4\n\n2\n\nSample Input 5\n\n3\n...\n.#.\n...\n\nSample Output 5\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 446, "cpu_time_ms": 131, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s941232956", "group_id": "codeNet:p03795", "input_text": "my $n = +get;\nsay 800 * $n - 200 * ($n div 15);", "language": "Perl", "metadata": {"date": 1561763244, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03795.html", "problem_id": "p03795", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03795/input.txt", "sample_output_relpath": "derived/input_output/data/p03795/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03795/Perl/s941232956.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s941232956", "user_id": "u390181802"}, "prompt_components": {"gold_output": "15800\n", "input_to_evaluate": "my $n = +get;\nsay 800 * $n - 200 * ($n div 15);", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a favorite restaurant.\n\nThe price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.\n\nSo far, Snuke has ordered N meals at the restaurant.\nLet the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen.\nFind x-y.\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 answer.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n15800\n\nSo far, Snuke has paid 16000 yen, and the restaurant has paid back 200 yen. Thus, the answer is 15800.\n\nSample Input 2\n\n60\n\nSample Output 2\n\n47200\n\nSnuke has paid 48000 yen for 60 meals, and the restaurant has paid back 800 yen.", "sample_input": "20\n"}, "reference_outputs": ["15800\n"], "source_document_id": "p03795", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a favorite restaurant.\n\nThe price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.\n\nSo far, Snuke has ordered N meals at the restaurant.\nLet the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen.\nFind x-y.\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 answer.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n15800\n\nSo far, Snuke has paid 16000 yen, and the restaurant has paid back 200 yen. Thus, the answer is 15800.\n\nSample Input 2\n\n60\n\nSample Output 2\n\n47200\n\nSnuke has paid 48000 yen for 60 meals, and the restaurant has paid back 800 yen.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 298, "memory_kb": 63108}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s095824215", "group_id": "codeNet:p03799", "input_text": "$/=get.words;say $0*2+$1+>2 min$1+>1", "language": "Perl", "metadata": {"date": 1538455319, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03799.html", "problem_id": "p03799", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03799/input.txt", "sample_output_relpath": "derived/input_output/data/p03799/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03799/Perl/s095824215.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s095824215", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "$/=get.words;say $0*2+$1+>2 min$1+>1", "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": "p03799", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 133, "memory_kb": 49068}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s599800495", "group_id": "codeNet:p03799", "input_text": "use v6;\n\nmy Int ($n, $m) = get.words>>.Int;\nmy Int $made = 0;\nif 2 * $n >= $m {\n $made = $m div 2;\n}\nelse {\n $made = $n;\n $m -= 2 * $n;\n $made += $m div 4;\n}\n\nsay $made;\n", "language": "Perl", "metadata": {"date": 1487470047, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03799.html", "problem_id": "p03799", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03799/input.txt", "sample_output_relpath": "derived/input_output/data/p03799/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03799/Perl/s599800495.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s599800495", "user_id": "u390181802"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use v6;\n\nmy Int ($n, $m) = get.words>>.Int;\nmy Int $made = 0;\nif 2 * $n >= $m {\n $made = $m div 2;\n}\nelse {\n $made = $n;\n $m -= 2 * $n;\n $made += $m div 4;\n}\n\nsay $made;\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": "p03799", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 543, "memory_kb": 68080}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s921287696", "group_id": "codeNet:p03803", "input_text": "print$/=$\",(Draw,Alice,Bob)[(<>+11)%13<=>(<>+11)%13]", "language": "Perl", "metadata": {"date": 1570730890, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03803.html", "problem_id": "p03803", "resource_group": "low_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/Perl/s921287696.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s921287696", "user_id": "u832039789"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": "print$/=$\",(Draw,Alice,Bob)[(<>+11)%13<=>(<>+11)%13]", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 52, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s938762278", "group_id": "codeNet:p03803", "input_text": "$/=$\";print+(Draw,Alice,Bob)[(<>-2)%13<=>(<>-2)%13],$/,$/", "language": "Perl", "metadata": {"date": 1486888708, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03803.html", "problem_id": "p03803", "resource_group": "low_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/Perl/s938762278.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938762278", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": "$/=$\";print+(Draw,Alice,Bob)[(<>-2)%13<=>(<>-2)%13],$/,$/", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 4, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s322415264", "group_id": "codeNet:p03804", "input_text": "$A.=<>for<>=~$\"..$`;$.-=$';print$A=~`sed 'i(?sx)\na.{$.}'`?Yes:No", "language": "Perl", "metadata": {"date": 1553072553, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "low_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/Perl/s322415264.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s322415264", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$A.=<>for<>=~$\"..$`;$.-=$';print$A=~`sed 'i(?sx)\na.{$.}'`?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 64, "cpu_time_ms": 3, "memory_kb": 796}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s517228594", "group_id": "codeNet:p03804", "input_text": "$A.=<>for<>=~$\"..$`;$.-=$';print$A=~(`dd`=~s/\n/\\\\D{$.}/gr)?Yes:No", "language": "Perl", "metadata": {"date": 1553017299, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "low_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/Perl/s517228594.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s517228594", "user_id": "u700849772"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$A.=<>for<>=~$\"..$`;$.-=$';print$A=~(`dd`=~s/\n/\\\\D{$.}/gr)?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 948}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s351318000", "group_id": "codeNet:p03804", "input_text": "$N+=$`-$',$A.=<>=~s/\n//r for<>=~$\"..$`;print$A=~join(\".{$N}\",map{chop;s/\\./\\\\./gr}<>)?Yes:No", "language": "Perl", "metadata": {"date": 1535696245, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "low_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/Perl/s351318000.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s351318000", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$N+=$`-$',$A.=<>=~s/\n//r for<>=~$\"..$`;print$A=~join(\".{$N}\",map{chop;s/\\./\\\\./gr}<>)?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 92, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s891157098", "group_id": "codeNet:p03804", "input_text": "my ($n,$m)=+<$i {\n\tfor 0..$n-$m ->$j {\n\t\tmy$f=1;\n\t\tfor ^$m ->$k {\n\t\t\tif !$a[$i+$k].substr-eq($b[$k],$j) {\n\t\t\t\t$f=0;\n\t\t\t\tlast;\n\t\t\t}\n\t\t}\n $s+=$f;\n\t}\n}\nsay $s>0??\"Yes\"!!\"No\";", "language": "Perl", "metadata": {"date": 1535431075, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "low_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/Perl/s891157098.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s891157098", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my ($n,$m)=+<$i {\n\tfor 0..$n-$m ->$j {\n\t\tmy$f=1;\n\t\tfor ^$m ->$k {\n\t\t\tif !$a[$i+$k].substr-eq($b[$k],$j) {\n\t\t\t\t$f=0;\n\t\t\t\tlast;\n\t\t\t}\n\t\t}\n $s+=$f;\n\t}\n}\nsay $s>0??\"Yes\"!!\"No\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 574, "memory_kb": 75364}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s572237674", "group_id": "codeNet:p03804", "input_text": "$N+=$`-$',$A.=<>=~s/\n//r for<>=~$\"..$`;print$A=~join(\".{$N}\",map{chop;s/\\./\\\\./gr}<>)?Yes:No", "language": "Perl", "metadata": {"date": 1535423786, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "low_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/Perl/s572237674.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s572237674", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "$N+=$`-$',$A.=<>=~s/\n//r for<>=~$\"..$`;print$A=~join(\".{$N}\",map{chop;s/\\./\\\\./gr}<>)?Yes:No", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 92, "cpu_time_ms": 8, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s016748572", "group_id": "codeNet:p03805", "input_text": "use strict;\nuse warnings;\n\nmy $g = [];\n\nsub main {\n chomp(my $s = );\n my ($N,$M) = split(/ /,$s);\n my (@ab);\n for(1..$M){\n chomp(my $tmp = );\n push @ab, [split(/ /, $tmp)];\n }\n print solver($N,$M,\\@ab);\n}\nmain() unless caller;\n\nsub solver {\n my ($N,$M,$ab) = @_;\n my %x;\n\n for my $i(0..$M-1) {\n my $u = $ab->[$i]->[0];\n my $v = $ab->[$i]->[1];\n $g->[$u] = $g->[$u] ? $g->[$u] : [];\n $g->[$v] = $g->[$v] ? $g->[$v] : [];\n $g->[$u-1]->[$v-1] = 1;\n $g->[$v-1]->[$u-1] = 1;\n }\n my $visited = [];\n for my $i(0..$N-1){\n $visited->[$i]=0;\n }\n $visited->[0]=1;\n return dfs(0,$N,$visited);\n}\n\nsub dfs {\n my ($v, $N, $visited) = @_;\n \n my $all_visited = 1;\n \n for my $i(0..$N-1){\n if($visited->[$i] == 0){\n $all_visited = 0;\n }\n }\n if($all_visited){\n return 1;\n }\n my $ret=0;\n\n for my $i(0..$N-1){\n next if(!$g->[$v]->[$i]);\n next if($visited->[$i]);\n\n $visited->[$i]=1;\n $ret += dfs($i,$N,$visited);\n $visited->[$i]=0;\n }\n\n return $ret;\n}", "language": "Perl", "metadata": {"date": 1567718935, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03805.html", "problem_id": "p03805", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03805/input.txt", "sample_output_relpath": "derived/input_output/data/p03805/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03805/Perl/s016748572.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s016748572", "user_id": "u555298461"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy $g = [];\n\nsub main {\n chomp(my $s = );\n my ($N,$M) = split(/ /,$s);\n my (@ab);\n for(1..$M){\n chomp(my $tmp = );\n push @ab, [split(/ /, $tmp)];\n }\n print solver($N,$M,\\@ab);\n}\nmain() unless caller;\n\nsub solver {\n my ($N,$M,$ab) = @_;\n my %x;\n\n for my $i(0..$M-1) {\n my $u = $ab->[$i]->[0];\n my $v = $ab->[$i]->[1];\n $g->[$u] = $g->[$u] ? $g->[$u] : [];\n $g->[$v] = $g->[$v] ? $g->[$v] : [];\n $g->[$u-1]->[$v-1] = 1;\n $g->[$v-1]->[$u-1] = 1;\n }\n my $visited = [];\n for my $i(0..$N-1){\n $visited->[$i]=0;\n }\n $visited->[0]=1;\n return dfs(0,$N,$visited);\n}\n\nsub dfs {\n my ($v, $N, $visited) = @_;\n \n my $all_visited = 1;\n \n for my $i(0..$N-1){\n if($visited->[$i] == 0){\n $all_visited = 0;\n }\n }\n if($all_visited){\n return 1;\n }\n my $ret=0;\n\n for my $i(0..$N-1){\n next if(!$g->[$v]->[$i]);\n next if($visited->[$i]);\n\n $visited->[$i]=1;\n $ret += dfs($i,$N,$visited);\n $visited->[$i]=0;\n }\n\n return $ret;\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an undirected unweighted graph with N vertices and M edges that contains neither self-loops nor double edges.\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); $str; }\nsub split_line { (split / /, line) }\n\nmy $n = line;\nmy @nums = split_line;\nmy $odd_num = 0;\nfor my $num (@nums) {\n $odd_num++ if $num % 2 == 1;\n}\nsay $odd_num % 2 == 1 ? 'NO' : 'YES';\n", "language": "Perl", "metadata": {"date": 1519329153, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03807.html", "problem_id": "p03807", "resource_group": "low_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/Perl/s876205570.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s876205570", "user_id": "u376692089"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "use v5.18;\nuse warnings;\nuse utf8;\nsub line { chomp(my $str = <>); $str; }\nsub split_line { (split / /, line) }\n\nmy $n = line;\nmy @nums = split_line;\nmy $odd_num = 0;\nfor my $num (@nums) {\n $odd_num++ if $num % 2 == 1;\n}\nsay $odd_num % 2 == 1 ? 'NO' : 'YES';\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 260, "cpu_time_ms": 47, "memory_kb": 17376}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s906731919", "group_id": "codeNet:p03808", "input_text": "<>;$d[$i++]=$A[$i-1]-$_,$k+=$_*2for@A=glob<>;print+($k/=@A*@A+@A)=~/\\./|grep(($_-=$k)%@A|/-/,@d)?NO:YES", "language": "Perl", "metadata": {"date": 1486376253, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03808.html", "problem_id": "p03808", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03808/input.txt", "sample_output_relpath": "derived/input_output/data/p03808/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03808/Perl/s906731919.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s906731919", "user_id": "u283869437"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "<>;$d[$i++]=$A[$i-1]-$_,$k+=$_*2for@A=glob<>;print+($k/=@A*@A+@A)=~/\\./|grep(($_-=$k)%@A|/-/,@d)?NO:YES", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N boxes arranged in a circle. The i-th box contains A_i stones.\n\nDetermine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation:\n\nSelect one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j)-th box. Here, the (N+k)-th box is identified with the k-th box.\n\nNote that the operation cannot be performed if there is a box that does not contain enough number of stones to be removed.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\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 remove all the stones from the boxes, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n4 5 1 2 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed in one operation by selecting the second box.\n\nSample Input 2\n\n5\n6 9 12 10 8\n\nSample Output 2\n\nYES\n\nSample Input 3\n\n4\n1 2 3 1\n\nSample Output 3\n\nNO", "sample_input": "5\n4 5 1 2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03808", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N boxes arranged in a circle. The i-th box contains A_i stones.\n\nDetermine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation:\n\nSelect one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j)-th box. Here, the (N+k)-th box is identified with the k-th box.\n\nNote that the operation cannot be performed if there is a box that does not contain enough number of stones to be removed.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\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 remove all the stones from the boxes, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n4 5 1 2 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed in one operation by selecting the second box.\n\nSample Input 2\n\n5\n6 9 12 10 8\n\nSample Output 2\n\nYES\n\nSample Input 3\n\n4\n1 2 3 1\n\nSample Output 3\n\nNO", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 670, "memory_kb": 32520}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s854720010", "group_id": "codeNet:p03813", "input_text": "my $n = $*IN.get.Int;\nif $n < 1200 { say \"ABC\"; } else { say \"ARC\"; }\n", "language": "Perl", "metadata": {"date": 1529316975, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03813.html", "problem_id": "p03813", "resource_group": "low_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/Perl/s854720010.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s854720010", "user_id": "u714587753"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "my $n = $*IN.get.Int;\nif $n < 1200 { say \"ABC\"; } else { say \"ARC\"; }\n", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 135, "memory_kb": 50292}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s904006084", "group_id": "codeNet:p03813", "input_text": "use strict;\nuse utf8;\nuse warnings;\n\nmy $x = ;\nchomp($x);\nif ($x < 1200){\n print \"ABC\\n\";\n}else{\n print \"ARC\\n\";\n}", "language": "Perl", "metadata": {"date": 1486334598, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03813.html", "problem_id": "p03813", "resource_group": "low_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/Perl/s904006084.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s904006084", "user_id": "u566924053"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "use strict;\nuse utf8;\nuse warnings;\n\nmy $x = ;\nchomp($x);\nif ($x < 1200){\n print \"ABC\\n\";\n}else{\n print \"ARC\\n\";\n}", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 127, "cpu_time_ms": 6, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s523610600", "group_id": "codeNet:p03815", "input_text": "say (2*get+9)/11", "language": "Perl", "metadata": {"date": 1560237286, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03815.html", "problem_id": "p03815", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03815/input.txt", "sample_output_relpath": "derived/input_output/data/p03815/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03815/Perl/s523610600.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s523610600", "user_id": "u286941902"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "say (2*get+9)/11", "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": "p03815", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 16, "cpu_time_ms": 274, "memory_kb": 62080}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s390602763", "group_id": "codeNet:p03815", "input_text": "use strict;\nuse utf8;\nuse warnings;\n\nmy $x = ;\nchomp($x);\nmy $t= int($x % 11);\nmy $ans = int($x / 11);\nmy $d = $x - $ans*11;\n$ans *= 2;\nif ($d <= 6) {\n $ans += 1;\n}elsif ($d < 11){\n $ans += 2;\n}\nif ($t == 0){\n $ans -= 1;\n}\n\nprint \"$ans\\n\";", "language": "Perl", "metadata": {"date": 1486338280, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03815.html", "problem_id": "p03815", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03815/input.txt", "sample_output_relpath": "derived/input_output/data/p03815/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03815/Perl/s390602763.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390602763", "user_id": "u566924053"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "use strict;\nuse utf8;\nuse warnings;\n\nmy $x = ;\nchomp($x);\nmy $t= int($x % 11);\nmy $ans = int($x / 11);\nmy $d = $x - $ans*11;\n$ans *= 2;\nif ($d <= 6) {\n $ans += 1;\n}elsif ($d < 11){\n $ans += 2;\n}\nif ($t == 0){\n $ans -= 1;\n}\n\nprint \"$ans\\n\";", "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": "p03815", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s703991248", "group_id": "codeNet:p03818", "input_text": "say words.Set-2+|1", "language": "Perl", "metadata": {"date": 1592656596, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03818.html", "problem_id": "p03818", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03818/input.txt", "sample_output_relpath": "derived/input_output/data/p03818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03818/Perl/s703991248.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s703991248", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "say words.Set-2+|1", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has decided to play a game using cards.\nHe has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written.\n\nHe will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of remaining cards. Here, N is odd, which guarantees that at least one card can be kept.\n\nOperation: Take out three arbitrary cards from the deck. Among those three cards, eat two: one with the largest value, and another with the smallest value. Then, return the remaining one card to the deck.\n\nConstraints\n\n3 ≦ N ≦ 10^{5}\n\nN is odd.\n\n1 ≦ A_i ≦ 10^{5}\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_3 ... A_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n1 2 1 3 7\n\nSample Output 1\n\n3\n\nOne optimal solution is to perform the operation once, taking out two cards with 1 and one card with 2. One card with 1 and another with 2 will be eaten, and the remaining card with 1 will be returned to deck. Then, the values written on the remaining cards in the deck will be pairwise distinct: 1, 3 and 7.\n\nSample Input 2\n\n15\n1 3 5 2 1 3 2 8 8 6 2 6 11 1 1\n\nSample Output 2\n\n7", "sample_input": "5\n1 2 1 3 7\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03818", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has decided to play a game using cards.\nHe has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written.\n\nHe will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of remaining cards. Here, N is odd, which guarantees that at least one card can be kept.\n\nOperation: Take out three arbitrary cards from the deck. Among those three cards, eat two: one with the largest value, and another with the smallest value. Then, return the remaining one card to the deck.\n\nConstraints\n\n3 ≦ N ≦ 10^{5}\n\nN is odd.\n\n1 ≦ A_i ≦ 10^{5}\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_3 ... A_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n1 2 1 3 7\n\nSample Output 1\n\n3\n\nOne optimal solution is to perform the operation once, taking out two cards with 1 and one card with 2. One card with 1 and another with 2 will be eaten, and the remaining card with 1 will be returned to deck. Then, the values written on the remaining cards in the deck will be pairwise distinct: 1, 3 and 7.\n\nSample Input 2\n\n15\n1 3 5 2 1 3 2 8 8 6 2 6 11 1 1\n\nSample Output 2\n\n7", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 18, "cpu_time_ms": 469, "memory_kb": 118896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s598829772", "group_id": "codeNet:p03822", "input_text": "sub f{my$i;(sort{$b-$a}map++$i+$_,sort{$b-$a}map&f,@$_)[0]}push@{$_+??},++$@for<>;print f$_=1", "language": "Perl", "metadata": {"date": 1571945931, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03822.html", "problem_id": "p03822", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03822/input.txt", "sample_output_relpath": "derived/input_output/data/p03822/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03822/Perl/s598829772.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s598829772", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "sub f{my$i;(sort{$b-$a}map++$i+$_,sort{$b-$a}map&f,@$_)[0]}push@{$_+??},++$@for<>;print f$_=1", "problem_context": "Score : 800 points\n\nProblem Statement\n\nN contestants participated in a competition. The total of N-1 matches were played in a knockout tournament.\nFor some reasons, the tournament may not be \"fair\" for all the contestants.\nThat is, the number of the matches that must be played in order to win the championship may be different for each contestant. The structure of the tournament is formally described at the end of this statement.\n\nAfter each match, there were always one winner and one loser. The last contestant standing was declared the champion.\n\nFigure: an example of a tournament\n\nFor convenience, the contestants were numbered 1 through N. The contestant numbered 1 was the champion, and the contestant numbered i(2 ≦ i ≦ N) was defeated in a match against the contestant numbered a_i.\n\nWe will define the depth of the tournament as the maximum number of the matches that must be played in order to win the championship over all the contestants.\n\nFind the minimum possible depth of the tournament.\n\nThe formal description of the structure of the tournament is as follows. In the i-th match, one of the following played against each other:\n\nTwo predetermined contestants\n\nOne predetermined contestant and the winner of the j-th match, where j(j+0},$_ for 2..<>;print f$_=1", "language": "Perl", "metadata": {"date": 1521268282, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03822.html", "problem_id": "p03822", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03822/input.txt", "sample_output_relpath": "derived/input_output/data/p03822/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03822/Perl/s977991228.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s977991228", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "sub f{my$i;(sort{$b-$a}map++$i+$_,sort{$b-$a}map&f+0,@$_)[0]}push@{<>+0},$_ for 2..<>;print f$_=1", "problem_context": "Score : 800 points\n\nProblem Statement\n\nN contestants participated in a competition. The total of N-1 matches were played in a knockout tournament.\nFor some reasons, the tournament may not be \"fair\" for all the contestants.\nThat is, the number of the matches that must be played in order to win the championship may be different for each contestant. The structure of the tournament is formally described at the end of this statement.\n\nAfter each match, there were always one winner and one loser. The last contestant standing was declared the champion.\n\nFigure: an example of a tournament\n\nFor convenience, the contestants were numbered 1 through N. The contestant numbered 1 was the champion, and the contestant numbered i(2 ≦ i ≦ N) was defeated in a match against the contestant numbered a_i.\n\nWe will define the depth of the tournament as the maximum number of the matches that must be played in order to win the championship over all the contestants.\n\nFind the minimum possible depth of the tournament.\n\nThe formal description of the structure of the tournament is as follows. In the i-th match, one of the following played against each other:\n\nTwo predetermined contestants\n\nOne predetermined contestant and the winner of the j-th match, where j(j;\n$area1=$a*$b;\n$area2=$c*$d;\nif($area1>=$area2){\n\tprint $area1;\n}else{\n\tprint $area2;\n}", "language": "Perl", "metadata": {"date": 1568461640, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03826.html", "problem_id": "p03826", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03826/input.txt", "sample_output_relpath": "derived/input_output/data/p03826/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03826/Perl/s399415978.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s399415978", "user_id": "u124498235"}, "prompt_components": {"gold_output": "15\n", "input_to_evaluate": "($a,$b,$c,$d) = split/ /,<>;\n$area1=$a*$b;\n$area2=$c*$d;\nif($area1>=$area2){\n\tprint $area1;\n}else{\n\tprint $area2;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "sample_input": "3 5 2 7\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03826", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 115, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s011156309", "group_id": "codeNet:p03826", "input_text": "get~~m:g/\\d+/;say max $0*$1,$2*$3", "language": "Perl", "metadata": {"date": 1528263849, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03826.html", "problem_id": "p03826", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03826/input.txt", "sample_output_relpath": "derived/input_output/data/p03826/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03826/Perl/s011156309.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s011156309", "user_id": "u657913472"}, "prompt_components": {"gold_output": "15\n", "input_to_evaluate": "get~~m:g/\\d+/;say max $0*$1,$2*$3", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "sample_input": "3 5 2 7\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03826", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 33, "cpu_time_ms": 155, "memory_kb": 52584}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s420401424", "group_id": "codeNet:p03826", "input_text": "$m--;@a=split //,<>;foreach(@a){$c+=$_ eq I?1:-1;$m=$c if($m<$c)}print \"$m\\n\"", "language": "Perl", "metadata": {"date": 1485489767, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03826.html", "problem_id": "p03826", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03826/input.txt", "sample_output_relpath": "derived/input_output/data/p03826/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03826/Perl/s420401424.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s420401424", "user_id": "u485495271"}, "prompt_components": {"gold_output": "15\n", "input_to_evaluate": "$m--;@a=split //,<>;foreach(@a){$c+=$_ eq I?1:-1;$m=$c if($m<$c)}print \"$m\\n\"", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "sample_input": "3 5 2 7\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03826", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 77, "cpu_time_ms": 4, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s619723755", "group_id": "codeNet:p03827", "input_text": "#!perl -p0\n$_=s;DI;;?redo:y;I;", "language": "Perl", "metadata": {"date": 1553021954, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03827.html", "problem_id": "p03827", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03827/input.txt", "sample_output_relpath": "derived/input_output/data/p03827/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03827/Perl/s619723755.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s619723755", "user_id": "u700849772"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!perl -p0\n$_=s;DI;;?redo:y;I;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "sample_input": "5\nIIDID\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03827", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 30, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s054584913", "group_id": "codeNet:p03827", "input_text": "get;say max [\\+] 0,|map *%2*2-1,get.ords", "language": "Perl", "metadata": {"date": 1535448782, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03827.html", "problem_id": "p03827", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03827/input.txt", "sample_output_relpath": "derived/input_output/data/p03827/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03827/Perl/s054584913.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s054584913", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get;say max [\\+] 0,|map *%2*2-1,get.ords", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "sample_input": "5\nIIDID\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03827", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 40, "cpu_time_ms": 146, "memory_kb": 52716}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s284784754", "group_id": "codeNet:p03827", "input_text": "get;say max 0,[\\+] map {?/I/*2-1},get.comb", "language": "Perl", "metadata": {"date": 1535448404, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03827.html", "problem_id": "p03827", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03827/input.txt", "sample_output_relpath": "derived/input_output/data/p03827/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03827/Perl/s284784754.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s284784754", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "get;say max 0,[\\+] map {?/I/*2-1},get.comb", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "sample_input": "5\nIIDID\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03827", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 171, "memory_kb": 56984}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s847318362", "group_id": "codeNet:p03830", "input_text": "$%=<>;${-$_}++for glob`seq $%|factor`;($.*=$$_)%=1e9+7for-$%..2;print$.", "language": "Perl", "metadata": {"date": 1572484964, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03830.html", "problem_id": "p03830", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03830/input.txt", "sample_output_relpath": "derived/input_output/data/p03830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03830/Perl/s847318362.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s847318362", "user_id": "u832039789"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$%=<>;${-$_}++for glob`seq $%|factor`;($.*=$$_)%=1e9+7for-$%..2;print$.", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "sample_input": "3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03830", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 15, "memory_kb": 1988}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s932892543", "group_id": "codeNet:p03830", "input_text": "$%=<>;${-$_}++for`seq $%|factor`=~/\\d+/g;($.*=$$_+1)%=1e9+7for-$<..-2;print$.", "language": "Perl", "metadata": {"date": 1572484729, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03830.html", "problem_id": "p03830", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03830/input.txt", "sample_output_relpath": "derived/input_output/data/p03830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03830/Perl/s932892543.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s932892543", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$%=<>;${-$_}++for`seq $%|factor`=~/\\d+/g;($.*=$$_+1)%=1e9+7for-$<..-2;print$.", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "sample_input": "3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03830", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 77, "cpu_time_ms": 8, "memory_kb": 1240}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s209072595", "group_id": "codeNet:p03830", "input_text": "$%=<>;$_{$_}++for`seq $%|factor`=~/ \\d+/g;($.*=$_{$_}+1)%=1e9+7for keys%_;print$.", "language": "Perl", "metadata": {"date": 1572484189, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03830.html", "problem_id": "p03830", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03830/input.txt", "sample_output_relpath": "derived/input_output/data/p03830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03830/Perl/s209072595.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s209072595", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$%=<>;$_{$_}++for`seq $%|factor`=~/ \\d+/g;($.*=$_{$_}+1)%=1e9+7for keys%_;print$.", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "sample_input": "3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03830", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 924}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s854008683", "group_id": "codeNet:p03834", "input_text": "chomp($s=<>);\n$s=~s/,/ /g;\nprint $s;", "language": "Perl", "metadata": {"date": 1570374057, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03834.html", "problem_id": "p03834", "resource_group": "low_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/Perl/s854008683.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s854008683", "user_id": "u124498235"}, "prompt_components": {"gold_output": "happy newyear enjoy\n", "input_to_evaluate": "chomp($s=<>);\n$s=~s/,/ /g;\nprint $s;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s112061597", "group_id": "codeNet:p03836", "input_text": "chomp($s=<>);\n($sx,$sy,$tx,$ty) = split/ /,$s;\n\n$ucnt=$ty-$sy;\n$rcnt=$tx-$sx;\n\n$val= 'U' x $ucnt;\n$val.= 'R' x $rcnt;\n$val.= 'D' x $ucnt;\n$val.= 'L' x $rcnt;\n$val.= 'L';\n$val.= 'U' x ($ucnt+1);\n$val.= 'R' x ($rcnt+1);\n$val.= 'D';\n$val.= 'R';\n$val.= 'D' x ($ucnt+1);\n$val.= 'L' x ($rcnt+1);\n$val.= 'U';\nprint $val;", "language": "Perl", "metadata": {"date": 1570375811, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03836.html", "problem_id": "p03836", "resource_group": "low_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/Perl/s112061597.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s112061597", "user_id": "u124498235"}, "prompt_components": {"gold_output": "UURDDLLUUURRDRDDDLLU\n", "input_to_evaluate": "chomp($s=<>);\n($sx,$sy,$tx,$ty) = split/ /,$s;\n\n$ucnt=$ty-$sy;\n$rcnt=$tx-$sx;\n\n$val= 'U' x $ucnt;\n$val.= 'R' x $rcnt;\n$val.= 'D' x $ucnt;\n$val.= 'L' x $rcnt;\n$val.= 'L';\n$val.= 'U' x ($ucnt+1);\n$val.= 'R' x ($rcnt+1);\n$val.= 'D';\n$val.= 'R';\n$val.= 'D' x ($ucnt+1);\n$val.= 'L' x ($rcnt+1);\n$val.= 'U';\nprint $val;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s241502458", "group_id": "codeNet:p03837", "input_text": "sub f{$_[$_[1]<$_[0]]}\n \nfor$i(@N=1..<>){\n\t$_[$i][$_]=1e9for@N;\n\t$_[$i][$i]=0;\n}\n/ .* /,$_[$`][$&]=$_[$&][$`]=$' for@M=<>;\n \nfor$m(@N){\n\tfor$x(@N){\n\t\tfor$y(@N){\n\t\t\t$_[$x][$y]=f($_[$x][$y],$_[$x][$m]+$_[$m][$y]);\n\t\t}\n\t}\n}\n/ .* /,$\\+=$_[$`][$&]<$' for@M;\n \nprint\n", "language": "Perl", "metadata": {"date": 1483917111, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03837.html", "problem_id": "p03837", "resource_group": "low_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/Perl/s241502458.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s241502458", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "sub f{$_[$_[1]<$_[0]]}\n \nfor$i(@N=1..<>){\n\t$_[$i][$_]=1e9for@N;\n\t$_[$i][$i]=0;\n}\n/ .* /,$_[$`][$&]=$_[$&][$`]=$' for@M=<>;\n \nfor$m(@N){\n\tfor$x(@N){\n\t\tfor$y(@N){\n\t\t\t$_[$x][$y]=f($_[$x][$y],$_[$x][$m]+$_[$m][$y]);\n\t\t}\n\t}\n}\n/ .* /,$\\+=$_[$`][$&]<$' for@M;\n \nprint\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>.abs.min+1", "language": "Perl", "metadata": {"date": 1589428745, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03838.html", "problem_id": "p03838", "resource_group": "low_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/Perl/s979867533.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s979867533", "user_id": "u657913472"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "$/=words;say ($0,+^$0 X+$1)>>.abs.min+1", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 182, "memory_kb": 84488}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s320095283", "group_id": "codeNet:p03838", "input_text": "say { abs(.[0]) - abs(.[1]) + (.[0] < 0 < .[1] ?? 1 !! 0) }($*IN.get.split(\" \")>>.Int.sort)", "language": "Perl", "metadata": {"date": 1483583208, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03838.html", "problem_id": "p03838", "resource_group": "low_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/Perl/s320095283.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s320095283", "user_id": "u502845410"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "say { abs(.[0]) - abs(.[1]) + (.[0] < 0 < .[1] ?? 1 !! 0) }($*IN.get.split(\" \")>>.Int.sort)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 346, "memory_kb": 63988}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s246779712", "group_id": "codeNet:p03838", "input_text": "($x,$y)=glob<>;\nif($x==0){\n\tprint abs($y)+($y<0),$/\n}elsif($y==0){\n\tprint abs($x)+($x>0),$/\n}elsif($x*$y<0){\n\tprint abs(abs($y)-abs($x))+1,$/\n}elsif($x<$y){\n\tprint$y-$x,$/\n}else{\n\tprint abs(abs($y)-abs($x))+2,$/\n}\n", "language": "Perl", "metadata": {"date": 1482719323, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03838.html", "problem_id": "p03838", "resource_group": "low_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/Perl/s246779712.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s246779712", "user_id": "u283869437"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "($x,$y)=glob<>;\nif($x==0){\n\tprint abs($y)+($y<0),$/\n}elsif($y==0){\n\tprint abs($x)+($x>0),$/\n}elsif($x*$y<0){\n\tprint abs(abs($y)-abs($x))+1,$/\n}elsif($x<$y){\n\tprint$y-$x,$/\n}else{\n\tprint abs(abs($y)-abs($x))+2,$/\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s478578304", "group_id": "codeNet:p03840", "input_text": "use v6;\n\nmy ($i, $o, $t, $j, $l, $s, $z) = +<", "language": "Perl", "metadata": {"date": 1528261567, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03844.html", "problem_id": "p03844", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03844/input.txt", "sample_output_relpath": "derived/input_output/data/p03844/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03844/Perl/s054709723.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s054709723", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "print eval<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nJoisino wants to evaluate the formula \"A op B\".\nHere, A and B are integers, and the binary operator op is either + or -.\nYour task is to evaluate the formula instead of her.\n\nConstraints\n\n1≦A,B≦10^9\n\nop is either + or -.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA op B\n\nOutput\n\nEvaluate the formula and print the result.\n\nSample Input 1\n\n1 + 2\n\nSample Output 1\n\n3\n\nSince 1 + 2 = 3, the output should be 3.\n\nSample Input 2\n\n5 - 7\n\nSample Output 2\n\n-2", "sample_input": "1 + 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03844", "source_text": "Score : 100 points\n\nProblem Statement\n\nJoisino wants to evaluate the formula \"A op B\".\nHere, A and B are integers, and the binary operator op is either + or -.\nYour task is to evaluate the formula instead of her.\n\nConstraints\n\n1≦A,B≦10^9\n\nop is either + or -.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA op B\n\nOutput\n\nEvaluate the formula and print the result.\n\nSample Input 1\n\n1 + 2\n\nSample Output 1\n\n3\n\nSince 1 + 2 = 3, the output should be 3.\n\nSample Input 2\n\n5 - 7\n\nSample Output 2\n\n-2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 12, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s290234228", "group_id": "codeNet:p03845", "input_text": "<>;$t+=$_ for@T=glob<>;<>;print$t-$T[$`-/ /]+$',$/for<>", "language": "Perl", "metadata": {"date": 1483241637, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03845.html", "problem_id": "p03845", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03845/input.txt", "sample_output_relpath": "derived/input_output/data/p03845/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03845/Perl/s290234228.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s290234228", "user_id": "u283869437"}, "prompt_components": {"gold_output": "6\n9\n", "input_to_evaluate": "<>;$t+=$_ for@T=glob<>;<>;print$t-$T[$`-/ /]+$',$/for<>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nJoisino is about to compete in the final round of a certain programming competition.\nIn this contest, there are N problems, numbered 1 through N.\nJoisino knows that it takes her T_i seconds to solve problem i(1≦i≦N).\n\nAlso, there are M kinds of drinks offered to the contestants, numbered 1 through M.\nIf Joisino takes drink i(1≦i≦M), her brain will be stimulated and the time it takes for her to solve problem P_i will become X_i seconds.\nIt does not affect the time to solve the other problems.\n\nA contestant is allowed to take exactly one of the drinks before the start of the contest.\nFor each drink, Joisino wants to know how many seconds it takes her to solve all the problems if she takes that drink.\nHere, assume that the time it takes her to solve all the problems is equal to the sum of the time it takes for her to solve individual problems.\nYour task is to write a program to calculate it instead of her.\n\nConstraints\n\nAll input values are integers.\n\n1≦N≦100\n\n1≦T_i≦10^5\n\n1≦M≦100\n\n1≦P_i≦N\n\n1≦X_i≦10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nM\nP_1 X_1\nP_2 X_2\n:\nP_M X_M\n\nOutput\n\nFor each drink, calculate how many seconds it takes Joisino to solve all the problems if she takes that drink, and print the results, one per line.\n\nSample Input 1\n\n3\n2 1 4\n2\n1 1\n2 3\n\nSample Output 1\n\n6\n9\n\nIf Joisino takes drink 1, the time it takes her to solve each problem will be 1, 1 and 4 seconds, respectively, totaling 6 seconds.\n\nIf Joisino takes drink 2, the time it takes her to solve each problem will be 2, 3 and 4 seconds, respectively, totaling 9 seconds.\n\nSample Input 2\n\n5\n7 2 3 8 5\n3\n4 2\n1 7\n4 13\n\nSample Output 2\n\n19\n25\n30", "sample_input": "3\n2 1 4\n2\n1 1\n2 3\n"}, "reference_outputs": ["6\n9\n"], "source_document_id": "p03845", "source_text": "Score : 200 points\n\nProblem Statement\n\nJoisino is about to compete in the final round of a certain programming competition.\nIn this contest, there are N problems, numbered 1 through N.\nJoisino knows that it takes her T_i seconds to solve problem i(1≦i≦N).\n\nAlso, there are M kinds of drinks offered to the contestants, numbered 1 through M.\nIf Joisino takes drink i(1≦i≦M), her brain will be stimulated and the time it takes for her to solve problem P_i will become X_i seconds.\nIt does not affect the time to solve the other problems.\n\nA contestant is allowed to take exactly one of the drinks before the start of the contest.\nFor each drink, Joisino wants to know how many seconds it takes her to solve all the problems if she takes that drink.\nHere, assume that the time it takes her to solve all the problems is equal to the sum of the time it takes for her to solve individual problems.\nYour task is to write a program to calculate it instead of her.\n\nConstraints\n\nAll input values are integers.\n\n1≦N≦100\n\n1≦T_i≦10^5\n\n1≦M≦100\n\n1≦P_i≦N\n\n1≦X_i≦10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nM\nP_1 X_1\nP_2 X_2\n:\nP_M X_M\n\nOutput\n\nFor each drink, calculate how many seconds it takes Joisino to solve all the problems if she takes that drink, and print the results, one per line.\n\nSample Input 1\n\n3\n2 1 4\n2\n1 1\n2 3\n\nSample Output 1\n\n6\n9\n\nIf Joisino takes drink 1, the time it takes her to solve each problem will be 1, 1 and 4 seconds, respectively, totaling 6 seconds.\n\nIf Joisino takes drink 2, the time it takes her to solve each problem will be 2, 3 and 4 seconds, respectively, totaling 9 seconds.\n\nSample Input 2\n\n5\n7 2 3 8 5\n3\n4 2\n1 7\n4 13\n\nSample Output 2\n\n19\n25\n30", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 55, "cpu_time_ms": 8, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s910616202", "group_id": "codeNet:p03845", "input_text": "<>;$t+=$_ for@T=glob<>;<>;/ /,print$t-$T[$`-1]+$',$/for<>", "language": "Perl", "metadata": {"date": 1483241524, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03845.html", "problem_id": "p03845", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03845/input.txt", "sample_output_relpath": "derived/input_output/data/p03845/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03845/Perl/s910616202.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s910616202", "user_id": "u283869437"}, "prompt_components": {"gold_output": "6\n9\n", "input_to_evaluate": "<>;$t+=$_ for@T=glob<>;<>;/ /,print$t-$T[$`-1]+$',$/for<>", "problem_context": "Score : 200 points\n\nProblem Statement\n\nJoisino is about to compete in the final round of a certain programming competition.\nIn this contest, there are N problems, numbered 1 through N.\nJoisino knows that it takes her T_i seconds to solve problem i(1≦i≦N).\n\nAlso, there are M kinds of drinks offered to the contestants, numbered 1 through M.\nIf Joisino takes drink i(1≦i≦M), her brain will be stimulated and the time it takes for her to solve problem P_i will become X_i seconds.\nIt does not affect the time to solve the other problems.\n\nA contestant is allowed to take exactly one of the drinks before the start of the contest.\nFor each drink, Joisino wants to know how many seconds it takes her to solve all the problems if she takes that drink.\nHere, assume that the time it takes her to solve all the problems is equal to the sum of the time it takes for her to solve individual problems.\nYour task is to write a program to calculate it instead of her.\n\nConstraints\n\nAll input values are integers.\n\n1≦N≦100\n\n1≦T_i≦10^5\n\n1≦M≦100\n\n1≦P_i≦N\n\n1≦X_i≦10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nM\nP_1 X_1\nP_2 X_2\n:\nP_M X_M\n\nOutput\n\nFor each drink, calculate how many seconds it takes Joisino to solve all the problems if she takes that drink, and print the results, one per line.\n\nSample Input 1\n\n3\n2 1 4\n2\n1 1\n2 3\n\nSample Output 1\n\n6\n9\n\nIf Joisino takes drink 1, the time it takes her to solve each problem will be 1, 1 and 4 seconds, respectively, totaling 6 seconds.\n\nIf Joisino takes drink 2, the time it takes her to solve each problem will be 2, 3 and 4 seconds, respectively, totaling 9 seconds.\n\nSample Input 2\n\n5\n7 2 3 8 5\n3\n4 2\n1 7\n4 13\n\nSample Output 2\n\n19\n25\n30", "sample_input": "3\n2 1 4\n2\n1 1\n2 3\n"}, "reference_outputs": ["6\n9\n"], "source_document_id": "p03845", "source_text": "Score : 200 points\n\nProblem Statement\n\nJoisino is about to compete in the final round of a certain programming competition.\nIn this contest, there are N problems, numbered 1 through N.\nJoisino knows that it takes her T_i seconds to solve problem i(1≦i≦N).\n\nAlso, there are M kinds of drinks offered to the contestants, numbered 1 through M.\nIf Joisino takes drink i(1≦i≦M), her brain will be stimulated and the time it takes for her to solve problem P_i will become X_i seconds.\nIt does not affect the time to solve the other problems.\n\nA contestant is allowed to take exactly one of the drinks before the start of the contest.\nFor each drink, Joisino wants to know how many seconds it takes her to solve all the problems if she takes that drink.\nHere, assume that the time it takes her to solve all the problems is equal to the sum of the time it takes for her to solve individual problems.\nYour task is to write a program to calculate it instead of her.\n\nConstraints\n\nAll input values are integers.\n\n1≦N≦100\n\n1≦T_i≦10^5\n\n1≦M≦100\n\n1≦P_i≦N\n\n1≦X_i≦10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nM\nP_1 X_1\nP_2 X_2\n:\nP_M X_M\n\nOutput\n\nFor each drink, calculate how many seconds it takes Joisino to solve all the problems if she takes that drink, and print the results, one per line.\n\nSample Input 1\n\n3\n2 1 4\n2\n1 1\n2 3\n\nSample Output 1\n\n6\n9\n\nIf Joisino takes drink 1, the time it takes her to solve each problem will be 1, 1 and 4 seconds, respectively, totaling 6 seconds.\n\nIf Joisino takes drink 2, the time it takes her to solve each problem will be 2, 3 and 4 seconds, respectively, totaling 9 seconds.\n\nSample Input 2\n\n5\n7 2 3 8 5\n3\n4 2\n1 7\n4 13\n\nSample Output 2\n\n19\n25\n30", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 57, "cpu_time_ms": 9, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s205396354", "group_id": "codeNet:p03846", "input_text": "my $n=<>; chomp $n;\nmy $numbers=<>;chomp$numbers;\nmy @a=split(/ /,$numbers);\nmy @sorted=sort{ $a <=> $b } @a;\nmy@t;my $sorted;my $t;\nif($n%2==0){foreach(1..$n/2){push(@t,$_*2-1);push(@t,$_*2-1);}$n=$n/2} else{push(@t,0);foreach(1..($n-1)/2){push(@t,$_*2);push(@t,$_*2);}$n=($n-1)/2;}\n\n$sorted=join('/',@sorted);$t=join('/',@t);\nmy $answer=0;\nif($sorted eq $t){$answer+=hex(sprintf('%x',(2**($n)))%sprintf('%x',((10**9) + 7)));}\nprint $answer;", "language": "Perl", "metadata": {"date": 1587756812, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03846.html", "problem_id": "p03846", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03846/input.txt", "sample_output_relpath": "derived/input_output/data/p03846/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03846/Perl/s205396354.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s205396354", "user_id": "u491340600"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "my $n=<>; chomp $n;\nmy $numbers=<>;chomp$numbers;\nmy @a=split(/ /,$numbers);\nmy @sorted=sort{ $a <=> $b } @a;\nmy@t;my $sorted;my $t;\nif($n%2==0){foreach(1..$n/2){push(@t,$_*2-1);push(@t,$_*2-1);}$n=$n/2} else{push(@t,0);foreach(1..($n-1)/2){push(@t,$_*2);push(@t,$_*2);}$n=($n-1)/2;}\n\n$sorted=join('/',@sorted);$t=join('/',@t);\nmy $answer=0;\nif($sorted eq $t){$answer+=hex(sprintf('%x',(2**($n)))%sprintf('%x',((10**9) + 7)));}\nprint $answer;", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people, conveniently numbered 1 through N.\nThey were standing in a row yesterday, but now they are unsure of the order in which they were standing.\nHowever, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the number of the people who were standing to the right of that person.\nAccording to their reports, the difference above for person i is A_i.\n\nBased on these reports, find the number of the possible orders in which they were standing.\nSince it can be extremely large, print the answer modulo 10^9+7.\nNote that the reports may be incorrect and thus there may be no consistent order.\nIn such a case, print 0.\n\nConstraints\n\n1≦N≦10^5\n\n0≦A_i≦N-1\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 orders in which they were standing, modulo 10^9+7.\n\nSample Input 1\n\n5\n2 4 4 0 2\n\nSample Output 1\n\n4\n\nThere are four possible orders, as follows:\n\n2,1,4,5,3\n\n2,5,4,1,3\n\n3,1,4,5,2\n\n3,5,4,1,2\n\nSample Input 2\n\n7\n6 4 0 2 4 0 2\n\nSample Output 2\n\n0\n\nAny order would be inconsistent with the reports, thus the answer is 0.\n\nSample Input 3\n\n8\n7 5 1 1 7 3 5 3\n\nSample Output 3\n\n16", "sample_input": "5\n2 4 4 0 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03846", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people, conveniently numbered 1 through N.\nThey were standing in a row yesterday, but now they are unsure of the order in which they were standing.\nHowever, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the number of the people who were standing to the right of that person.\nAccording to their reports, the difference above for person i is A_i.\n\nBased on these reports, find the number of the possible orders in which they were standing.\nSince it can be extremely large, print the answer modulo 10^9+7.\nNote that the reports may be incorrect and thus there may be no consistent order.\nIn such a case, print 0.\n\nConstraints\n\n1≦N≦10^5\n\n0≦A_i≦N-1\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 orders in which they were standing, modulo 10^9+7.\n\nSample Input 1\n\n5\n2 4 4 0 2\n\nSample Output 1\n\n4\n\nThere are four possible orders, as follows:\n\n2,1,4,5,3\n\n2,5,4,1,3\n\n3,1,4,5,2\n\n3,5,4,1,2\n\nSample Input 2\n\n7\n6 4 0 2 4 0 2\n\nSample Output 2\n\n0\n\nAny order would be inconsistent with the reports, thus the answer is 0.\n\nSample Input 3\n\n8\n7 5 1 1 7 3 5 3\n\nSample Output 3\n\n16", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 126, "memory_kb": 35648}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s050362335", "group_id": "codeNet:p03846", "input_text": "my $n=; chomp $n;\n$numbers=;chomp$numbers;\nmy @a=split(/ /,$numbers);\nmy @sorted=sort{$a<=>$b}@a;\nmy@t;my $sorted;my $t;\nif($n%2==0){foreach(1..$n/2){push(@t,$_*2-1);push(@t,$_*2-1);}$n=$n/2} else{push(@t,0);foreach(1..($n-1)/2){push(@t,$_*2);push(@t,$_*2);}$n=($n-1)/2;}\n\n$sorted=join('/',@sorted);$t=join('/',@t);\nif($sorted eq $t){print (2**($n))%(10**9+7),\"\\n\";}else {print \"0\\n\"}", "language": "Perl", "metadata": {"date": 1587754383, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03846.html", "problem_id": "p03846", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03846/input.txt", "sample_output_relpath": "derived/input_output/data/p03846/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03846/Perl/s050362335.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s050362335", "user_id": "u491340600"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "my $n=; chomp $n;\n$numbers=;chomp$numbers;\nmy @a=split(/ /,$numbers);\nmy @sorted=sort{$a<=>$b}@a;\nmy@t;my $sorted;my $t;\nif($n%2==0){foreach(1..$n/2){push(@t,$_*2-1);push(@t,$_*2-1);}$n=$n/2} else{push(@t,0);foreach(1..($n-1)/2){push(@t,$_*2);push(@t,$_*2);}$n=($n-1)/2;}\n\n$sorted=join('/',@sorted);$t=join('/',@t);\nif($sorted eq $t){print (2**($n))%(10**9+7),\"\\n\";}else {print \"0\\n\"}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people, conveniently numbered 1 through N.\nThey were standing in a row yesterday, but now they are unsure of the order in which they were standing.\nHowever, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the number of the people who were standing to the right of that person.\nAccording to their reports, the difference above for person i is A_i.\n\nBased on these reports, find the number of the possible orders in which they were standing.\nSince it can be extremely large, print the answer modulo 10^9+7.\nNote that the reports may be incorrect and thus there may be no consistent order.\nIn such a case, print 0.\n\nConstraints\n\n1≦N≦10^5\n\n0≦A_i≦N-1\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 orders in which they were standing, modulo 10^9+7.\n\nSample Input 1\n\n5\n2 4 4 0 2\n\nSample Output 1\n\n4\n\nThere are four possible orders, as follows:\n\n2,1,4,5,3\n\n2,5,4,1,3\n\n3,1,4,5,2\n\n3,5,4,1,2\n\nSample Input 2\n\n7\n6 4 0 2 4 0 2\n\nSample Output 2\n\n0\n\nAny order would be inconsistent with the reports, thus the answer is 0.\n\nSample Input 3\n\n8\n7 5 1 1 7 3 5 3\n\nSample Output 3\n\n16", "sample_input": "5\n2 4 4 0 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03846", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people, conveniently numbered 1 through N.\nThey were standing in a row yesterday, but now they are unsure of the order in which they were standing.\nHowever, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the number of the people who were standing to the right of that person.\nAccording to their reports, the difference above for person i is A_i.\n\nBased on these reports, find the number of the possible orders in which they were standing.\nSince it can be extremely large, print the answer modulo 10^9+7.\nNote that the reports may be incorrect and thus there may be no consistent order.\nIn such a case, print 0.\n\nConstraints\n\n1≦N≦10^5\n\n0≦A_i≦N-1\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 orders in which they were standing, modulo 10^9+7.\n\nSample Input 1\n\n5\n2 4 4 0 2\n\nSample Output 1\n\n4\n\nThere are four possible orders, as follows:\n\n2,1,4,5,3\n\n2,5,4,1,3\n\n3,1,4,5,2\n\n3,5,4,1,2\n\nSample Input 2\n\n7\n6 4 0 2 4 0 2\n\nSample Output 2\n\n0\n\nAny order would be inconsistent with the reports, thus the answer is 0.\n\nSample Input 3\n\n8\n7 5 1 1 7 3 5 3\n\nSample Output 3\n\n16", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 398, "cpu_time_ms": 119, "memory_kb": 35644}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s256535131", "group_id": "codeNet:p03849", "input_text": "$d{$d{0}=1}=2;\nsub f{\n\tmy$x=$_[0]>>1;\n\t$d{$_[0]}//=(f($x)+f($x-1)+f($_[0]-$x-1))%(1e9+7)\n}\nprint f<>", "language": "Perl", "metadata": {"date": 1539131275, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03849.html", "problem_id": "p03849", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03849/input.txt", "sample_output_relpath": "derived/input_output/data/p03849/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03849/Perl/s256535131.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s256535131", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "$d{$d{0}=1}=2;\nsub f{\n\tmy$x=$_[0]>>1;\n\t$d{$_[0]}//=(f($x)+f($x-1)+f($_[0]-$x-1))%(1e9+7)\n}\nprint f<>", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the number of the pairs of integers u and v (0≦u,v≦N) such that there exist two non-negative integers a and b satisfying a xor b=u and a+b=v.\nHere, xor denotes the bitwise exclusive OR.\nSince it can be extremely large, compute the answer modulo 10^9+7.\n\nConstraints\n\n1≦N≦10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the possible pairs of integers u and v, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n5\n\nThe five possible pairs of u and v are:\n\nu=0,v=0 (Let a=0,b=0, then 0 xor 0=0, 0+0=0.)\n\nu=0,v=2 (Let a=1,b=1, then 1 xor 1=0, 1+1=2.)\n\nu=1,v=1 (Let a=1,b=0, then 1 xor 0=1, 1+0=1.)\n\nu=2,v=2 (Let a=2,b=0, then 2 xor 0=2, 2+0=2.)\n\nu=3,v=3 (Let a=3,b=0, then 3 xor 0=3, 3+0=3.)\n\nSample Input 2\n\n1422\n\nSample Output 2\n\n52277\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n787014179", "sample_input": "3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03849", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the number of the pairs of integers u and v (0≦u,v≦N) such that there exist two non-negative integers a and b satisfying a xor b=u and a+b=v.\nHere, xor denotes the bitwise exclusive OR.\nSince it can be extremely large, compute the answer modulo 10^9+7.\n\nConstraints\n\n1≦N≦10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the possible pairs of integers u and v, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n5\n\nThe five possible pairs of u and v are:\n\nu=0,v=0 (Let a=0,b=0, then 0 xor 0=0, 0+0=0.)\n\nu=0,v=2 (Let a=1,b=1, then 1 xor 1=0, 1+1=2.)\n\nu=1,v=1 (Let a=1,b=0, then 1 xor 0=1, 1+0=1.)\n\nu=2,v=2 (Let a=2,b=0, then 2 xor 0=2, 2+0=2.)\n\nu=3,v=3 (Let a=3,b=0, then 3 xor 0=3, 3+0=3.)\n\nSample Input 2\n\n1422\n\nSample Output 2\n\n52277\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n787014179", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 100, "cpu_time_ms": 2136, "memory_kb": 547200}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s200643683", "group_id": "codeNet:p03850", "input_text": "<>;$b=$c=-1e18;map$x=-$_?$x?($b=($\\-=$_)+=$-=($c=$b+$_)-$\\):($\\+=$_,($b-=$_)+=$-=($c+=$_)-$b):/-/,glob<>;print", "language": "Perl", "metadata": {"date": 1547730545, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03850.html", "problem_id": "p03850", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03850/input.txt", "sample_output_relpath": "derived/input_output/data/p03850/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03850/Perl/s200643683.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s200643683", "user_id": "u657913472"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "<>;$b=$c=-1e18;map$x=-$_?$x?($b=($\\-=$_)+=$-=($c=$b+$_)-$\\):($\\+=$_,($b-=$_)+=$-=($c+=$_)-$b):/-/,glob<>;print", "problem_context": "Score : 900 points\n\nProblem Statement\n\nJoisino has a formula consisting of N terms: A_1 op_1 A_2 ... op_{N-1} A_N.\nHere, A_i is an integer, and op_i is an binary operator either + or -.\nBecause Joisino loves large numbers, she wants to maximize the evaluated value of the formula by inserting an arbitrary number of pairs of parentheses (possibly zero) into the formula.\nOpening parentheses can only be inserted immediately before an integer, and closing parentheses can only be inserted immediately after an integer.\nIt is allowed to insert any number of parentheses at a position.\nYour task is to write a program to find the maximum possible evaluated value of the formula after inserting an arbitrary number of pairs of parentheses.\n\nConstraints\n\n1≦N≦10^5\n\n1≦A_i≦10^9\n\nop_i is either + or -.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 op_1 A_2 ... op_{N-1} A_N\n\nOutput\n\nPrint the maximum possible evaluated value of the formula after inserting an arbitrary number of pairs of parentheses.\n\nSample Input 1\n\n3\n5 - 1 - 3\n\nSample Output 1\n\n7\n\nThe maximum possible value is: 5 - (1 - 3) = 7.\n\nSample Input 2\n\n5\n1 - 2 + 3 - 4 + 5\n\nSample Output 2\n\n5\n\nThe maximum possible value is: 1 - (2 + 3 - 4) + 5 = 5.\n\nSample Input 3\n\n5\n1 - 20 - 13 + 14 - 5\n\nSample Output 3\n\n13\n\nThe maximum possible value is: 1 - (20 - (13 + 14) - 5) = 13.", "sample_input": "3\n5 - 1 - 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03850", "source_text": "Score : 900 points\n\nProblem Statement\n\nJoisino has a formula consisting of N terms: A_1 op_1 A_2 ... op_{N-1} A_N.\nHere, A_i is an integer, and op_i is an binary operator either + or -.\nBecause Joisino loves large numbers, she wants to maximize the evaluated value of the formula by inserting an arbitrary number of pairs of parentheses (possibly zero) into the formula.\nOpening parentheses can only be inserted immediately before an integer, and closing parentheses can only be inserted immediately after an integer.\nIt is allowed to insert any number of parentheses at a position.\nYour task is to write a program to find the maximum possible evaluated value of the formula after inserting an arbitrary number of pairs of parentheses.\n\nConstraints\n\n1≦N≦10^5\n\n1≦A_i≦10^9\n\nop_i is either + or -.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 op_1 A_2 ... op_{N-1} A_N\n\nOutput\n\nPrint the maximum possible evaluated value of the formula after inserting an arbitrary number of pairs of parentheses.\n\nSample Input 1\n\n3\n5 - 1 - 3\n\nSample Output 1\n\n7\n\nThe maximum possible value is: 5 - (1 - 3) = 7.\n\nSample Input 2\n\n5\n1 - 2 + 3 - 4 + 5\n\nSample Output 2\n\n5\n\nThe maximum possible value is: 1 - (2 + 3 - 4) + 5 = 5.\n\nSample Input 3\n\n5\n1 - 20 - 13 + 14 - 5\n\nSample Output 3\n\n13\n\nThe maximum possible value is: 1 - (20 - (13 + 14) - 5) = 13.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 774, "memory_kb": 43820}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s056513750", "group_id": "codeNet:p03852", "input_text": "print<>=~y/[aeiou]//?vowel:consonant", "language": "Perl", "metadata": {"date": 1570925892, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03852.html", "problem_id": "p03852", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03852/input.txt", "sample_output_relpath": "derived/input_output/data/p03852/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03852/Perl/s056513750.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s056513750", "user_id": "u832039789"}, "prompt_components": {"gold_output": "vowel\n", "input_to_evaluate": "print<>=~y/[aeiou]//?vowel:consonant", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: a, e, i, o and u.\n\nConstraints\n\nc is a lowercase English letter.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nc\n\nOutput\n\nIf c is a vowel, print vowel. Otherwise, print consonant.\n\nSample Input 1\n\na\n\nSample Output 1\n\nvowel\n\nSince a is a vowel, print vowel.\n\nSample Input 2\n\nz\n\nSample Output 2\n\nconsonant\n\nSample Input 3\n\ns\n\nSample Output 3\n\nconsonant", "sample_input": "a\n"}, "reference_outputs": ["vowel\n"], "source_document_id": "p03852", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: a, e, i, o and u.\n\nConstraints\n\nc is a lowercase English letter.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nc\n\nOutput\n\nIf c is a vowel, print vowel. Otherwise, print consonant.\n\nSample Input 1\n\na\n\nSample Output 1\n\nvowel\n\nSince a is a vowel, print vowel.\n\nSample Input 2\n\nz\n\nSample Output 2\n\nconsonant\n\nSample Input 3\n\ns\n\nSample Output 3\n\nconsonant", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 36, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s409907619", "group_id": "codeNet:p03852", "input_text": "print<>=~/[aiueo]/?vowel:consonant", "language": "Perl", "metadata": {"date": 1528257578, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03852.html", "problem_id": "p03852", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03852/input.txt", "sample_output_relpath": "derived/input_output/data/p03852/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03852/Perl/s409907619.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s409907619", "user_id": "u657913472"}, "prompt_components": {"gold_output": "vowel\n", "input_to_evaluate": "print<>=~/[aiueo]/?vowel:consonant", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: a, e, i, o and u.\n\nConstraints\n\nc is a lowercase English letter.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nc\n\nOutput\n\nIf c is a vowel, print vowel. Otherwise, print consonant.\n\nSample Input 1\n\na\n\nSample Output 1\n\nvowel\n\nSince a is a vowel, print vowel.\n\nSample Input 2\n\nz\n\nSample Output 2\n\nconsonant\n\nSample Input 3\n\ns\n\nSample Output 3\n\nconsonant", "sample_input": "a\n"}, "reference_outputs": ["vowel\n"], "source_document_id": "p03852", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: a, e, i, o and u.\n\nConstraints\n\nc is a lowercase English letter.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nc\n\nOutput\n\nIf c is a vowel, print vowel. Otherwise, print consonant.\n\nSample Input 1\n\na\n\nSample Output 1\n\nvowel\n\nSince a is a vowel, print vowel.\n\nSample Input 2\n\nz\n\nSample Output 2\n\nconsonant\n\nSample Input 3\n\ns\n\nSample Output 3\n\nconsonant", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 34, "cpu_time_ms": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s587907332", "group_id": "codeNet:p03853", "input_text": "#!perl -p\n$_ x=!!$i++*2", "language": "Perl", "metadata": {"date": 1571341157, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03853.html", "problem_id": "p03853", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03853/input.txt", "sample_output_relpath": "derived/input_output/data/p03853/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03853/Perl/s587907332.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s587907332", "user_id": "u832039789"}, "prompt_components": {"gold_output": "*.\n*.\n.*\n.*\n", "input_to_evaluate": "#!perl -p\n$_ x=!!$i++*2", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or *. The character representing the pixel at the i-th row from the top and the j-th column from the left, is denoted by C_{i,j}.\n\nExtend this image vertically so that its height is doubled. That is, print a image with a height of 2H pixels and a width of W pixels where the pixel at the i-th row and j-th column is equal to C_{(i+1)/2,j} (the result of division is rounded down).\n\nConstraints\n\n1≦H, W≦100\n\nC_{i,j} is either . or *.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\nC_{1,1}...C_{1,W}\n:\nC_{H,1}...C_{H,W}\n\nOutput\n\nPrint the extended image.\n\nSample Input 1\n\n2 2\n*.\n.*\n\nSample Output 1\n\n*.\n*.\n.*\n.*\n\nSample Input 2\n\n1 4\n***.\n\nSample Output 2\n\n***.\n***.\n\nSample Input 3\n\n9 20\n.....***....***.....\n....*...*..*...*....\n...*.....**.....*...\n...*.....*......*...\n....*.....*....*....\n.....**..*...**.....\n.......*..*.*.......\n........**.*........\n.........**.........\n\nSample Output 3\n\n.....***....***.....\n.....***....***.....\n....*...*..*...*....\n....*...*..*...*....\n...*.....**.....*...\n...*.....**.....*...\n...*.....*......*...\n...*.....*......*...\n....*.....*....*....\n....*.....*....*....\n.....**..*...**.....\n.....**..*...**.....\n.......*..*.*.......\n.......*..*.*.......\n........**.*........\n........**.*........\n.........**.........\n.........**.........", "sample_input": "2 2\n*.\n.*\n"}, "reference_outputs": ["*.\n*.\n.*\n.*\n"], "source_document_id": "p03853", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or *. The character representing the pixel at the i-th row from the top and the j-th column from the left, is denoted by C_{i,j}.\n\nExtend this image vertically so that its height is doubled. That is, print a image with a height of 2H pixels and a width of W pixels where the pixel at the i-th row and j-th column is equal to C_{(i+1)/2,j} (the result of division is rounded down).\n\nConstraints\n\n1≦H, W≦100\n\nC_{i,j} is either . or *.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\nC_{1,1}...C_{1,W}\n:\nC_{H,1}...C_{H,W}\n\nOutput\n\nPrint the extended image.\n\nSample Input 1\n\n2 2\n*.\n.*\n\nSample Output 1\n\n*.\n*.\n.*\n.*\n\nSample Input 2\n\n1 4\n***.\n\nSample Output 2\n\n***.\n***.\n\nSample Input 3\n\n9 20\n.....***....***.....\n....*...*..*...*....\n...*.....**.....*...\n...*.....*......*...\n....*.....*....*....\n.....**..*...**.....\n.......*..*.*.......\n........**.*........\n.........**.........\n\nSample Output 3\n\n.....***....***.....\n.....***....***.....\n....*...*..*...*....\n....*...*..*...*....\n...*.....**.....*...\n...*.....**.....*...\n...*.....*......*...\n...*.....*......*...\n....*.....*....*....\n....*.....*....*....\n.....**..*...**.....\n.....**..*...**.....\n.......*..*.*.......\n.......*..*.*.......\n........**.*........\n........**.*........\n.........**.........\n.........**.........", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 23, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s324772861", "group_id": "codeNet:p03857", "input_text": "sub f{$p[$_]=$_-(local$_=$p[$_])?&f:$_}map{@p=0..$`;$p[f$_=$']=f$_=<>=~$\"*$`for 1..$_;@{$|--}=map f,@p}<>=~/ \\d+/g;print$$_,$/for map{++${$t=\\${$0[$_]}{$1[$_]}};$t}1..$`", "language": "Perl", "metadata": {"date": 1578055108, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03857.html", "problem_id": "p03857", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03857/input.txt", "sample_output_relpath": "derived/input_output/data/p03857/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03857/Perl/s324772861.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s324772861", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1 2 2 1\n", "input_to_evaluate": "sub f{$p[$_]=$_-(local$_=$p[$_])?&f:$_}map{@p=0..$`;$p[f$_=$']=f$_=<>=~$\"*$`for 1..$_;@{$|--}=map f,@p}<>=~/ \\d+/g;print$$_,$/for map{++${$t=\\${$0[$_]}{$1[$_]}};$t}1..$`", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "sample_input": "4 3 1\n1 2\n2 3\n3 4\n2 3\n"}, "reference_outputs": ["1 2 2 1\n"], "source_document_id": "p03857", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1410, "memory_kb": 163712}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s690067045", "group_id": "codeNet:p03857", "input_text": "sub f{$p[$_]=$_-(local$_=$p[$_])?&f:$_}map{@p=0..$`;($==f$_=<>=~$\"*$')-($%=f$_=$`)and$p[$%]=$=for 1..$_;@{$|--}=map f,@p}<>=~/ \\d+/g;print$$_,$/for map{++${*t=${$0[$_]}{$1[$_]}};*t}1..$`", "language": "Perl", "metadata": {"date": 1578054936, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03857.html", "problem_id": "p03857", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03857/input.txt", "sample_output_relpath": "derived/input_output/data/p03857/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03857/Perl/s690067045.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s690067045", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1 2 2 1\n", "input_to_evaluate": "sub f{$p[$_]=$_-(local$_=$p[$_])?&f:$_}map{@p=0..$`;($==f$_=<>=~$\"*$')-($%=f$_=$`)and$p[$%]=$=for 1..$_;@{$|--}=map f,@p}<>=~/ \\d+/g;print$$_,$/for map{++${*t=${$0[$_]}{$1[$_]}};*t}1..$`", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "sample_input": "4 3 1\n1 2\n2 3\n3 4\n2 3\n"}, "reference_outputs": ["1 2 2 1\n"], "source_document_id": "p03857", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2113, "memory_kb": 152960}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s048647605", "group_id": "codeNet:p03857", "input_text": "sub f{$_-$u[$_]?(map$_=&f,$u[$_])[0]:$_}map{@u=0..$`;($==f$_=<>=~$\"*$')-($%=f$_=$`)and$u[$%]=$=for 1..$_;@{$|--}=map f,@u}<>=~/ \\d+/g;print$$_,$/for map{++${$t=\\${$0[$_]}{$1[$_]}};$t}1..$`", "language": "Perl", "metadata": {"date": 1565858291, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03857.html", "problem_id": "p03857", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03857/input.txt", "sample_output_relpath": "derived/input_output/data/p03857/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03857/Perl/s048647605.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s048647605", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1 2 2 1\n", "input_to_evaluate": "sub f{$_-$u[$_]?(map$_=&f,$u[$_])[0]:$_}map{@u=0..$`;($==f$_=<>=~$\"*$')-($%=f$_=$`)and$u[$%]=$=for 1..$_;@{$|--}=map f,@u}<>=~/ \\d+/g;print$$_,$/for map{++${$t=\\${$0[$_]}{$1[$_]}};$t}1..$`", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "sample_input": "4 3 1\n1 2\n2 3\n3 4\n2 3\n"}, "reference_outputs": ["1 2 2 1\n"], "source_document_id": "p03857", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 188, "cpu_time_ms": 1801, "memory_kb": 164608}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s753895219", "group_id": "codeNet:p03860", "input_text": ".say for $*IN.lines>>.split(\" \",)[1].map: { 'A' ~ $_.comb[0] ~ 'C' }", "language": "Perl", "metadata": {"date": 1481438286, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03860.html", "problem_id": "p03860", "resource_group": "low_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/Perl/s753895219.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s753895219", "user_id": "u502845410"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": ".say for $*IN.lines>>.split(\" \",)[1].map: { 'A' ~ $_.comb[0] ~ 'C' }", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1859, "memory_kb": 64924}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s949552193", "group_id": "codeNet:p03860", "input_text": "#!/usr/bin/env perl\nuse strict;\nuse warnings;\nuse utf8;\n\nmy $input = ;\n\n(my $shop,my $target_len) = split / /,$input;\n$input = substr($target_len,0,1);\n\nprint \"A$input\".\"C\";", "language": "Perl", "metadata": {"date": 1481067690, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03860.html", "problem_id": "p03860", "resource_group": "low_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/Perl/s949552193.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s949552193", "user_id": "u582964576"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "#!/usr/bin/env perl\nuse strict;\nuse warnings;\nuse utf8;\n\nmy $input = ;\n\n(my $shop,my $target_len) = split / /,$input;\n$input = substr($target_len,0,1);\n\nprint \"A$input\".\"C\";", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 6, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s406466019", "group_id": "codeNet:p03861", "input_text": "use bigint;\n($a,$b,$c)=glob<>;\n$c+=0;\nprint$b/$c-($a-1)/$c+($a<1)", "language": "Perl", "metadata": {"date": 1537936275, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "low_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/Perl/s406466019.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s406466019", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "use bigint;\n($a,$b,$c)=glob<>;\n$c+=0;\nprint$b/$c-($a-1)/$c+($a<1)", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 33, "memory_kb": 4992}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s304822494", "group_id": "codeNet:p03861", "input_text": "my ($a,$b,$c) = $*IN.get.split(\" \",:skip-empty)>>.Int; say $b div $c - $a div $c + $a %% $c ?? 1 !! 0;", "language": "Perl", "metadata": {"date": 1481441466, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "low_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/Perl/s304822494.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s304822494", "user_id": "u502845410"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my ($a,$b,$c) = $*IN.get.split(\" \",:skip-empty)>>.Int; say $b div $c - $a div $c + $a %% $c ?? 1 !! 0;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 102, "cpu_time_ms": 326, "memory_kb": 64000}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s504007059", "group_id": "codeNet:p03865", "input_text": "print<>=~/^(.)(..)*$1?$/?Second:First", "language": "Perl", "metadata": {"date": 1578588965, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03865.html", "problem_id": "p03865", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03865/input.txt", "sample_output_relpath": "derived/input_output/data/p03865/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03865/Perl/s504007059.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s504007059", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Second\n", "input_to_evaluate": "print<>=~/^(.)(..)*$1?$/?Second:First", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is a string s of length 3 or greater.\nNo two neighboring characters in s are equal.\n\nTakahashi and Aoki will play a game against each other.\nThe two players alternately performs the following operation, Takahashi going first:\n\nRemove one of the characters in s, excluding both ends. However, a character cannot be removed if removal of the character would result in two neighboring equal characters in s.\n\nThe player who becomes unable to perform the operation, loses the game. Determine which player will win when the two play optimally.\n\nConstraints\n\n3 ≤ |s| ≤ 10^5\n\ns consists of lowercase English letters.\n\nNo two neighboring characters in s are equal.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf Takahashi will win, print First. If Aoki will win, print Second.\n\nSample Input 1\n\naba\n\nSample Output 1\n\nSecond\n\nTakahashi, who goes first, cannot perform the operation, since removal of the b, which is the only character not at either ends of s, would result in s becoming aa, with two as neighboring.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nFirst\n\nWhen Takahashi removes b from s, it becomes ac.\nThen, Aoki cannot perform the operation, since there is no character in s, excluding both ends.\n\nSample Input 3\n\nabcab\n\nSample Output 3\n\nFirst", "sample_input": "aba\n"}, "reference_outputs": ["Second\n"], "source_document_id": "p03865", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is a string s of length 3 or greater.\nNo two neighboring characters in s are equal.\n\nTakahashi and Aoki will play a game against each other.\nThe two players alternately performs the following operation, Takahashi going first:\n\nRemove one of the characters in s, excluding both ends. However, a character cannot be removed if removal of the character would result in two neighboring equal characters in s.\n\nThe player who becomes unable to perform the operation, loses the game. Determine which player will win when the two play optimally.\n\nConstraints\n\n3 ≤ |s| ≤ 10^5\n\ns consists of lowercase English letters.\n\nNo two neighboring characters in s are equal.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf Takahashi will win, print First. If Aoki will win, print Second.\n\nSample Input 1\n\naba\n\nSample Output 1\n\nSecond\n\nTakahashi, who goes first, cannot perform the operation, since removal of the b, which is the only character not at either ends of s, would result in s becoming aa, with two as neighboring.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nFirst\n\nWhen Takahashi removes b from s, it becomes ac.\nThen, Aoki cannot perform the operation, since there is no character in s, excluding both ends.\n\nSample Input 3\n\nabcab\n\nSample Output 3\n\nFirst", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 37, "cpu_time_ms": 5, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s355000565", "group_id": "codeNet:p03870", "input_text": "<>;\n!$h{$_}++&&$x&($_+1>>1)&&($%++,$x^=$_)for sort{$b-$a}map{$x^=$_;$_^$_-1}<>;\nprint$x?-1:$%", "language": "Perl", "metadata": {"date": 1546753030, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03870.html", "problem_id": "p03870", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03870/input.txt", "sample_output_relpath": "derived/input_output/data/p03870/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03870/Perl/s355000565.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s355000565", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;\n!$h{$_}++&&$x&($_+1>>1)&&($%++,$x^=$_)for sort{$b-$a}map{$x^=$_;$_^$_-1}<>;\nprint$x?-1:$%", "problem_context": "Score : 500 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nA cheetah and a cheater are going to play the game of Nim.\nIn this game they use N piles of stones.\nInitially the i-th pile contains a_i stones.\nThe players take turns alternately, and the cheetah plays first.\nIn each turn, the player chooses one of the piles, and takes one or more stones from the pile.\nThe player who can't make a move loses.\n\nHowever, before the game starts, the cheater wants to cheat a bit to make sure that he can win regardless of the moves by the cheetah.\nFrom each pile, the cheater takes zero or one stone and eats it before the game.\nIn case there are multiple ways to guarantee his winning, he wants to minimize the number of stones he eats.\n\nCompute the number of stones the cheater will eat.\nIn case there is no way for the cheater to win the game even with the cheating, print -1 instead.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n2 ≤ a_i ≤ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1\n:\na_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n4\n\nSample Output 1\n\n3\n\nThe only way for the cheater to win the game is to take stones from all piles and eat them.\n\nSample Input 2\n\n3\n100\n100\n100\n\nSample Output 2\n\n-1", "sample_input": "3\n2\n3\n4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03870", "source_text": "Score : 500 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nA cheetah and a cheater are going to play the game of Nim.\nIn this game they use N piles of stones.\nInitially the i-th pile contains a_i stones.\nThe players take turns alternately, and the cheetah plays first.\nIn each turn, the player chooses one of the piles, and takes one or more stones from the pile.\nThe player who can't make a move loses.\n\nHowever, before the game starts, the cheater wants to cheat a bit to make sure that he can win regardless of the moves by the cheetah.\nFrom each pile, the cheater takes zero or one stone and eats it before the game.\nIn case there are multiple ways to guarantee his winning, he wants to minimize the number of stones he eats.\n\nCompute the number of stones the cheater will eat.\nIn case there is no way for the cheater to win the game even with the cheating, print -1 instead.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n2 ≤ a_i ≤ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1\n:\na_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n4\n\nSample Output 1\n\n3\n\nThe only way for the cheater to win the game is to take stones from all piles and eat them.\n\nSample Input 2\n\n3\n100\n100\n100\n\nSample Output 2\n\n-1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 143, "memory_kb": 23164}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s390692492", "group_id": "codeNet:p03891", "input_text": "$A[0]=<>;$A[1]=<>;$A[4]=<>;\nchomp@A;\n$A[6]=$A[0]+$A[1]-$A[4];\n$A[8]=$A[1]+$A[4]-$A[6];\n$A[3]=$A[4]+$A[8]-$A[6];\n$A[7]=$A[0]+$A[3]-$A[8];\n$A[2]=$A[3]+$A[6]-$A[1];\n$A[5]=$A[3]+$A[6]-$A[4];\n$i=0;\nprint\"$A[$i++] $A[$i++] $A[$i++]\\n\"for(1..3)", "language": "Perl", "metadata": {"date": 1562163546, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03891.html", "problem_id": "p03891", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03891/input.txt", "sample_output_relpath": "derived/input_output/data/p03891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03891/Perl/s390692492.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s390692492", "user_id": "u573154728"}, "prompt_components": {"gold_output": "8 3 4\n1 5 9\n6 7 2\n", "input_to_evaluate": "$A[0]=<>;$A[1]=<>;$A[4]=<>;\nchomp@A;\n$A[6]=$A[0]+$A[1]-$A[4];\n$A[8]=$A[1]+$A[4]-$A[6];\n$A[3]=$A[4]+$A[8]-$A[6];\n$A[7]=$A[0]+$A[3]-$A[8];\n$A[2]=$A[3]+$A[6]-$A[1];\n$A[5]=$A[3]+$A[6]-$A[4];\n$i=0;\nprint\"$A[$i++] $A[$i++] $A[$i++]\\n\"for(1..3)", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA 3×3 grid with a integer written in each square, is called a magic square if and only if the integers in each row, the integers in each column, and the integers in each diagonal (from the top left corner to the bottom right corner, and from the top right corner to the bottom left corner), all add up to the same sum.\n\nYou are given the integers written in the following three squares in a magic square:\n\nThe integer A at the upper row and left column\n\nThe integer B at the upper row and middle column\n\nThe integer C at the middle row and middle column\n\nDetermine the integers written in the remaining squares in the magic square.\n\nIt can be shown that there exists a unique magic square consistent with the given information.\n\nConstraints\n\n0 \\leq A, B, C \\leq 100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA\nB\nC\n\nOutput\n\nOutput the integers written in the magic square, in the following format:\n\nX_{1,1} X_{1,2} X_{1,3}\nX_{2,1} X_{2,2} X_{2,3}\nX_{3,1} X_{3,2} X_{3,3}\n\nwhere X_{i,j} is the integer written in the square at the i-th row and j-th column.\n\nSample Input 1\n\n8\n3\n5\n\nSample Output 1\n\n8 3 4\n1 5 9\n6 7 2\n\nSample Input 2\n\n1\n1\n1\n\nSample Output 2\n\n1 1 1\n1 1 1\n1 1 1", "sample_input": "8\n3\n5\n"}, "reference_outputs": ["8 3 4\n1 5 9\n6 7 2\n"], "source_document_id": "p03891", "source_text": "Score : 100 points\n\nProblem Statement\n\nA 3×3 grid with a integer written in each square, is called a magic square if and only if the integers in each row, the integers in each column, and the integers in each diagonal (from the top left corner to the bottom right corner, and from the top right corner to the bottom left corner), all add up to the same sum.\n\nYou are given the integers written in the following three squares in a magic square:\n\nThe integer A at the upper row and left column\n\nThe integer B at the upper row and middle column\n\nThe integer C at the middle row and middle column\n\nDetermine the integers written in the remaining squares in the magic square.\n\nIt can be shown that there exists a unique magic square consistent with the given information.\n\nConstraints\n\n0 \\leq A, B, C \\leq 100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA\nB\nC\n\nOutput\n\nOutput the integers written in the magic square, in the following format:\n\nX_{1,1} X_{1,2} X_{1,3}\nX_{2,1} X_{2,2} X_{2,3}\nX_{3,1} X_{3,2} X_{3,3}\n\nwhere X_{i,j} is the integer written in the square at the i-th row and j-th column.\n\nSample Input 1\n\n8\n3\n5\n\nSample Output 1\n\n8 3 4\n1 5 9\n6 7 2\n\nSample Input 2\n\n1\n1\n1\n\nSample Output 2\n\n1 1 1\n1 1 1\n1 1 1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 237, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s861829698", "group_id": "codeNet:p03892", "input_text": "sub f{my($a,$b)=@_;($a,$b)=($b,$a)if($a>$b);($a,$b)=($b%$a,$a)while($a);return$b;}<>=~/ (.+) (.+) /;$X=abs$2-$`;$Y=abs$'-$1;print$X&&$Y?$X+$Y-&f($X,$Y):0;", "language": "Perl", "metadata": {"date": 1562165327, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03892.html", "problem_id": "p03892", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03892/input.txt", "sample_output_relpath": "derived/input_output/data/p03892/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03892/Perl/s861829698.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s861829698", "user_id": "u573154728"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "sub f{my($a,$b)=@_;($a,$b)=($b,$a)if($a>$b);($a,$b)=($b%$a,$a)while($a);return$b;}<>=~/ (.+) (.+) /;$X=abs$2-$`;$Y=abs$'-$1;print$X&&$Y?$X+$Y-&f($X,$Y):0;", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is drawing a segment on grid paper.\n\nFrom a certain square, a square that is x squares to the right and y squares above, is denoted as square (x, y).\n\nWhen Takahashi draws a segment connecting the lower left corner of square (A, B) and the lower left corner of square (C, D), find the number of the squares crossed by the segment.\n\nHere, the segment is said to cross a square if the segment has non-empty intersection with the region within the square, excluding the boundary.\n\nConstraints\n\n1 \\leq A, B, C, D \\leq 10^9\n\nAt least one of A \\neq C and B \\neq D holds.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of the squares crossed by the segment.\n\nSample Input 1\n\n1 1 3 4\n\nSample Output 1\n\n4\n\nSample Input 2\n\n2 3 10 7\n\nSample Output 2\n\n8", "sample_input": "1 1 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03892", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is drawing a segment on grid paper.\n\nFrom a certain square, a square that is x squares to the right and y squares above, is denoted as square (x, y).\n\nWhen Takahashi draws a segment connecting the lower left corner of square (A, B) and the lower left corner of square (C, D), find the number of the squares crossed by the segment.\n\nHere, the segment is said to cross a square if the segment has non-empty intersection with the region within the square, excluding the boundary.\n\nConstraints\n\n1 \\leq A, B, C, D \\leq 10^9\n\nAt least one of A \\neq C and B \\neq D holds.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of the squares crossed by the segment.\n\nSample Input 1\n\n1 1 3 4\n\nSample Output 1\n\n4\n\nSample Input 2\n\n2 3 10 7\n\nSample Output 2\n\n8", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s346170744", "group_id": "codeNet:p03894", "input_text": "@0=0..<>;print++$i+grep!++$#$_,2,map{/ /;@0[$`,$']=@0[$',$`];@0[($i=$i-$'?$i-$`?$i:$':$`)-1,$i+1]}<>", "language": "Perl", "metadata": {"date": 1565685046, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03894.html", "problem_id": "p03894", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03894/input.txt", "sample_output_relpath": "derived/input_output/data/p03894/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03894/Perl/s346170744.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s346170744", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "@0=0..<>;print++$i+grep!++$#$_,2,map{/ /;@0[$`,$']=@0[$',$`];@0[($i=$i-$'?$i-$`?$i:$':$`)-1,$i+1]}<>", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have N cups and 1 ball.\n\nThe cups are arranged in a row, from left to right.\n\nYou turned down all the cups, then inserted the ball into the leftmost cup.\n\nThen, you will perform the following Q operations:\n\nThe i-th operation: swap the positions of the A_i-th and B_i-th cups from the left. If one of these cups contains the ball, the ball will also move.\n\nSince you are a magician, you can cast a magic described below:\n\nMagic: When the ball is contained in the i-th cup from the left, teleport the ball into the adjacent cup (that is, the (i-1)-th or (i+1)-th cup, if they exist).\n\nThe magic can be cast before the first operation, between two operations, or after the last operation, but you are allowed to cast it at most once during the whole process.\n\nFind the number of cups with a possibility of containing the ball after all the operations and possibly casting the magic.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN Q\nA_1 B_1\nA_2 B_2\n:\nA_Q B_Q\n\nOutput\n\nPrint the number of cups with a possibility of eventually containing the ball.\n\nSample Input 1\n\n10 3\n1 3\n2 4\n4 5\n\nSample Output 1\n\n4\n\nSample Input 2\n\n20 3\n1 7\n8 20\n1 19\n\nSample Output 2\n\n5", "sample_input": "10 3\n1 3\n2 4\n4 5\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03894", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have N cups and 1 ball.\n\nThe cups are arranged in a row, from left to right.\n\nYou turned down all the cups, then inserted the ball into the leftmost cup.\n\nThen, you will perform the following Q operations:\n\nThe i-th operation: swap the positions of the A_i-th and B_i-th cups from the left. If one of these cups contains the ball, the ball will also move.\n\nSince you are a magician, you can cast a magic described below:\n\nMagic: When the ball is contained in the i-th cup from the left, teleport the ball into the adjacent cup (that is, the (i-1)-th or (i+1)-th cup, if they exist).\n\nThe magic can be cast before the first operation, between two operations, or after the last operation, but you are allowed to cast it at most once during the whole process.\n\nFind the number of cups with a possibility of containing the ball after all the operations and possibly casting the magic.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN Q\nA_1 B_1\nA_2 B_2\n:\nA_Q B_Q\n\nOutput\n\nPrint the number of cups with a possibility of eventually containing the ball.\n\nSample Input 1\n\n10 3\n1 3\n2 4\n4 5\n\nSample Output 1\n\n4\n\nSample Input 2\n\n20 3\n1 7\n8 20\n1 19\n\nSample Output 2\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 100, "cpu_time_ms": 293, "memory_kb": 32384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s384965025", "group_id": "codeNet:p03895", "input_text": "<>;\n/ /,++$_[$t=($t+$`)%86400],$t=($t+$')%86400for<>;\n$%=$i+=$_ for@_[0..10800];\n$i=$i+$_[$_]-$_[$_-10801],$%+=$-=$i-$%for 10801..86399;\nprint$%,$/", "language": "Perl", "metadata": {"date": 1480277655, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03895.html", "problem_id": "p03895", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03895/input.txt", "sample_output_relpath": "derived/input_output/data/p03895/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03895/Perl/s384965025.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s384965025", "user_id": "u467549634"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "<>;\n/ /,++$_[$t=($t+$`)%86400],$t=($t+$')%86400for<>;\n$%=$i+=$_ for@_[0..10800];\n$i=$i+$_[$_]-$_[$_-10801],$%+=$-=$i-$%for 10801..86399;\nprint$%,$/", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi recorded his daily life for the last few days as a integer sequence of length 2N, as follows:\n\na_1, b_1, a_2, b_2, ... , a_N, b_N\n\nThis means that, starting from a certain time T, he was:\n\nsleeping for exactly a_1 seconds\n\nthen awake for exactly b_1 seconds\n\nthen sleeping for exactly a_2 seconds\n\n:\n\nthen sleeping for exactly a_N seconds\n\nthen awake for exactly b_N seconds\n\nIn this record, he waked up N times.\n\nTakahashi is wondering how many times he waked up early during the recorded period.\n\nHere, he is said to wake up early if he wakes up between 4:00 AM and 7:00 AM, inclusive.\n\nIf he wakes up more than once during this period, each of these awakenings is counted as waking up early.\n\nUnfortunately, he forgot the time T.\n\nFind the maximum possible number of times he waked up early during the recorded period.\n\nFor your information, a day consists of 86400 seconds, and the length of the period between 4:00 AM and 7:00 AM is 10800 seconds.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i \\leq 10^5\n\na_i and b_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_N b_N\n\nOutput\n\nPrint the maximum possible number of times he waked up early during the recorded period.\n\nSample Input 1\n\n3\n28800 57600\n28800 57600\n57600 28800\n\nSample Output 1\n\n2\n\nSample Input 2\n\n10\n28800 57600\n4800 9600\n6000 1200\n600 600\n300 600\n5400 600\n6000 5760\n6760 2880\n6000 12000\n9000 600\n\nSample Output 2\n\n5", "sample_input": "3\n28800 57600\n28800 57600\n57600 28800\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03895", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi recorded his daily life for the last few days as a integer sequence of length 2N, as follows:\n\na_1, b_1, a_2, b_2, ... , a_N, b_N\n\nThis means that, starting from a certain time T, he was:\n\nsleeping for exactly a_1 seconds\n\nthen awake for exactly b_1 seconds\n\nthen sleeping for exactly a_2 seconds\n\n:\n\nthen sleeping for exactly a_N seconds\n\nthen awake for exactly b_N seconds\n\nIn this record, he waked up N times.\n\nTakahashi is wondering how many times he waked up early during the recorded period.\n\nHere, he is said to wake up early if he wakes up between 4:00 AM and 7:00 AM, inclusive.\n\nIf he wakes up more than once during this period, each of these awakenings is counted as waking up early.\n\nUnfortunately, he forgot the time T.\n\nFind the maximum possible number of times he waked up early during the recorded period.\n\nFor your information, a day consists of 86400 seconds, and the length of the period between 4:00 AM and 7:00 AM is 10800 seconds.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i \\leq 10^5\n\na_i and b_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_N b_N\n\nOutput\n\nPrint the maximum possible number of times he waked up early during the recorded period.\n\nSample Input 1\n\n3\n28800 57600\n28800 57600\n57600 28800\n\nSample Output 1\n\n2\n\nSample Input 2\n\n10\n28800 57600\n4800 9600\n6000 1200\n600 600\n300 600\n5400 600\n6000 5760\n6760 2880\n6000 12000\n9000 600\n\nSample Output 2\n\n5", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 195, "memory_kb": 17792}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s942092156", "group_id": "codeNet:p03901", "input_text": "say -get+>1*100/-get", "language": "Perl", "metadata": {"date": 1587430880, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03901.html", "problem_id": "p03901", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03901/input.txt", "sample_output_relpath": "derived/input_output/data/p03901/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03901/Perl/s942092156.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s942092156", "user_id": "u657913472"}, "prompt_components": {"gold_output": "2.0000000\n", "input_to_evaluate": "say -get+>1*100/-get", "problem_context": "Score : 700 points\n\nProblem Statement\n\nAoki is in search of Takahashi, who is missing in a one-dimentional world.\nInitially, the coordinate of Aoki is 0, and the coordinate of Takahashi is known to be x, but his coordinate afterwards cannot be known to Aoki.\n\nTime is divided into turns. In each turn, Aoki and Takahashi take the following actions simultaneously:\n\nLet the current coordinate of Aoki be a, then Aoki moves to a coordinate he selects from a-1, a and a+1.\n\nLet the current coordinate of Takahashi be b, then Takahashi moves to the coordinate b-1 with probability of p percent, and moves to the coordinate b+1 with probability of 100-p percent.\n\nWhen the coordinates of Aoki and Takahashi coincide, Aoki can find Takahashi.\nWhen they pass by each other, Aoki cannot find Takahashi.\n\nAoki wants to minimize the expected number of turns taken until he finds Takahashi. Find the minimum possible expected number of turns.\n\nConstraints\n\n1 ≦ x ≦ 1,000,000,000\n\n1 ≦ p ≦ 100\n\nx and p are integers.\n\nPartial Scores\n\nIn the test set worth 200 points, p=100.\n\nIn the test set worth 300 points, x ≦ 10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\np\n\nOutput\n\nPrint the minimum possible expected number of turns.\nThe output is considered correct if the absolute or relative error is at most 10^{-6}.\n\nSample Input 1\n\n3\n100\n\nSample Output 1\n\n2.0000000\n\nTakahashi always moves by -1.\nThus, by moving to the coordinate 1 in the 1-st turn and staying at that position in the 2-nd turn, Aoki can find Takahashi in 2 turns.\n\nSample Input 2\n\n6\n40\n\nSample Output 2\n\n7.5000000\n\nSample Input 3\n\n101\n80\n\nSample Output 3\n\n63.7500000", "sample_input": "3\n100\n"}, "reference_outputs": ["2.0000000\n"], "source_document_id": "p03901", "source_text": "Score : 700 points\n\nProblem Statement\n\nAoki is in search of Takahashi, who is missing in a one-dimentional world.\nInitially, the coordinate of Aoki is 0, and the coordinate of Takahashi is known to be x, but his coordinate afterwards cannot be known to Aoki.\n\nTime is divided into turns. In each turn, Aoki and Takahashi take the following actions simultaneously:\n\nLet the current coordinate of Aoki be a, then Aoki moves to a coordinate he selects from a-1, a and a+1.\n\nLet the current coordinate of Takahashi be b, then Takahashi moves to the coordinate b-1 with probability of p percent, and moves to the coordinate b+1 with probability of 100-p percent.\n\nWhen the coordinates of Aoki and Takahashi coincide, Aoki can find Takahashi.\nWhen they pass by each other, Aoki cannot find Takahashi.\n\nAoki wants to minimize the expected number of turns taken until he finds Takahashi. Find the minimum possible expected number of turns.\n\nConstraints\n\n1 ≦ x ≦ 1,000,000,000\n\n1 ≦ p ≦ 100\n\nx and p are integers.\n\nPartial Scores\n\nIn the test set worth 200 points, p=100.\n\nIn the test set worth 300 points, x ≦ 10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\np\n\nOutput\n\nPrint the minimum possible expected number of turns.\nThe output is considered correct if the absolute or relative error is at most 10^{-6}.\n\nSample Input 1\n\n3\n100\n\nSample Output 1\n\n2.0000000\n\nTakahashi always moves by -1.\nThus, by moving to the coordinate 1 in the 1-st turn and staying at that position in the 2-nd turn, Aoki can find Takahashi in 2 turns.\n\nSample Input 2\n\n6\n40\n\nSample Output 2\n\n7.5000000\n\nSample Input 3\n\n101\n80\n\nSample Output 3\n\n63.7500000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20, "cpu_time_ms": 270, "memory_kb": 62596}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s895809286", "group_id": "codeNet:p03901", "input_text": "print+(<>+1>>1)*100/<>", "language": "Perl", "metadata": {"date": 1480292517, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03901.html", "problem_id": "p03901", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03901/input.txt", "sample_output_relpath": "derived/input_output/data/p03901/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03901/Perl/s895809286.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s895809286", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2.0000000\n", "input_to_evaluate": "print+(<>+1>>1)*100/<>", "problem_context": "Score : 700 points\n\nProblem Statement\n\nAoki is in search of Takahashi, who is missing in a one-dimentional world.\nInitially, the coordinate of Aoki is 0, and the coordinate of Takahashi is known to be x, but his coordinate afterwards cannot be known to Aoki.\n\nTime is divided into turns. In each turn, Aoki and Takahashi take the following actions simultaneously:\n\nLet the current coordinate of Aoki be a, then Aoki moves to a coordinate he selects from a-1, a and a+1.\n\nLet the current coordinate of Takahashi be b, then Takahashi moves to the coordinate b-1 with probability of p percent, and moves to the coordinate b+1 with probability of 100-p percent.\n\nWhen the coordinates of Aoki and Takahashi coincide, Aoki can find Takahashi.\nWhen they pass by each other, Aoki cannot find Takahashi.\n\nAoki wants to minimize the expected number of turns taken until he finds Takahashi. Find the minimum possible expected number of turns.\n\nConstraints\n\n1 ≦ x ≦ 1,000,000,000\n\n1 ≦ p ≦ 100\n\nx and p are integers.\n\nPartial Scores\n\nIn the test set worth 200 points, p=100.\n\nIn the test set worth 300 points, x ≦ 10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\np\n\nOutput\n\nPrint the minimum possible expected number of turns.\nThe output is considered correct if the absolute or relative error is at most 10^{-6}.\n\nSample Input 1\n\n3\n100\n\nSample Output 1\n\n2.0000000\n\nTakahashi always moves by -1.\nThus, by moving to the coordinate 1 in the 1-st turn and staying at that position in the 2-nd turn, Aoki can find Takahashi in 2 turns.\n\nSample Input 2\n\n6\n40\n\nSample Output 2\n\n7.5000000\n\nSample Input 3\n\n101\n80\n\nSample Output 3\n\n63.7500000", "sample_input": "3\n100\n"}, "reference_outputs": ["2.0000000\n"], "source_document_id": "p03901", "source_text": "Score : 700 points\n\nProblem Statement\n\nAoki is in search of Takahashi, who is missing in a one-dimentional world.\nInitially, the coordinate of Aoki is 0, and the coordinate of Takahashi is known to be x, but his coordinate afterwards cannot be known to Aoki.\n\nTime is divided into turns. In each turn, Aoki and Takahashi take the following actions simultaneously:\n\nLet the current coordinate of Aoki be a, then Aoki moves to a coordinate he selects from a-1, a and a+1.\n\nLet the current coordinate of Takahashi be b, then Takahashi moves to the coordinate b-1 with probability of p percent, and moves to the coordinate b+1 with probability of 100-p percent.\n\nWhen the coordinates of Aoki and Takahashi coincide, Aoki can find Takahashi.\nWhen they pass by each other, Aoki cannot find Takahashi.\n\nAoki wants to minimize the expected number of turns taken until he finds Takahashi. Find the minimum possible expected number of turns.\n\nConstraints\n\n1 ≦ x ≦ 1,000,000,000\n\n1 ≦ p ≦ 100\n\nx and p are integers.\n\nPartial Scores\n\nIn the test set worth 200 points, p=100.\n\nIn the test set worth 300 points, x ≦ 10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\np\n\nOutput\n\nPrint the minimum possible expected number of turns.\nThe output is considered correct if the absolute or relative error is at most 10^{-6}.\n\nSample Input 1\n\n3\n100\n\nSample Output 1\n\n2.0000000\n\nTakahashi always moves by -1.\nThus, by moving to the coordinate 1 in the 1-st turn and staying at that position in the 2-nd turn, Aoki can find Takahashi in 2 turns.\n\nSample Input 2\n\n6\n40\n\nSample Output 2\n\n7.5000000\n\nSample Input 3\n\n101\n80\n\nSample Output 3\n\n63.7500000", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 22, "cpu_time_ms": 5, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s139476749", "group_id": "codeNet:p03920", "input_text": "$n=<>;0while$i++*$i/2<$n;print\"@{[grep$_-$i*($i+1)/2+$n,1..$i]}\"", "language": "Perl", "metadata": {"date": 1567180996, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03920.html", "problem_id": "p03920", "resource_group": "low_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/Perl/s139476749.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s139476749", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n3\n", "input_to_evaluate": "$n=<>;0while$i++*$i/2<$n;print\"@{[grep$_-$i*($i+1)/2+$n,1..$i]}\"", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 64, "cpu_time_ms": 6, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s883799702", "group_id": "codeNet:p03921", "input_text": "($N,$M)=glob<>;\n$L[++$i]=[glob],shift@{$L[$i]}for<>;\nfor$L(@L[1..$N]){\n\t$f=@{$L}[0];\n\tif($p[$f]==0){\n\t\t$p[$f]=++$p;\n\t\t$q[$p[$f]]=$p;\n\t}\n\tfor$e(@{$L}){\n\t\tif($p[$e]){\n\t\t\t$q[$p[$e]]=$q[$p[$f]];\n\t\t}else{\n\t\t\t$p[$e]=$p[$f];\n\t\t}\n\t}\n}\nfor$L(@L[1..$N]){\n\tfor$e(@{$L}){\n\t\tif($q[$p[$e]]!=$q[1]){\n\t\t\t$x=1;\n\t\t}\n\t}\n}\nprint$x?NO:YES,$/", "language": "Perl", "metadata": {"date": 1480194406, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03921.html", "problem_id": "p03921", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03921/input.txt", "sample_output_relpath": "derived/input_output/data/p03921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03921/Perl/s883799702.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s883799702", "user_id": "u283869437"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "($N,$M)=glob<>;\n$L[++$i]=[glob],shift@{$L[$i]}for<>;\nfor$L(@L[1..$N]){\n\t$f=@{$L}[0];\n\tif($p[$f]==0){\n\t\t$p[$f]=++$p;\n\t\t$q[$p[$f]]=$p;\n\t}\n\tfor$e(@{$L}){\n\t\tif($p[$e]){\n\t\t\t$q[$p[$e]]=$q[$p[$f]];\n\t\t}else{\n\t\t\t$p[$e]=$p[$f];\n\t\t}\n\t}\n}\nfor$L(@L[1..$N]){\n\tfor$e(@{$L}){\n\t\tif($q[$p[$e]]!=$q[1]){\n\t\t\t$x=1;\n\t\t}\n\t}\n}\nprint$x?NO:YES,$/", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOn a planet far, far away, M languages are spoken. They are conveniently numbered 1 through M.\n\nFor CODE FESTIVAL 20XX held on this planet, N participants gathered from all over the planet.\n\nThe i-th (1≦i≦N) participant can speak K_i languages numbered L_{i,1}, L_{i,2}, ..., L_{i,{}K_i}.\n\nTwo participants A and B can communicate with each other if and only if one of the following conditions is satisfied:\n\nThere exists a language that both A and B can speak.\n\nThere exists a participant X that both A and B can communicate with.\n\nDetermine whether all N participants can communicate with all other participants.\n\nConstraints\n\n2≦N≦10^5\n\n1≦M≦10^5\n\n1≦K_i≦M\n\n(The sum of all K_i)≦10^5\n\n1≦L_{i,j}≦M\n\nL_{i,1}, L_{i,2}, ..., L_{i,{}K_i} are pairwise distinct.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying the following: N≦1000, M≦1000 and (The sum of all K_i)≦1000.\n\nAdditional 200 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 M\nK_1 L_{1,1} L_{1,2} ... L_{1,{}K_1}\nK_2 L_{2,1} L_{2,2} ... L_{2,{}K_2}\n:\nK_N L_{N,1} L_{N,2} ... L_{N,{}K_N}\n\nOutput\n\nIf all N participants can communicate with all other participants, print YES. Otherwise, print NO.\n\nSample Input 1\n\n4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n\nSample Output 1\n\nYES\n\nAny two participants can communicate with each other, as follows:\n\nParticipants 1 and 2: both can speak language 2.\n\nParticipants 2 and 3: both can speak language 4.\n\nParticipants 1 and 3: both can communicate with participant 2.\n\nParticipants 3 and 4: both can speak language 6.\n\nParticipants 2 and 4: both can communicate with participant 3.\n\nParticipants 1 and 4: both can communicate with participant 2.\n\nNote that there can be languages spoken by no participant.\n\nSample Input 2\n\n4 4\n2 1 2\n2 1 2\n1 3\n2 4 3\n\nSample Output 2\n\nNO\n\nFor example, participants 1 and 3 cannot communicate with each other.", "sample_input": "4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03921", "source_text": "Score : 400 points\n\nProblem Statement\n\nOn a planet far, far away, M languages are spoken. They are conveniently numbered 1 through M.\n\nFor CODE FESTIVAL 20XX held on this planet, N participants gathered from all over the planet.\n\nThe i-th (1≦i≦N) participant can speak K_i languages numbered L_{i,1}, L_{i,2}, ..., L_{i,{}K_i}.\n\nTwo participants A and B can communicate with each other if and only if one of the following conditions is satisfied:\n\nThere exists a language that both A and B can speak.\n\nThere exists a participant X that both A and B can communicate with.\n\nDetermine whether all N participants can communicate with all other participants.\n\nConstraints\n\n2≦N≦10^5\n\n1≦M≦10^5\n\n1≦K_i≦M\n\n(The sum of all K_i)≦10^5\n\n1≦L_{i,j}≦M\n\nL_{i,1}, L_{i,2}, ..., L_{i,{}K_i} are pairwise distinct.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying the following: N≦1000, M≦1000 and (The sum of all K_i)≦1000.\n\nAdditional 200 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 M\nK_1 L_{1,1} L_{1,2} ... L_{1,{}K_1}\nK_2 L_{2,1} L_{2,2} ... L_{2,{}K_2}\n:\nK_N L_{N,1} L_{N,2} ... L_{N,{}K_N}\n\nOutput\n\nIf all N participants can communicate with all other participants, print YES. Otherwise, print NO.\n\nSample Input 1\n\n4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n\nSample Output 1\n\nYES\n\nAny two participants can communicate with each other, as follows:\n\nParticipants 1 and 2: both can speak language 2.\n\nParticipants 2 and 3: both can speak language 4.\n\nParticipants 1 and 3: both can communicate with participant 2.\n\nParticipants 3 and 4: both can speak language 6.\n\nParticipants 2 and 4: both can communicate with participant 3.\n\nParticipants 1 and 4: both can communicate with participant 2.\n\nNote that there can be languages spoken by no participant.\n\nSample Input 2\n\n4 4\n2 1 2\n2 1 2\n1 3\n2 4 3\n\nSample Output 2\n\nNO\n\nFor example, participants 1 and 3 cannot communicate with each other.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 836, "memory_kb": 31872}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s124432941", "group_id": "codeNet:p03937", "input_text": "<>;/#+/,$x.=\"@-@+\"-1for<>;print$x=~/^((.)\\2)*.$/?P:Imp,ossible", "language": "Perl", "metadata": {"date": 1479319385, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03937.html", "problem_id": "p03937", "resource_group": "low_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/Perl/s124432941.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s124432941", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Possible\n", "input_to_evaluate": "<>;/#+/,$x.=\"@-@+\"-1for<>;print$x=~/^((.)\\2)*.$/?P:Imp,ossible", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s883655067", "group_id": "codeNet:p03938", "input_text": "print$,=$\",map($x=$_*$<,@a[map$_-1,glob<>]=1..<>),map$_+($x-=$<),@a", "language": "Perl", "metadata": {"date": 1550152179, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03938.html", "problem_id": "p03938", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03938/input.txt", "sample_output_relpath": "derived/input_output/data/p03938/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03938/Perl/s883655067.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s883655067", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1 4\n5 4\n", "input_to_evaluate": "print$,=$\",map($x=$_*$<,@a[map$_-1,glob<>]=1..<>),map$_+($x-=$<),@a", "problem_context": "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", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 84, "memory_kb": 9088}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s381172687", "group_id": "codeNet:p03938", "input_text": "print$,=$\",map($x=$_*3e3,@a[map$_-1,glob<>]=1..<>),map$_+($x-=3e3),@a", "language": "Perl", "metadata": {"date": 1520374988, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03938.html", "problem_id": "p03938", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03938/input.txt", "sample_output_relpath": "derived/input_output/data/p03938/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03938/Perl/s381172687.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s381172687", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1 4\n5 4\n", "input_to_evaluate": "print$,=$\",map($x=$_*3e3,@a[map$_-1,glob<>]=1..<>),map$_+($x-=3e3),@a", "problem_context": "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", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 75, "memory_kb": 9088}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s013734123", "group_id": "codeNet:p03944", "input_text": "($s,$u)=glob<>;${@g=map{$a=$_,-$_}glob;$t=$a^A}-=$-=$$t+$g[$a-1]for<>;print+($-=$s+$p)*1*($-=$u+$r)", "language": "Perl", "metadata": {"date": 1536210666, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03944.html", "problem_id": "p03944", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03944/input.txt", "sample_output_relpath": "derived/input_output/data/p03944/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03944/Perl/s013734123.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s013734123", "user_id": "u283869437"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "($s,$u)=glob<>;${@g=map{$a=$_,-$_}glob;$t=$a^A}-=$-=$$t+$g[$a-1]for<>;print+($-=$s+$p)*1*($-=$u+$r)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "sample_input": "5 4 2\n2 1 1\n3 3 4\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03944", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s234836073", "group_id": "codeNet:p03944", "input_text": "($s,$u)=glob<>;/ .* (.*)/,${$t=A^$1}-=$-=$$t+($`,-$`,$&,-$&)[$1-1]for<>;print+($-=$s+$p)*1*($-=$u+$r)", "language": "Perl", "metadata": {"date": 1536208353, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03944.html", "problem_id": "p03944", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03944/input.txt", "sample_output_relpath": "derived/input_output/data/p03944/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03944/Perl/s234836073.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s234836073", "user_id": "u283869437"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "($s,$u)=glob<>;/ .* (.*)/,${$t=A^$1}-=$-=$$t+($`,-$`,$&,-$&)[$1-1]for<>;print+($-=$s+$p)*1*($-=$u+$r)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "sample_input": "5 4 2\n2 1 1\n3 3 4\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03944", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 101, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s213729407", "group_id": "codeNet:p03947", "input_text": "print s/BW/$&/g+s/WB//g for<>", "language": "Perl", "metadata": {"date": 1478488233, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03947.html", "problem_id": "p03947", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03947/input.txt", "sample_output_relpath": "derived/input_output/data/p03947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03947/Perl/s213729407.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s213729407", "user_id": "u207056619"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "print s/BW/$&/g+s/WB//g for<>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTwo foxes Jiro and Saburo are playing a game called 1D Reversi. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones between the new white stone and another white stone, turn into white stones, and vice versa.\n\nIn the middle of a game, something came up and Saburo has to leave the game. The state of the board at this point is described by a string S. There are |S| (the length of S) stones on the board, and each character in S represents the color of the i-th (1 ≦ i ≦ |S|) stone from the left. If the i-th character in S is B, it means that the color of the corresponding stone on the board is black. Similarly, if the i-th character in S is W, it means that the color of the corresponding stone is white.\n\nJiro wants all stones on the board to be of the same color. For this purpose, he will place new stones on the board according to the rules. Find the minimum number of new stones that he needs to place.\n\nConstraints\n\n1 ≦ |S| ≦ 10^5\n\nEach character in S is B or W.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of new stones that Jiro needs to place for his purpose.\n\nSample Input 1\n\nBBBWW\n\nSample Output 1\n\n1\n\nBy placing a new black stone to the right end of the row of stones, all white stones will become black. Also, by placing a new white stone to the left end of the row of stones, all black stones will become white.\n\nIn either way, Jiro's purpose can be achieved by placing one stone.\n\nSample Input 2\n\nWWWWWW\n\nSample Output 2\n\n0\n\nIf all stones are already of the same color, no new stone is necessary.\n\nSample Input 3\n\nWBWBWBWBWB\n\nSample Output 3\n\n9", "sample_input": "BBBWW\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03947", "source_text": "Score : 300 points\n\nProblem Statement\n\nTwo foxes Jiro and Saburo are playing a game called 1D Reversi. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones between the new white stone and another white stone, turn into white stones, and vice versa.\n\nIn the middle of a game, something came up and Saburo has to leave the game. The state of the board at this point is described by a string S. There are |S| (the length of S) stones on the board, and each character in S represents the color of the i-th (1 ≦ i ≦ |S|) stone from the left. If the i-th character in S is B, it means that the color of the corresponding stone on the board is black. Similarly, if the i-th character in S is W, it means that the color of the corresponding stone is white.\n\nJiro wants all stones on the board to be of the same color. For this purpose, he will place new stones on the board according to the rules. Find the minimum number of new stones that he needs to place.\n\nConstraints\n\n1 ≦ |S| ≦ 10^5\n\nEach character in S is B or W.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of new stones that Jiro needs to place for his purpose.\n\nSample Input 1\n\nBBBWW\n\nSample Output 1\n\n1\n\nBy placing a new black stone to the right end of the row of stones, all white stones will become black. Also, by placing a new white stone to the left end of the row of stones, all black stones will become white.\n\nIn either way, Jiro's purpose can be achieved by placing one stone.\n\nSample Input 2\n\nWWWWWW\n\nSample Output 2\n\n0\n\nIf all stones are already of the same color, no new stone is necessary.\n\nSample Input 3\n\nWBWBWBWBWB\n\nSample Output 3\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 29, "cpu_time_ms": 31, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s199539625", "group_id": "codeNet:p03947", "input_text": "print~-(@_=<>=~/(.)\\1*/g)", "language": "Perl", "metadata": {"date": 1478488039, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03947.html", "problem_id": "p03947", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03947/input.txt", "sample_output_relpath": "derived/input_output/data/p03947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03947/Perl/s199539625.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s199539625", "user_id": "u283869437"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "print~-(@_=<>=~/(.)\\1*/g)", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTwo foxes Jiro and Saburo are playing a game called 1D Reversi. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones between the new white stone and another white stone, turn into white stones, and vice versa.\n\nIn the middle of a game, something came up and Saburo has to leave the game. The state of the board at this point is described by a string S. There are |S| (the length of S) stones on the board, and each character in S represents the color of the i-th (1 ≦ i ≦ |S|) stone from the left. If the i-th character in S is B, it means that the color of the corresponding stone on the board is black. Similarly, if the i-th character in S is W, it means that the color of the corresponding stone is white.\n\nJiro wants all stones on the board to be of the same color. For this purpose, he will place new stones on the board according to the rules. Find the minimum number of new stones that he needs to place.\n\nConstraints\n\n1 ≦ |S| ≦ 10^5\n\nEach character in S is B or W.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of new stones that Jiro needs to place for his purpose.\n\nSample Input 1\n\nBBBWW\n\nSample Output 1\n\n1\n\nBy placing a new black stone to the right end of the row of stones, all white stones will become black. Also, by placing a new white stone to the left end of the row of stones, all black stones will become white.\n\nIn either way, Jiro's purpose can be achieved by placing one stone.\n\nSample Input 2\n\nWWWWWW\n\nSample Output 2\n\n0\n\nIf all stones are already of the same color, no new stone is necessary.\n\nSample Input 3\n\nWBWBWBWBWB\n\nSample Output 3\n\n9", "sample_input": "BBBWW\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03947", "source_text": "Score : 300 points\n\nProblem Statement\n\nTwo foxes Jiro and Saburo are playing a game called 1D Reversi. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones between the new white stone and another white stone, turn into white stones, and vice versa.\n\nIn the middle of a game, something came up and Saburo has to leave the game. The state of the board at this point is described by a string S. There are |S| (the length of S) stones on the board, and each character in S represents the color of the i-th (1 ≦ i ≦ |S|) stone from the left. If the i-th character in S is B, it means that the color of the corresponding stone on the board is black. Similarly, if the i-th character in S is W, it means that the color of the corresponding stone is white.\n\nJiro wants all stones on the board to be of the same color. For this purpose, he will place new stones on the board according to the rules. Find the minimum number of new stones that he needs to place.\n\nConstraints\n\n1 ≦ |S| ≦ 10^5\n\nEach character in S is B or W.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of new stones that Jiro needs to place for his purpose.\n\nSample Input 1\n\nBBBWW\n\nSample Output 1\n\n1\n\nBy placing a new black stone to the right end of the row of stones, all white stones will become black. Also, by placing a new white stone to the left end of the row of stones, all black stones will become white.\n\nIn either way, Jiro's purpose can be achieved by placing one stone.\n\nSample Input 2\n\nWWWWWW\n\nSample Output 2\n\n0\n\nIf all stones are already of the same color, no new stone is necessary.\n\nSample Input 3\n\nWBWBWBWBWB\n\nSample Output 3\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 25, "cpu_time_ms": 55, "memory_kb": 14080}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s065339687", "group_id": "codeNet:p03948", "input_text": "<>;$m=1e9;$\\=(($%+=$-=$_-($m-=$-=$m-$_)-$%)==$_-$m)+$\\*!$-for glob<>;print", "language": "Perl", "metadata": {"date": 1539078479, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03948.html", "problem_id": "p03948", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03948/input.txt", "sample_output_relpath": "derived/input_output/data/p03948/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03948/Perl/s065339687.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s065339687", "user_id": "u657913472"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "<>;$m=1e9;$\\=(($%+=$-=$_-($m-=$-=$m-$_)-$%)==$_-$m)+$\\*!$-for glob<>;print", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N towns located in a line, conveniently numbered 1 through N. Takahashi the merchant is going on a travel from town 1 to town N, buying and selling apples.\n\nTakahashi will begin the travel at town 1, with no apple in his possession. The actions that can be performed during the travel are as follows:\n\nMove: When at town i (i < N), move to town i + 1.\n\nMerchandise: Buy or sell an arbitrary number of apples at the current town. Here, it is assumed that one apple can always be bought and sold for A_i yen (the currency of Japan) at town i (1 ≦ i ≦ N), where A_i are distinct integers. Also, you can assume that he has an infinite supply of money.\n\nFor some reason, there is a constraint on merchandising apple during the travel: the sum of the number of apples bought and the number of apples sold during the whole travel, must be at most T. (Note that a single apple can be counted in both.)\n\nDuring the travel, Takahashi will perform actions so that the profit of the travel is maximized. Here, the profit of the travel is the amount of money that is gained by selling apples, minus the amount of money that is spent on buying apples. Note that we are not interested in apples in his possession at the end of the travel.\n\nAoki, a business rival of Takahashi, wants to trouble Takahashi by manipulating the market price of apples. Prior to the beginning of Takahashi's travel, Aoki can change A_i into another arbitrary non-negative integer A_i' for any town i, any number of times. The cost of performing this operation is |A_i - A_i'|. After performing this operation, different towns may have equal values of A_i.\n\nAoki's objective is to decrease Takahashi's expected profit by at least 1 yen. Find the minimum total cost to achieve it. You may assume that Takahashi's expected profit is initially at least 1 yen.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nA_i are distinct.\n\n2 ≦ T ≦ 10^9\n\nIn the initial state, Takahashi's expected profit is at least 1 yen.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN T\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum total cost to decrease Takahashi's expected profit by at least 1 yen.\n\nSample Input 1\n\n3 2\n100 50 200\n\nSample Output 1\n\n1\n\nIn the initial state, Takahashi can achieve the maximum profit of 150 yen as follows:\n\nMove from town 1 to town 2.\n\nBuy one apple for 50 yen at town 2.\n\nMove from town 2 to town 3.\n\nSell one apple for 200 yen at town 3.\n\nIf, for example, Aoki changes the price of an apple at town 2 from 50 yen to 51 yen, Takahashi will not be able to achieve the profit of 150 yen. The cost of performing this operation is 1, thus the answer is 1.\n\nThere are other ways to decrease Takahashi's expected profit, such as changing the price of an apple at town 3 from 200 yen to 199 yen.\n\nSample Input 2\n\n5 8\n50 30 40 10 20\n\nSample Output 2\n\n2\n\nSample Input 3\n\n10 100\n7 10 4 5 9 3 6 8 2 1\n\nSample Output 3\n\n2", "sample_input": "3 2\n100 50 200\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03948", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N towns located in a line, conveniently numbered 1 through N. Takahashi the merchant is going on a travel from town 1 to town N, buying and selling apples.\n\nTakahashi will begin the travel at town 1, with no apple in his possession. The actions that can be performed during the travel are as follows:\n\nMove: When at town i (i < N), move to town i + 1.\n\nMerchandise: Buy or sell an arbitrary number of apples at the current town. Here, it is assumed that one apple can always be bought and sold for A_i yen (the currency of Japan) at town i (1 ≦ i ≦ N), where A_i are distinct integers. Also, you can assume that he has an infinite supply of money.\n\nFor some reason, there is a constraint on merchandising apple during the travel: the sum of the number of apples bought and the number of apples sold during the whole travel, must be at most T. (Note that a single apple can be counted in both.)\n\nDuring the travel, Takahashi will perform actions so that the profit of the travel is maximized. Here, the profit of the travel is the amount of money that is gained by selling apples, minus the amount of money that is spent on buying apples. Note that we are not interested in apples in his possession at the end of the travel.\n\nAoki, a business rival of Takahashi, wants to trouble Takahashi by manipulating the market price of apples. Prior to the beginning of Takahashi's travel, Aoki can change A_i into another arbitrary non-negative integer A_i' for any town i, any number of times. The cost of performing this operation is |A_i - A_i'|. After performing this operation, different towns may have equal values of A_i.\n\nAoki's objective is to decrease Takahashi's expected profit by at least 1 yen. Find the minimum total cost to achieve it. You may assume that Takahashi's expected profit is initially at least 1 yen.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nA_i are distinct.\n\n2 ≦ T ≦ 10^9\n\nIn the initial state, Takahashi's expected profit is at least 1 yen.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN T\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum total cost to decrease Takahashi's expected profit by at least 1 yen.\n\nSample Input 1\n\n3 2\n100 50 200\n\nSample Output 1\n\n1\n\nIn the initial state, Takahashi can achieve the maximum profit of 150 yen as follows:\n\nMove from town 1 to town 2.\n\nBuy one apple for 50 yen at town 2.\n\nMove from town 2 to town 3.\n\nSell one apple for 200 yen at town 3.\n\nIf, for example, Aoki changes the price of an apple at town 2 from 50 yen to 51 yen, Takahashi will not be able to achieve the profit of 150 yen. The cost of performing this operation is 1, thus the answer is 1.\n\nThere are other ways to decrease Takahashi's expected profit, such as changing the price of an apple at town 3 from 200 yen to 199 yen.\n\nSample Input 2\n\n5 8\n50 30 40 10 20\n\nSample Output 2\n\n2\n\nSample Input 3\n\n10 100\n7 10 4 5 9 3 6 8 2 1\n\nSample Output 3\n\n2", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 347, "memory_kb": 21504}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s787546540", "group_id": "codeNet:p03951", "input_text": "chomp( my $n = <> );\nchomp( my $s = <> );\nchomp( my $t = <> );\n\nwhile ( $s ) {\n $s eq $t and print 2*$n - length $s and exit;\n substr $s, 0, 1, '';\n substr $t, -1, 1, '';\n}\nprint 2*$n;", "language": "Perl", "metadata": {"date": 1565398824, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03951.html", "problem_id": "p03951", "resource_group": "low_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/Perl/s787546540.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s787546540", "user_id": "u822702091"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "chomp( my $n = <> );\nchomp( my $s = <> );\nchomp( my $t = <> );\n\nwhile ( $s ) {\n $s eq $t and print 2*$n - length $s and exit;\n substr $s, 0, 1, '';\n substr $t, -1, 1, '';\n}\nprint 2*$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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s397609069", "group_id": "codeNet:p03957", "input_text": "print<>=~/C.*F/?Yes:No,$/", "language": "Perl", "metadata": {"date": 1477270825, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03957.html", "problem_id": "p03957", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03957/input.txt", "sample_output_relpath": "derived/input_output/data/p03957/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03957/Perl/s397609069.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s397609069", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "print<>=~/C.*F/?Yes:No,$/", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODEFESTIVAL, which can be shortened to the string CF by deleting some characters.\n\nMr. Takahashi, full of curiosity, wondered if he could obtain CF from other strings in the same way.\n\nYou are given a string s consisting of uppercase English letters.\nDetermine whether the string CF can be obtained from the string s by deleting some characters.\n\nConstraints\n\n2 ≤ |s| ≤ 100\n\nAll characters in s are uppercase English letters (A-Z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint Yes if the string CF can be obtained from the string s by deleting some characters.\nOtherwise print No.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nYes\n\nCF is obtained by deleting characters other than the first character C and the fifth character F.\n\nSample Input 2\n\nFESTIVALCODE\n\nSample Output 2\n\nNo\n\nFC can be obtained but CF cannot be obtained because you cannot change the order of the characters.\n\nSample Input 3\n\nCF\n\nSample Output 3\n\nYes\n\nIt is also possible not to delete any characters.\n\nSample Input 4\n\nFCF\n\nSample Output 4\n\nYes\n\nCF is obtained by deleting the first character.", "sample_input": "CODEFESTIVAL\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03957", "source_text": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODEFESTIVAL, which can be shortened to the string CF by deleting some characters.\n\nMr. Takahashi, full of curiosity, wondered if he could obtain CF from other strings in the same way.\n\nYou are given a string s consisting of uppercase English letters.\nDetermine whether the string CF can be obtained from the string s by deleting some characters.\n\nConstraints\n\n2 ≤ |s| ≤ 100\n\nAll characters in s are uppercase English letters (A-Z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint Yes if the string CF can be obtained from the string s by deleting some characters.\nOtherwise print No.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nYes\n\nCF is obtained by deleting characters other than the first character C and the fifth character F.\n\nSample Input 2\n\nFESTIVALCODE\n\nSample Output 2\n\nNo\n\nFC can be obtained but CF cannot be obtained because you cannot change the order of the characters.\n\nSample Input 3\n\nCF\n\nSample Output 3\n\nYes\n\nIt is also possible not to delete any characters.\n\nSample Input 4\n\nFCF\n\nSample Output 4\n\nYes\n\nCF is obtained by deleting the first character.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 25, "cpu_time_ms": 5, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s310370752", "group_id": "codeNet:p03959", "input_text": "$N=<>;\n@T=(0,(glob<>),0);\n@A=(0,(glob<>),0);\n$x=1;\n$d[$_]=$T[$_-1]<$T[$_]for 1..$#T-1;\nfor($i=$#T-1;$i;--$i){\n\t$A[$i]==$T[$#T-1]&&$T[$i]==$T[$#T-1]&&++$f;\n\t$d[$i]|=$A[$i]>$A[$i+1]\n}\n$d[$_]or$x=($x*($T[$_]<$A[$_]?$T[$_]:$A[$_]))%1000000007for 1..$#T-1;\nprint$x*($f&&$T[$#T-1]==$A[1]),$/", "language": "Perl", "metadata": {"date": 1477277237, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03959.html", "problem_id": "p03959", "resource_group": "low_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/Perl/s310370752.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s310370752", "user_id": "u283869437"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$N=<>;\n@T=(0,(glob<>),0);\n@A=(0,(glob<>),0);\n$x=1;\n$d[$_]=$T[$_-1]<$T[$_]for 1..$#T-1;\nfor($i=$#T-1;$i;--$i){\n\t$A[$i]==$T[$#T-1]&&$T[$i]==$T[$#T-1]&&++$f;\n\t$d[$i]|=$A[$i]>$A[$i+1]\n}\n$d[$_]or$x=($x*($T[$_]<$A[$_]?$T[$_]:$A[$_]))%1000000007for 1..$#T-1;\nprint$x*($f&&$T[$#T-1]==$A[1]),$/", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 731, "memory_kb": 39944}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s199805372", "group_id": "codeNet:p03962", "input_text": "say +get.words.Bag", "language": "Perl", "metadata": {"date": 1520347072, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03962.html", "problem_id": "p03962", "resource_group": "low_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/Perl/s199805372.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s199805372", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "say +get.words.Bag", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 18, "cpu_time_ms": 128, "memory_kb": 48624}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s821861765", "group_id": "codeNet:p03962", "input_text": "#!/usr/bin/perl\n\nwhile (<>) {\n @c = split /\\s/, $_;\n}\n\nforeach (@c) {\n $c{$_}++;\n}\n\n$n = 0;\nforeach (keys %c) {\n $n++;\n}\n\nprint \"$n\\n\";\n", "language": "Perl", "metadata": {"date": 1476580031, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03962.html", "problem_id": "p03962", "resource_group": "low_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/Perl/s821861765.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s821861765", "user_id": "u669573977"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "#!/usr/bin/perl\n\nwhile (<>) {\n @c = split /\\s/, $_;\n}\n\nforeach (@c) {\n $c{$_}++;\n}\n\n$n = 0;\nforeach (keys %c) {\n $n++;\n}\n\nprint \"$n\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s148502665", "group_id": "codeNet:p03963", "input_text": "#!/usr/bin/perl\n\nwhile (<>) {\n ($n, $k) = split /\\s/, $_;\n}\n\n$total = 1;\nforeach (1 .. $n) {\n if ($_ == 1) {\n $total *= $k;\n } else {\n $total *= ($k - 1);\n }\n}\n\nprint \"$total\\n\";\n", "language": "Perl", "metadata": {"date": 1476580564, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03963.html", "problem_id": "p03963", "resource_group": "low_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/Perl/s148502665.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s148502665", "user_id": "u669573977"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl\n\nwhile (<>) {\n ($n, $k) = split /\\s/, $_;\n}\n\n$total = 1;\nforeach (1 .. $n) {\n if ($_ == 1) {\n $total *= $k;\n } else {\n $total *= ($k - 1);\n }\n}\n\nprint \"$total\\n\";\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s926295156", "group_id": "codeNet:p03966", "input_text": ".++;($_=@(@($/=+<2)+>1", "language": "Perl", "metadata": {"date": 1592647116, "filename_ext": "pl", "original_language": "Raku (Rakudo 2020.02.1)", "problem_description_relpath": "problem_descriptions/p03967.html", "problem_id": "p03967", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03967/input.txt", "sample_output_relpath": "derived/input_output/data/p03967/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03967/Perl/s498588336.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s498588336", "user_id": "u657913472"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "say sum((108 X-get.ords)X+>2)+>1", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer and his friend TopCoDeer is playing a game.\nThe game consists of N turns.\nIn each turn, each player plays one of the two gestures, Rock and Paper, as in Rock-paper-scissors, under the following condition:\n\n(※) After each turn, (the number of times the player has played Paper)≦(the number of times the player has played Rock).\n\nEach player's score is calculated by (the number of turns where the player wins) - (the number of turns where the player loses), where the outcome of each turn is determined by the rules of Rock-paper-scissors.\n\n(For those who are not familiar with Rock-paper-scissors: If one player plays Rock and the other plays Paper, the latter player will win and the former player will lose. If both players play the same gesture, the round is a tie and neither player will win nor lose.)\n\nWith his supernatural power, AtCoDeer was able to foresee the gesture that TopCoDeer will play in each of the N turns, before the game starts.\nPlan AtCoDeer's gesture in each turn to maximize AtCoDeer's score.\n\nThe gesture that TopCoDeer will play in each turn is given by a string s. If the i-th (1≦i≦N) character in s is g, TopCoDeer will play Rock in the i-th turn. Similarly, if the i-th (1≦i≦N) character of s in p, TopCoDeer will play Paper in the i-th turn.\n\nConstraints\n\n1≦N≦10^5\n\nN=|s|\n\nEach character in s is g or p.\n\nThe gestures represented by s satisfy the condition (※).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the AtCoDeer's maximum possible score.\n\nSample Input 1\n\ngpg\n\nSample Output 1\n\n0\n\nPlaying the same gesture as the opponent in each turn results in the score of 0, which is the maximum possible score.\n\nSample Input 2\n\nggppgggpgg\n\nSample Output 2\n\n2\n\nFor example, consider playing gestures in the following order: Rock, Paper, Rock, Paper, Rock, Rock, Paper, Paper, Rock, Paper. This strategy earns three victories and suffers one defeat, resulting in the score of 2, which is the maximum possible score.", "sample_input": "gpg\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03967", "source_text": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer and his friend TopCoDeer is playing a game.\nThe game consists of N turns.\nIn each turn, each player plays one of the two gestures, Rock and Paper, as in Rock-paper-scissors, under the following condition:\n\n(※) After each turn, (the number of times the player has played Paper)≦(the number of times the player has played Rock).\n\nEach player's score is calculated by (the number of turns where the player wins) - (the number of turns where the player loses), where the outcome of each turn is determined by the rules of Rock-paper-scissors.\n\n(For those who are not familiar with Rock-paper-scissors: If one player plays Rock and the other plays Paper, the latter player will win and the former player will lose. If both players play the same gesture, the round is a tie and neither player will win nor lose.)\n\nWith his supernatural power, AtCoDeer was able to foresee the gesture that TopCoDeer will play in each of the N turns, before the game starts.\nPlan AtCoDeer's gesture in each turn to maximize AtCoDeer's score.\n\nThe gesture that TopCoDeer will play in each turn is given by a string s. If the i-th (1≦i≦N) character in s is g, TopCoDeer will play Rock in the i-th turn. Similarly, if the i-th (1≦i≦N) character of s in p, TopCoDeer will play Paper in the i-th turn.\n\nConstraints\n\n1≦N≦10^5\n\nN=|s|\n\nEach character in s is g or p.\n\nThe gestures represented by s satisfy the condition (※).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the AtCoDeer's maximum possible score.\n\nSample Input 1\n\ngpg\n\nSample Output 1\n\n0\n\nPlaying the same gesture as the opponent in each turn results in the score of 0, which is the maximum possible score.\n\nSample Input 2\n\nggppgggpgg\n\nSample Output 2\n\n2\n\nFor example, consider playing gestures in the following order: Rock, Paper, Rock, Paper, Rock, Rock, Paper, Paper, Rock, Paper. This strategy earns three victories and suffers one defeat, resulting in the score of 2, which is the maximum possible score.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32, "cpu_time_ms": 447, "memory_kb": 100504}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s915623147", "group_id": "codeNet:p03967", "input_text": "use v6;\n\nmy Str $s = get;\nsay ($s.chars div 2) - $s.comb.grep(* eq 'p')\n", "language": "Perl", "metadata": {"date": 1476584102, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03967.html", "problem_id": "p03967", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03967/input.txt", "sample_output_relpath": "derived/input_output/data/p03967/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03967/Perl/s915623147.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s915623147", "user_id": "u390181802"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "use v6;\n\nmy Str $s = get;\nsay ($s.chars div 2) - $s.comb.grep(* eq 'p')\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer and his friend TopCoDeer is playing a game.\nThe game consists of N turns.\nIn each turn, each player plays one of the two gestures, Rock and Paper, as in Rock-paper-scissors, under the following condition:\n\n(※) After each turn, (the number of times the player has played Paper)≦(the number of times the player has played Rock).\n\nEach player's score is calculated by (the number of turns where the player wins) - (the number of turns where the player loses), where the outcome of each turn is determined by the rules of Rock-paper-scissors.\n\n(For those who are not familiar with Rock-paper-scissors: If one player plays Rock and the other plays Paper, the latter player will win and the former player will lose. If both players play the same gesture, the round is a tie and neither player will win nor lose.)\n\nWith his supernatural power, AtCoDeer was able to foresee the gesture that TopCoDeer will play in each of the N turns, before the game starts.\nPlan AtCoDeer's gesture in each turn to maximize AtCoDeer's score.\n\nThe gesture that TopCoDeer will play in each turn is given by a string s. If the i-th (1≦i≦N) character in s is g, TopCoDeer will play Rock in the i-th turn. Similarly, if the i-th (1≦i≦N) character of s in p, TopCoDeer will play Paper in the i-th turn.\n\nConstraints\n\n1≦N≦10^5\n\nN=|s|\n\nEach character in s is g or p.\n\nThe gestures represented by s satisfy the condition (※).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the AtCoDeer's maximum possible score.\n\nSample Input 1\n\ngpg\n\nSample Output 1\n\n0\n\nPlaying the same gesture as the opponent in each turn results in the score of 0, which is the maximum possible score.\n\nSample Input 2\n\nggppgggpgg\n\nSample Output 2\n\n2\n\nFor example, consider playing gestures in the following order: Rock, Paper, Rock, Paper, Rock, Rock, Paper, Paper, Rock, Paper. This strategy earns three victories and suffers one defeat, resulting in the score of 2, which is the maximum possible score.", "sample_input": "gpg\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03967", "source_text": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer and his friend TopCoDeer is playing a game.\nThe game consists of N turns.\nIn each turn, each player plays one of the two gestures, Rock and Paper, as in Rock-paper-scissors, under the following condition:\n\n(※) After each turn, (the number of times the player has played Paper)≦(the number of times the player has played Rock).\n\nEach player's score is calculated by (the number of turns where the player wins) - (the number of turns where the player loses), where the outcome of each turn is determined by the rules of Rock-paper-scissors.\n\n(For those who are not familiar with Rock-paper-scissors: If one player plays Rock and the other plays Paper, the latter player will win and the former player will lose. If both players play the same gesture, the round is a tie and neither player will win nor lose.)\n\nWith his supernatural power, AtCoDeer was able to foresee the gesture that TopCoDeer will play in each of the N turns, before the game starts.\nPlan AtCoDeer's gesture in each turn to maximize AtCoDeer's score.\n\nThe gesture that TopCoDeer will play in each turn is given by a string s. If the i-th (1≦i≦N) character in s is g, TopCoDeer will play Rock in the i-th turn. Similarly, if the i-th (1≦i≦N) character of s in p, TopCoDeer will play Paper in the i-th turn.\n\nConstraints\n\n1≦N≦10^5\n\nN=|s|\n\nEach character in s is g or p.\n\nThe gestures represented by s satisfy the condition (※).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the AtCoDeer's maximum possible score.\n\nSample Input 1\n\ngpg\n\nSample Output 1\n\n0\n\nPlaying the same gesture as the opponent in each turn results in the score of 0, which is the maximum possible score.\n\nSample Input 2\n\nggppgggpgg\n\nSample Output 2\n\n2\n\nFor example, consider playing gestures in the following order: Rock, Paper, Rock, Paper, Rock, Rock, Paper, Paper, Rock, Paper. This strategy earns three victories and suffers one defeat, resulting in the score of 2, which is the maximum possible score.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 72, "cpu_time_ms": 869, "memory_kb": 66412}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s894179822", "group_id": "codeNet:p03967", "input_text": "print y/g//-y/p//>>1for<>", "language": "Perl", "metadata": {"date": 1476582459, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03967.html", "problem_id": "p03967", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03967/input.txt", "sample_output_relpath": "derived/input_output/data/p03967/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03967/Perl/s894179822.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s894179822", "user_id": "u283869437"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "print y/g//-y/p//>>1for<>", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer and his friend TopCoDeer is playing a game.\nThe game consists of N turns.\nIn each turn, each player plays one of the two gestures, Rock and Paper, as in Rock-paper-scissors, under the following condition:\n\n(※) After each turn, (the number of times the player has played Paper)≦(the number of times the player has played Rock).\n\nEach player's score is calculated by (the number of turns where the player wins) - (the number of turns where the player loses), where the outcome of each turn is determined by the rules of Rock-paper-scissors.\n\n(For those who are not familiar with Rock-paper-scissors: If one player plays Rock and the other plays Paper, the latter player will win and the former player will lose. If both players play the same gesture, the round is a tie and neither player will win nor lose.)\n\nWith his supernatural power, AtCoDeer was able to foresee the gesture that TopCoDeer will play in each of the N turns, before the game starts.\nPlan AtCoDeer's gesture in each turn to maximize AtCoDeer's score.\n\nThe gesture that TopCoDeer will play in each turn is given by a string s. If the i-th (1≦i≦N) character in s is g, TopCoDeer will play Rock in the i-th turn. Similarly, if the i-th (1≦i≦N) character of s in p, TopCoDeer will play Paper in the i-th turn.\n\nConstraints\n\n1≦N≦10^5\n\nN=|s|\n\nEach character in s is g or p.\n\nThe gestures represented by s satisfy the condition (※).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the AtCoDeer's maximum possible score.\n\nSample Input 1\n\ngpg\n\nSample Output 1\n\n0\n\nPlaying the same gesture as the opponent in each turn results in the score of 0, which is the maximum possible score.\n\nSample Input 2\n\nggppgggpgg\n\nSample Output 2\n\n2\n\nFor example, consider playing gestures in the following order: Rock, Paper, Rock, Paper, Rock, Rock, Paper, Paper, Rock, Paper. This strategy earns three victories and suffers one defeat, resulting in the score of 2, which is the maximum possible score.", "sample_input": "gpg\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03967", "source_text": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer and his friend TopCoDeer is playing a game.\nThe game consists of N turns.\nIn each turn, each player plays one of the two gestures, Rock and Paper, as in Rock-paper-scissors, under the following condition:\n\n(※) After each turn, (the number of times the player has played Paper)≦(the number of times the player has played Rock).\n\nEach player's score is calculated by (the number of turns where the player wins) - (the number of turns where the player loses), where the outcome of each turn is determined by the rules of Rock-paper-scissors.\n\n(For those who are not familiar with Rock-paper-scissors: If one player plays Rock and the other plays Paper, the latter player will win and the former player will lose. If both players play the same gesture, the round is a tie and neither player will win nor lose.)\n\nWith his supernatural power, AtCoDeer was able to foresee the gesture that TopCoDeer will play in each of the N turns, before the game starts.\nPlan AtCoDeer's gesture in each turn to maximize AtCoDeer's score.\n\nThe gesture that TopCoDeer will play in each turn is given by a string s. If the i-th (1≦i≦N) character in s is g, TopCoDeer will play Rock in the i-th turn. Similarly, if the i-th (1≦i≦N) character of s in p, TopCoDeer will play Paper in the i-th turn.\n\nConstraints\n\n1≦N≦10^5\n\nN=|s|\n\nEach character in s is g or p.\n\nThe gestures represented by s satisfy the condition (※).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the AtCoDeer's maximum possible score.\n\nSample Input 1\n\ngpg\n\nSample Output 1\n\n0\n\nPlaying the same gesture as the opponent in each turn results in the score of 0, which is the maximum possible score.\n\nSample Input 2\n\nggppgggpgg\n\nSample Output 2\n\n2\n\nFor example, consider playing gestures in the following order: Rock, Paper, Rock, Paper, Rock, Rock, Paper, Paper, Rock, Paper. This strategy earns three victories and suffers one defeat, resulting in the score of 2, which is the maximum possible score.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 25, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s627368061", "group_id": "codeNet:p03970", "input_text": "#!/usr/bin/perl -w\nuse strict;\n\nmy $str = 'CODEFESTIVAL2016';\n\nmy $S = ;\nmy $ite =0;\nmy $i=0;\nfor (0..length($str)-1){\n $i++;\n print \"$i \\n\";\n if (substr($S, $_, 1) ne substr($str, $_, 1)) {\n $ite++;\n }\n}\n\nprint \"$ite \\n\";", "language": "Perl", "metadata": {"date": 1476120935, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03970.html", "problem_id": "p03970", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03970/input.txt", "sample_output_relpath": "derived/input_output/data/p03970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03970/Perl/s627368061.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s627368061", "user_id": "u976403654"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "#!/usr/bin/perl -w\nuse strict;\n\nmy $str = 'CODEFESTIVAL2016';\n\nmy $S = ;\nmy $ite =0;\nmy $i=0;\nfor (0..length($str)-1){\n $i++;\n print \"$i \\n\";\n if (substr($S, $_, 1) ne substr($str, $_, 1)) {\n $ite++;\n }\n}\n\nprint \"$ite \\n\";", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.\n\nHe intended to write CODEFESTIVAL2016 on it, but he mistakenly wrote a different string S. Fortunately, the string he wrote was the correct length.\n\nSo Mr. Takahashi decided to perform an operation that replaces a certain character with another in the minimum number of iterations, changing the string to CODEFESTIVAL2016.\n\nFind the minimum number of iterations for the rewrite operation.\n\nConstraints\n\nS is 16 characters long.\n\nS consists of uppercase and lowercase alphabet letters and numerals.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nS\n\nOutput\n\nOutput an integer representing the minimum number of iterations needed for the rewrite operation.\n\nSample Input 1\n\nC0DEFESTIVAL2O16\n\nSample Output 1\n\n2\n\nThe second character 0 must be changed to O and the 14th character O changed to 0.\n\nSample Input 2\n\nFESTIVAL2016CODE\n\nSample Output 2\n\n16", "sample_input": "C0DEFESTIVAL2O16\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03970", "source_text": "Score : 100 points\n\nProblem Statement\n\nCODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.\n\nHe intended to write CODEFESTIVAL2016 on it, but he mistakenly wrote a different string S. Fortunately, the string he wrote was the correct length.\n\nSo Mr. Takahashi decided to perform an operation that replaces a certain character with another in the minimum number of iterations, changing the string to CODEFESTIVAL2016.\n\nFind the minimum number of iterations for the rewrite operation.\n\nConstraints\n\nS is 16 characters long.\n\nS consists of uppercase and lowercase alphabet letters and numerals.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nS\n\nOutput\n\nOutput an integer representing the minimum number of iterations needed for the rewrite operation.\n\nSample Input 1\n\nC0DEFESTIVAL2O16\n\nSample Output 1\n\n2\n\nThe second character 0 must be changed to O and the 14th character O changed to 0.\n\nSample Input 2\n\nFESTIVAL2016CODE\n\nSample Output 2\n\n16", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s630584160", "group_id": "codeNet:p03970", "input_text": "# Here your code !\nmy $txt = ;\nchomp $txt;\nmy @txts = split(//,$txt);\n\nmy $ans = 'CODEFESTIVAL2016';\nmy @anss = split(//,$ans);\n\nmy $i = 0;\nmy $count = 0;\nforeach my $c (@txts) {\n if ($c ne $anss[$i]) {\n $count++;\n }\n $i++;\n}\n\nprint $count, \"\\n\";", "language": "Perl", "metadata": {"date": 1476119376, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03970.html", "problem_id": "p03970", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03970/input.txt", "sample_output_relpath": "derived/input_output/data/p03970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03970/Perl/s630584160.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s630584160", "user_id": "u732963817"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "# Here your code !\nmy $txt = ;\nchomp $txt;\nmy @txts = split(//,$txt);\n\nmy $ans = 'CODEFESTIVAL2016';\nmy @anss = split(//,$ans);\n\nmy $i = 0;\nmy $count = 0;\nforeach my $c (@txts) {\n if ($c ne $anss[$i]) {\n $count++;\n }\n $i++;\n}\n\nprint $count, \"\\n\";", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.\n\nHe intended to write CODEFESTIVAL2016 on it, but he mistakenly wrote a different string S. Fortunately, the string he wrote was the correct length.\n\nSo Mr. Takahashi decided to perform an operation that replaces a certain character with another in the minimum number of iterations, changing the string to CODEFESTIVAL2016.\n\nFind the minimum number of iterations for the rewrite operation.\n\nConstraints\n\nS is 16 characters long.\n\nS consists of uppercase and lowercase alphabet letters and numerals.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nS\n\nOutput\n\nOutput an integer representing the minimum number of iterations needed for the rewrite operation.\n\nSample Input 1\n\nC0DEFESTIVAL2O16\n\nSample Output 1\n\n2\n\nThe second character 0 must be changed to O and the 14th character O changed to 0.\n\nSample Input 2\n\nFESTIVAL2016CODE\n\nSample Output 2\n\n16", "sample_input": "C0DEFESTIVAL2O16\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03970", "source_text": "Score : 100 points\n\nProblem Statement\n\nCODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.\n\nHe intended to write CODEFESTIVAL2016 on it, but he mistakenly wrote a different string S. Fortunately, the string he wrote was the correct length.\n\nSo Mr. Takahashi decided to perform an operation that replaces a certain character with another in the minimum number of iterations, changing the string to CODEFESTIVAL2016.\n\nFind the minimum number of iterations for the rewrite operation.\n\nConstraints\n\nS is 16 characters long.\n\nS consists of uppercase and lowercase alphabet letters and numerals.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nS\n\nOutput\n\nOutput an integer representing the minimum number of iterations needed for the rewrite operation.\n\nSample Input 1\n\nC0DEFESTIVAL2O16\n\nSample Output 1\n\n2\n\nThe second character 0 must be changed to O and the 14th character O changed to 0.\n\nSample Input 2\n\nFESTIVAL2016CODE\n\nSample Output 2\n\n16", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 269, "cpu_time_ms": 5, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s647869060", "group_id": "codeNet:p03971", "input_text": "($N,$A,$B)=glob<>;print+(/a/?$a+$b<$A+$B&&++$a:/b/&$a+$b<$A+$B&$b<$B&&++$b)?Yes:No,$/for<>=~/./g", "language": "Perl", "metadata": {"date": 1476124575, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03971.html", "problem_id": "p03971", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03971/input.txt", "sample_output_relpath": "derived/input_output/data/p03971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03971/Perl/s647869060.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s647869060", "user_id": "u283869437"}, "prompt_components": {"gold_output": "Yes\nYes\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "($N,$A,$B)=glob<>;print+(/a/?$a+$b<$A+$B&&++$a:/b/&$a+$b<$A+$B&$b<$B&&++$b)?Yes:No,$/for<>=~/./g", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.\n\nOnly Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.\n\nA Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B.\n\nAn overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B-th or above among all overseas students.\n\nA string S is assigned indicating attributes of all participants. If the i-th character of string S is a, this means the participant ranked i-th in the Qualification contests is a Japanese student; b means the participant ranked i-th is an overseas student; and c means the participant ranked i-th is neither of these.\n\nWrite a program that outputs for all the participants in descending rank either Yes if they passed the Qualification contests or No if they did not pass.\n\nConstraints\n\n1≦N,A,B≦100000\n\nA+B≦N\n\nS is N characters long.\n\nS consists only of the letters a, b and c.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nN A B\nS\n\nOutput\n\nOutput N lines. On the i-th line, output Yes if the i-th participant passed the Qualification contests or No if that participant did not pass.\n\nSample Input 1\n\n10 2 3\nabccabaabb\n\nSample Output 1\n\nYes\nYes\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\n\nThe first, second, fifth, sixth, and seventh participants pass the Qualification contests.\n\nSample Input 2\n\n12 5 2\ncabbabaacaba\n\nSample Output 2\n\nNo\nYes\nYes\nYes\nYes\nNo\nYes\nYes\nNo\nYes\nNo\nNo\n\nThe sixth participant is third among overseas students and thus does not pass the Qualification contests.\n\nSample Input 3\n\n5 2 2\nccccc\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nNo", "sample_input": "10 2 3\nabccabaabb\n"}, "reference_outputs": ["Yes\nYes\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\n"], "source_document_id": "p03971", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.\n\nOnly Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.\n\nA Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B.\n\nAn overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B-th or above among all overseas students.\n\nA string S is assigned indicating attributes of all participants. If the i-th character of string S is a, this means the participant ranked i-th in the Qualification contests is a Japanese student; b means the participant ranked i-th is an overseas student; and c means the participant ranked i-th is neither of these.\n\nWrite a program that outputs for all the participants in descending rank either Yes if they passed the Qualification contests or No if they did not pass.\n\nConstraints\n\n1≦N,A,B≦100000\n\nA+B≦N\n\nS is N characters long.\n\nS consists only of the letters a, b and c.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nN A B\nS\n\nOutput\n\nOutput N lines. On the i-th line, output Yes if the i-th participant passed the Qualification contests or No if that participant did not pass.\n\nSample Input 1\n\n10 2 3\nabccabaabb\n\nSample Output 1\n\nYes\nYes\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\n\nThe first, second, fifth, sixth, and seventh participants pass the Qualification contests.\n\nSample Input 2\n\n12 5 2\ncabbabaacaba\n\nSample Output 2\n\nNo\nYes\nYes\nYes\nYes\nNo\nYes\nYes\nNo\nYes\nNo\nNo\n\nThe sixth participant is third among overseas students and thus does not pass the Qualification contests.\n\nSample Input 3\n\n5 2 2\nccccc\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nNo", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 89, "memory_kb": 9856}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s832241447", "group_id": "codeNet:p03972", "input_text": "@_=(<>=~$\"+$`,$'+1);\nfor(sort{@$a[0]-@$b[0]}(map[<>+0],1..$`),map[$_,1],<>){\n\t$\\+=@$_[0]*$_[!@$_[1]];\n\t--$_[@$_[1]]\n}\nprint\n", "language": "Perl", "metadata": {"date": 1520939298, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03972.html", "problem_id": "p03972", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03972/input.txt", "sample_output_relpath": "derived/input_output/data/p03972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03972/Perl/s832241447.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s832241447", "user_id": "u283869437"}, "prompt_components": {"gold_output": "29\n", "input_to_evaluate": "@_=(<>=~$\"+$`,$'+1);\nfor(sort{@$a[0]-@$b[0]}(map[<>+0],1..$`),map[$_,1],<>){\n\t$\\+=@$_[0]*$_[!@$_[1]];\n\t--$_[@$_[1]]\n}\nprint\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nOn an xy plane, in an area satisfying 0 ≤ x ≤ W, 0 ≤ y ≤ H, there is one house at each and every point where both x and y are integers.\n\nThere are unpaved roads between every pair of points for which either the x coordinates are equal and the difference between the y coordinates is 1, or the y coordinates are equal and the difference between the x coordinates is 1.\n\nThe cost of paving a road between houses on coordinates (i,j) and (i+1,j) is p_i for any value of j, while the cost of paving a road between houses on coordinates (i,j) and (i,j+1) is q_j for any value of i.\n\nMr. Takahashi wants to pave some of these roads and be able to travel between any two houses on paved roads only. Find the solution with the minimum total cost.\n\nConstraints\n\n1 ≦ W,H ≦ 10^5\n\n1 ≦ p_i ≦ 10^8(0 ≦ i ≦ W-1)\n\n1 ≦ q_j ≦ 10^8(0 ≦ j ≦ H-1)\n\np_i (0 ≦ i ≦ W−1) is an integer.\n\nq_j (0 ≦ j ≦ H−1) is an integer.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nW H\np_0\n:\np_{W-1}\nq_0\n:\nq_{H-1}\n\nOutput\n\nOutput an integer representing the minimum total cost.\n\nSample Input 1\n\n2 2\n3\n5\n2\n7\n\nSample Output 1\n\n29\n\nIt is enough to pave the following eight roads.\n\nRoad connecting houses at (0,0) and (0,1)\n\nRoad connecting houses at (0,1) and (1,1)\n\nRoad connecting houses at (0,2) and (1,2)\n\nRoad connecting houses at (1,0) and (1,1)\n\nRoad connecting houses at (1,0) and (2,0)\n\nRoad connecting houses at (1,1) and (1,2)\n\nRoad connecting houses at (1,2) and (2,2)\n\nRoad connecting houses at (2,0) and (2,1)\n\nSample Input 2\n\n4 3\n2\n4\n8\n1\n2\n9\n3\n\nSample Output 2\n\n60", "sample_input": "2 2\n3\n5\n2\n7\n"}, "reference_outputs": ["29\n"], "source_document_id": "p03972", "source_text": "Score : 500 points\n\nProblem Statement\n\nOn an xy plane, in an area satisfying 0 ≤ x ≤ W, 0 ≤ y ≤ H, there is one house at each and every point where both x and y are integers.\n\nThere are unpaved roads between every pair of points for which either the x coordinates are equal and the difference between the y coordinates is 1, or the y coordinates are equal and the difference between the x coordinates is 1.\n\nThe cost of paving a road between houses on coordinates (i,j) and (i+1,j) is p_i for any value of j, while the cost of paving a road between houses on coordinates (i,j) and (i,j+1) is q_j for any value of i.\n\nMr. Takahashi wants to pave some of these roads and be able to travel between any two houses on paved roads only. Find the solution with the minimum total cost.\n\nConstraints\n\n1 ≦ W,H ≦ 10^5\n\n1 ≦ p_i ≦ 10^8(0 ≦ i ≦ W-1)\n\n1 ≦ q_j ≦ 10^8(0 ≦ j ≦ H-1)\n\np_i (0 ≦ i ≦ W−1) is an integer.\n\nq_j (0 ≦ j ≦ H−1) is an integer.\n\nInput\n\nInputs are provided from Standard Input in the following form.\n\nW H\np_0\n:\np_{W-1}\nq_0\n:\nq_{H-1}\n\nOutput\n\nOutput an integer representing the minimum total cost.\n\nSample Input 1\n\n2 2\n3\n5\n2\n7\n\nSample Output 1\n\n29\n\nIt is enough to pave the following eight roads.\n\nRoad connecting houses at (0,0) and (0,1)\n\nRoad connecting houses at (0,1) and (1,1)\n\nRoad connecting houses at (0,2) and (1,2)\n\nRoad connecting houses at (1,0) and (1,1)\n\nRoad connecting houses at (1,0) and (2,0)\n\nRoad connecting houses at (1,1) and (1,2)\n\nRoad connecting houses at (1,2) and (2,2)\n\nRoad connecting houses at (2,0) and (2,1)\n\nSample Input 2\n\n4 3\n2\n4\n8\n1\n2\n9\n3\n\nSample Output 2\n\n60", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 890, "memory_kb": 55936}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s176533361", "group_id": "codeNet:p03973", "input_text": "<>;$\u0006+=$_--==$\u0006-??,$%+=$_/=??||$\u0006for<>;print$%", "language": "Perl", "metadata": {"date": 1555026103, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03973.html", "problem_id": "p03973", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03973/input.txt", "sample_output_relpath": "derived/input_output/data/p03973/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03973/Perl/s176533361.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s176533361", "user_id": "u657913472"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;$\u0006+=$_--==$\u0006-??,$%+=$_/=??||$\u0006for<>;print$%", "problem_context": "Score : 700 points\n\nProblem Statement\n\nN people are waiting in a single line in front of the Takahashi Store. The cash on hand of the i-th person from the front of the line is a positive integer A_i.\n\nMr. Takahashi, the shop owner, has decided on the following scheme: He picks a product, sets a positive integer P indicating its price, and shows this product to customers in order, starting from the front of the line. This step is repeated as described below.\n\nAt each step, when a product is shown to a customer, if price P is equal to or less than the cash held by that customer at the time, the customer buys the product and Mr. Takahashi ends the current step. That is, the cash held by the first customer in line with cash equal to or greater than P decreases by P, and the next step begins.\n\nMr. Takahashi can set the value of positive integer P independently at each step.\n\nHe would like to sell as many products as possible. However, if a customer were to end up with 0 cash on hand after a purchase, that person would not have the fare to go home. Customers not being able to go home would be a problem for Mr. Takahashi, so he does not want anyone to end up with 0 cash.\n\nHelp out Mr. Takahashi by writing a program that determines the maximum number of products he can sell, when the initial cash in possession of each customer is given.\n\nConstraints\n\n1 ≦ | N | ≦ 100000\n\n1 ≦ A_i ≦ 10^9(1 ≦ i ≦ N)\n\nAll inputs are integers.\n\nInput\n\nInputs are provided from Standard Inputs in the following form.\n\nN\nA_1\n:\nA_N\n\nOutput\n\nOutput an integer representing the maximum number of products Mr. Takahashi can sell.\n\nSample Input 1\n\n3\n3\n2\n5\n\nSample Output 1\n\n3\n\nAs values of P, select in order 1, 4, 1.\n\nSample Input 2\n\n15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 2\n\n18", "sample_input": "3\n3\n2\n5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03973", "source_text": "Score : 700 points\n\nProblem Statement\n\nN people are waiting in a single line in front of the Takahashi Store. The cash on hand of the i-th person from the front of the line is a positive integer A_i.\n\nMr. Takahashi, the shop owner, has decided on the following scheme: He picks a product, sets a positive integer P indicating its price, and shows this product to customers in order, starting from the front of the line. This step is repeated as described below.\n\nAt each step, when a product is shown to a customer, if price P is equal to or less than the cash held by that customer at the time, the customer buys the product and Mr. Takahashi ends the current step. That is, the cash held by the first customer in line with cash equal to or greater than P decreases by P, and the next step begins.\n\nMr. Takahashi can set the value of positive integer P independently at each step.\n\nHe would like to sell as many products as possible. However, if a customer were to end up with 0 cash on hand after a purchase, that person would not have the fare to go home. Customers not being able to go home would be a problem for Mr. Takahashi, so he does not want anyone to end up with 0 cash.\n\nHelp out Mr. Takahashi by writing a program that determines the maximum number of products he can sell, when the initial cash in possession of each customer is given.\n\nConstraints\n\n1 ≦ | N | ≦ 100000\n\n1 ≦ A_i ≦ 10^9(1 ≦ i ≦ N)\n\nAll inputs are integers.\n\nInput\n\nInputs are provided from Standard Inputs in the following form.\n\nN\nA_1\n:\nA_N\n\nOutput\n\nOutput an integer representing the maximum number of products Mr. Takahashi can sell.\n\nSample Input 1\n\n3\n3\n2\n5\n\nSample Output 1\n\n3\n\nAs values of P, select in order 1, 4, 1.\n\nSample Input 2\n\n15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 2\n\n18", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 109, "memory_kb": 18432}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s715755681", "group_id": "codeNet:p03975", "input_text": "<>=~/ .* /;$a+=$_>=$'||$_<$& for<>;print$a", "language": "Perl", "metadata": {"date": 1506832512, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03975.html", "problem_id": "p03975", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03975/input.txt", "sample_output_relpath": "derived/input_output/data/p03975/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03975/Perl/s715755681.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s715755681", "user_id": "u657913472"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "<>=~/ .* /;$a+=$_>=$'||$_<$& for<>;print$a", "problem_context": "Score : 66 points\n\nProblem Statement\n\nSummer vacation ended at last and the second semester has begun.\nYou, a Kyoto University student, came to university and heard a rumor that somebody will barricade the entrance of your classroom.\nThe barricade will be built just before the start of the A-th class and removed by Kyoto University students just before the start of the B-th class.\nAll the classes conducted when the barricade is blocking the entrance will be cancelled and you will not be able to attend them.\nToday you take N classes and class i is conducted in the t_i-th period.\nYou take at most one class in each period.\nFind the number of classes you can attend.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n1 \\leq A < B \\leq 10^9\n\n1 \\leq t_i \\leq 10^9\n\nAll t_i values are distinct.\n\nInput\n\nN, A and B are given on the first line and t_i is given on the (i+1)-th line.\n\nN A B\nt1\n:\ntN\n\nOutput\n\nPrint the number of classes you can attend.\n\nSample Input 1\n\n5 5 9\n4\n3\n6\n9\n1\n\nSample Output 1\n\n4\n\nYou can not only attend the third class.\n\nSample Input 2\n\n5 4 9\n5\n6\n7\n8\n9\n\nSample Output 2\n\n1\n\nYou can only attend the fifth class.\n\nSample Input 3\n\n4 3 6\n9\n6\n8\n1\n\nSample Output 3\n\n4\n\nYou can attend all the classes.\n\nSample Input 4\n\n2 1 2\n1\n2\n\nSample Output 4\n\n1\n\nYou can not attend the first class, but can attend the second.", "sample_input": "5 5 9\n4\n3\n6\n9\n1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03975", "source_text": "Score : 66 points\n\nProblem Statement\n\nSummer vacation ended at last and the second semester has begun.\nYou, a Kyoto University student, came to university and heard a rumor that somebody will barricade the entrance of your classroom.\nThe barricade will be built just before the start of the A-th class and removed by Kyoto University students just before the start of the B-th class.\nAll the classes conducted when the barricade is blocking the entrance will be cancelled and you will not be able to attend them.\nToday you take N classes and class i is conducted in the t_i-th period.\nYou take at most one class in each period.\nFind the number of classes you can attend.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n1 \\leq A < B \\leq 10^9\n\n1 \\leq t_i \\leq 10^9\n\nAll t_i values are distinct.\n\nInput\n\nN, A and B are given on the first line and t_i is given on the (i+1)-th line.\n\nN A B\nt1\n:\ntN\n\nOutput\n\nPrint the number of classes you can attend.\n\nSample Input 1\n\n5 5 9\n4\n3\n6\n9\n1\n\nSample Output 1\n\n4\n\nYou can not only attend the third class.\n\nSample Input 2\n\n5 4 9\n5\n6\n7\n8\n9\n\nSample Output 2\n\n1\n\nYou can only attend the fifth class.\n\nSample Input 3\n\n4 3 6\n9\n6\n8\n1\n\nSample Output 3\n\n4\n\nYou can attend all the classes.\n\nSample Input 4\n\n2 1 2\n1\n2\n\nSample Output 4\n\n1\n\nYou can not attend the first class, but can attend the second.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s858650637", "group_id": "codeNet:p03986", "input_text": "$_=<>;chop;\nfor$i(1..4){s/ST//eg};\nwhile(s/SSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTT//eg){}\nwhile(s/SSSSSSSSTTTTTTTT//eg){}\nwhile(s/SSSSTTTT//eg){}\nwhile(s/SSTT//eg){}\nwhile(s/ST//eg){}\nprint length", "language": "Perl", "metadata": {"date": 1566938844, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03986.html", "problem_id": "p03986", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03986/input.txt", "sample_output_relpath": "derived/input_output/data/p03986/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03986/Perl/s858650637.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s858650637", "user_id": "u573154728"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$_=<>;chop;\nfor$i(1..4){s/ST//eg};\nwhile(s/SSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTT//eg){}\nwhile(s/SSSSSSSSTTTTTTTT//eg){}\nwhile(s/SSSSTTTT//eg){}\nwhile(s/SSTT//eg){}\nwhile(s/ST//eg){}\nprint length", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "sample_input": "TSTTSS\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03986", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1055, "memory_kb": 972}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s344821011", "group_id": "codeNet:p03986", "input_text": "$_=<>;chop;while(s/ST//g){}print length", "language": "Perl", "metadata": {"date": 1566938019, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03986.html", "problem_id": "p03986", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03986/input.txt", "sample_output_relpath": "derived/input_output/data/p03986/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03986/Perl/s344821011.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s344821011", "user_id": "u573154728"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "$_=<>;chop;while(s/ST//g){}print length", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "sample_input": "TSTTSS\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03986", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 1055, "memory_kb": 640}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s737338950", "group_id": "codeNet:p03994", "input_text": "use Math::BigInt;\n\nwhile(<>){\n\tchomp;\n\t@s = split(//, $_) if($. == 1);\n\t$n = $_ if($. == 2);\n}\n$n = Math::BigInt->new($n);\n\nfor $i (0 .. $#s) {\n\t$p = ((ord(\"z\") + 1) - ord($s[$i])) % 26;\n\tif($p <= $n){\n\t\t$n -= $p;\n\t\t$s[$i] = 'a';\n\t}\n\tif($i == $#s){\n\t\t$s[$i] = chr(ord($s[$i]) + ($n % 26));\n\t}\n}\n\nprintf join(\"\", @s) . \"\\n\";\n", "language": "Perl", "metadata": {"date": 1570998118, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03994.html", "problem_id": "p03994", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03994/input.txt", "sample_output_relpath": "derived/input_output/data/p03994/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03994/Perl/s737338950.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s737338950", "user_id": "u609426052"}, "prompt_components": {"gold_output": "aya\n", "input_to_evaluate": "use Math::BigInt;\n\nwhile(<>){\n\tchomp;\n\t@s = split(//, $_) if($. == 1);\n\t$n = $_ if($. == 2);\n}\n$n = Math::BigInt->new($n);\n\nfor $i (0 .. $#s) {\n\t$p = ((ord(\"z\") + 1) - ord($s[$i])) % 26;\n\tif($p <= $n){\n\t\t$n -= $p;\n\t\t$s[$i] = 'a';\n\t}\n\tif($i == $#s){\n\t\t$s[$i] = chr(ord($s[$i]) + ($n % 26));\n\t}\n}\n\nprintf join(\"\", @s) . \"\\n\";\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nMr. Takahashi has a string s consisting of lowercase English letters.\nHe repeats the following operation on s exactly K times.\n\nChoose an arbitrary letter on s and change that letter to the next alphabet. Note that the next letter of z is a.\n\nFor example, if you perform an operation for the second letter on aaz, aaz becomes abz.\nIf you then perform an operation for the third letter on abz, abz becomes aba.\n\nMr. Takahashi wants to have the lexicographically smallest string after performing exactly K operations on s.\nFind the such string.\n\nConstraints\n\n1≤|s|≤10^5\n\nAll letters in s are lowercase English letters.\n\n1≤K≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the lexicographically smallest string after performing exactly K operations on s.\n\nSample Input 1\n\nxyz\n4\n\nSample Output 1\n\naya\n\nFor example, you can perform the following operations: xyz, yyz, zyz, ayz, aya.\n\nSample Input 2\n\na\n25\n\nSample Output 2\n\nz\n\nYou have to perform exactly K operations.\n\nSample Input 3\n\ncodefestival\n100\n\nSample Output 3\n\naaaafeaaivap", "sample_input": "xyz\n4\n"}, "reference_outputs": ["aya\n"], "source_document_id": "p03994", "source_text": "Score : 400 points\n\nProblem Statement\n\nMr. Takahashi has a string s consisting of lowercase English letters.\nHe repeats the following operation on s exactly K times.\n\nChoose an arbitrary letter on s and change that letter to the next alphabet. Note that the next letter of z is a.\n\nFor example, if you perform an operation for the second letter on aaz, aaz becomes abz.\nIf you then perform an operation for the third letter on abz, abz becomes aba.\n\nMr. Takahashi wants to have the lexicographically smallest string after performing exactly K operations on s.\nFind the such string.\n\nConstraints\n\n1≤|s|≤10^5\n\nAll letters in s are lowercase English letters.\n\n1≤K≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the lexicographically smallest string after performing exactly K operations on s.\n\nSample Input 1\n\nxyz\n4\n\nSample Output 1\n\naya\n\nFor example, you can perform the following operations: xyz, yyz, zyz, ayz, aya.\n\nSample Input 2\n\na\n25\n\nSample Output 2\n\nz\n\nYou have to perform exactly K operations.\n\nSample Input 3\n\ncodefestival\n100\n\nSample Output 3\n\naaaafeaaivap", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2104, "memory_kb": 19600}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s791888210", "group_id": "codeNet:p03997", "input_text": "say (get+get)*get div 2", "language": "Perl", "metadata": {"date": 1588899660, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p03997.html", "problem_id": "p03997", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03997/input.txt", "sample_output_relpath": "derived/input_output/data/p03997/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03997/Perl/s791888210.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s791888210", "user_id": "u993074316"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "say (get+get)*get div 2", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.\n\nAn example of a trapezoid\n\nFind the area of this trapezoid.\n\nConstraints\n\n1≦a≦100\n\n1≦b≦100\n\n1≦h≦100\n\nAll input values are integers.\n\nh is even.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na\nb\nh\n\nOutput\n\nPrint the area of the given trapezoid. It is guaranteed that the area is an integer.\n\nSample Input 1\n\n3\n4\n2\n\nSample Output 1\n\n7\n\nWhen the lengths of the upper base, lower base, and height are 3, 4, and 2, respectively, the area of the trapezoid is (3+4)×2/2 = 7.\n\nSample Input 2\n\n4\n4\n4\n\nSample Output 2\n\n16\n\nIn this case, a parallelogram is given, which is also a trapezoid.", "sample_input": "3\n4\n2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03997", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.\n\nAn example of a trapezoid\n\nFind the area of this trapezoid.\n\nConstraints\n\n1≦a≦100\n\n1≦b≦100\n\n1≦h≦100\n\nAll input values are integers.\n\nh is even.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na\nb\nh\n\nOutput\n\nPrint the area of the given trapezoid. It is guaranteed that the area is an integer.\n\nSample Input 1\n\n3\n4\n2\n\nSample Output 1\n\n7\n\nWhen the lengths of the upper base, lower base, and height are 3, 4, and 2, respectively, the area of the trapezoid is (3+4)×2/2 = 7.\n\nSample Input 2\n\n4\n4\n4\n\nSample Output 2\n\n16\n\nIn this case, a parallelogram is given, which is also a trapezoid.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 23, "cpu_time_ms": 285, "memory_kb": 71900}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s318799767", "group_id": "codeNet:p03998", "input_text": "my (@sa, @sb, @sc);\n{\n chomp (my $in = );\n @sa = split '', $in;\n}\n{\n chomp (my $in = );\n @sb = split '', $in;\n}\n{\n chomp (my $in = );\n @sc = split '', $in;\n}\nmy $card = shift @sa;\nwhile (1) {\n if ($card eq \"a\") {\n if (@sa == 0) {\n print \"A\\n\";\n exit;\n }\n $card = shift @sa \n } elsif ($card eq \"b\") {\n if (@sb == 0) {\n print \"B\\n\";\n exit;\n }\n $card = shift @sb;\n } else {\n if (@sc == 0) {\n print \"C\\n\";\n exit;\n }\n $card = shift @sc;\n }\n}", "language": "Perl", "metadata": {"date": 1587997894, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03998.html", "problem_id": "p03998", "resource_group": "low_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/Perl/s318799767.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s318799767", "user_id": "u979552932"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "my (@sa, @sb, @sc);\n{\n chomp (my $in = );\n @sa = split '', $in;\n}\n{\n chomp (my $in = );\n @sb = split '', $in;\n}\n{\n chomp (my $in = );\n @sc = split '', $in;\n}\nmy $card = shift @sa;\nwhile (1) {\n if ($card eq \"a\") {\n if (@sa == 0) {\n print \"A\\n\";\n exit;\n }\n $card = shift @sa \n } elsif ($card eq \"b\") {\n if (@sb == 0) {\n print \"B\\n\";\n exit;\n }\n $card = shift @sb;\n } else {\n if (@sc == 0) {\n print \"C\\n\";\n exit;\n }\n $card = shift @sc;\n }\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 524, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s059724052", "group_id": "codeNet:p03998", "input_text": "$_=a;$\n$_++=<>while?.?||$\n$&=~s///;print uc$&", "language": "Perl", "metadata": {"date": 1541917337, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03998.html", "problem_id": "p03998", "resource_group": "low_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/Perl/s059724052.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s059724052", "user_id": "u657913472"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "$_=a;$\n$_++=<>while?.?||$\n$&=~s///;print uc$&", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s151834585", "group_id": "codeNet:p03998", "input_text": "($A,$B,$C)=<>;$_=A;$_=uc$&while$$_=~s/.//;print", "language": "Perl", "metadata": {"date": 1536177415, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03998.html", "problem_id": "p03998", "resource_group": "low_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/Perl/s151834585.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s151834585", "user_id": "u283869437"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "($A,$B,$C)=<>;$_=A;$_=uc$&while$$_=~s/.//;print", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 47, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s658215739", "group_id": "codeNet:p03998", "input_text": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n \nmy $S_a = ;\nmy $S_b = ;\nmy $S_c = ;\n \nchomp $S_a;\nchomp $S_b;\nchomp $S_c;\n \nmy $cards = +{};\n$cards->{a} = [split(//, $S_a)];\n$cards->{b} = [split(//, $S_b)];\n$cards->{c} = [split(//, $S_c)];\n \nmy $current_player = 'a';\nwhile ( scalar @{ $cards->{$current_player} } > 0) {\n $current_player = shift $cards->{$current_player};\n}\n \nsay $current_player;", "language": "Perl", "metadata": {"date": 1477703999, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03998.html", "problem_id": "p03998", "resource_group": "low_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/Perl/s658215739.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s658215739", "user_id": "u392449960"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n \nmy $S_a = ;\nmy $S_b = ;\nmy $S_c = ;\n \nchomp $S_a;\nchomp $S_b;\nchomp $S_c;\n \nmy $cards = +{};\n$cards->{a} = [split(//, $S_a)];\n$cards->{b} = [split(//, $S_b)];\n$cards->{c} = [split(//, $S_c)];\n \nmy $current_player = 'a';\nwhile ( scalar @{ $cards->{$current_player} } > 0) {\n $current_player = shift $cards->{$current_player};\n}\n \nsay $current_player;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 439, "cpu_time_ms": 7, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s902786261", "group_id": "codeNet:p03999", "input_text": "map$\\+=eval,glob<>=~s/\\B/{+,}/gr;print", "language": "Perl", "metadata": {"date": 1537257820, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p03999.html", "problem_id": "p03999", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p03999/input.txt", "sample_output_relpath": "derived/input_output/data/p03999/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03999/Perl/s902786261.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s902786261", "user_id": "u283869437"}, "prompt_components": {"gold_output": "176\n", "input_to_evaluate": "map$\\+=eval,glob<>=~s/\\B/{+,}/gr;print", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\n\nAll strings that can be obtained in this way can be evaluated as formulas.\n\nEvaluate all possible formulas, and print the sum of the results.\n\nConstraints\n\n1 \\leq |S| \\leq 10\n\nAll letters in S are digits between 1 and 9, inclusive.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the evaluated value over all possible formulas.\n\nSample Input 1\n\n125\n\nSample Output 1\n\n176\n\nThere are 4 formulas that can be obtained: 125, 1+25, 12+5 and 1+2+5. When each formula is evaluated,\n\n125\n\n1+25=26\n\n12+5=17\n\n1+2+5=8\n\nThus, the sum is 125+26+17+8=176.\n\nSample Input 2\n\n9999999999\n\nSample Output 2\n\n12656242944", "sample_input": "125\n"}, "reference_outputs": ["176\n"], "source_document_id": "p03999", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\n\nAll strings that can be obtained in this way can be evaluated as formulas.\n\nEvaluate all possible formulas, and print the sum of the results.\n\nConstraints\n\n1 \\leq |S| \\leq 10\n\nAll letters in S are digits between 1 and 9, inclusive.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the evaluated value over all possible formulas.\n\nSample Input 1\n\n125\n\nSample Output 1\n\n176\n\nThere are 4 formulas that can be obtained: 125, 1+25, 12+5 and 1+2+5. When each formula is evaluated,\n\n125\n\n1+25=26\n\n12+5=17\n\n1+2+5=8\n\nThus, the sum is 125+26+17+8=176.\n\nSample Input 2\n\n9999999999\n\nSample Output 2\n\n12656242944", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 10, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s056615384", "group_id": "codeNet:p04002", "input_text": "sub f{\n\tif(1<$_[0]&&$_[0]<$H&&1<$_[1]&&$_[1]<$W){\n\t\t$t=$h{$_[0]*$W+$_[1]}++;\n\t\t--$A[$t];\n\t\t++$A[$t+1];\n\t}\n}\n($H,$W,$N)=glob<>;\n@A=(($W-2)*($H-2),(0)x9);\nfor(<>){\n\t($a,$b)=glob;\n\tf($a-1,$b-1);\n\tf($a ,$b-1);\n\tf($a+1,$b-1);\n\tf($a-1,$b );\n\tf($a ,$b );\n\tf($a+1,$b );\n\tf($a-1,$b+1);\n\tf($a ,$b+1);\n\tf($a+1,$b+1);\n}\nprint$A[$_],$/for 0..9", "language": "Perl", "metadata": {"date": 1473652826, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04002.html", "problem_id": "p04002", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04002/input.txt", "sample_output_relpath": "derived/input_output/data/p04002/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04002/Perl/s056615384.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s056615384", "user_id": "u283869437"}, "prompt_components": {"gold_output": "0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n", "input_to_evaluate": "sub f{\n\tif(1<$_[0]&&$_[0]<$H&&1<$_[1]&&$_[1]<$W){\n\t\t$t=$h{$_[0]*$W+$_[1]}++;\n\t\t--$A[$t];\n\t\t++$A[$t+1];\n\t}\n}\n($H,$W,$N)=glob<>;\n@A=(($W-2)*($H-2),(0)x9);\nfor(<>){\n\t($a,$b)=glob;\n\tf($a-1,$b-1);\n\tf($a ,$b-1);\n\tf($a+1,$b-1);\n\tf($a-1,$b );\n\tf($a ,$b );\n\tf($a+1,$b );\n\tf($a-1,$b+1);\n\tf($a ,$b+1);\n\tf($a+1,$b+1);\n}\nprint$A[$_],$/for 0..9", "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": "p04002", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3174, "memory_kb": 107392}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s257143797", "group_id": "codeNet:p04005", "input_text": "$/=sort +<;print\"@_\"%2*$_[1]*$_[2]", "language": "Perl", "metadata": {"date": 1579294844, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04005.html", "problem_id": "p04005", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04005/input.txt", "sample_output_relpath": "derived/input_output/data/p04005/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04005/Perl/s280907188.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s280907188", "user_id": "u832039789"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "@_=sort{$a-$b}glob<>;print\"@_\"%2*$_[1]*$_[2]", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a rectangular parallelepiped of size A×B×C, built with blocks of size 1×1×1. Snuke will paint each of the A×B×C blocks either red or blue, so that:\n\nThere is at least one red block and at least one blue block.\n\nThe union of all red blocks forms a rectangular parallelepiped.\n\nThe union of all blue blocks forms a rectangular parallelepiped.\n\nSnuke wants to minimize the difference between the number of red blocks and the number of blue blocks. Find the minimum possible difference.\n\nConstraints\n\n2≤A,B,C≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum possible difference between the number of red blocks and the number of blue blocks.\n\nSample Input 1\n\n3 3 3\n\nSample Output 1\n\n9\n\nFor example, Snuke can paint the blocks as shown in the diagram below.\nThere are 9 red blocks and 18 blue blocks, thus the difference is 9.\n\nSample Input 2\n\n2 2 4\n\nSample Output 2\n\n0\n\nFor example, Snuke can paint the blocks as shown in the diagram below.\nThere are 8 red blocks and 8 blue blocks, thus the difference is 0.\n\nSample Input 3\n\n5 3 5\n\nSample Output 3\n\n15\n\nFor example, Snuke can paint the blocks as shown in the diagram below.\nThere are 45 red blocks and 30 blue blocks, thus the difference is 9.", "sample_input": "3 3 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p04005", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a rectangular parallelepiped of size A×B×C, built with blocks of size 1×1×1. Snuke will paint each of the A×B×C blocks either red or blue, so that:\n\nThere is at least one red block and at least one blue block.\n\nThe union of all red blocks forms a rectangular parallelepiped.\n\nThe union of all blue blocks forms a rectangular parallelepiped.\n\nSnuke wants to minimize the difference between the number of red blocks and the number of blue blocks. Find the minimum possible difference.\n\nConstraints\n\n2≤A,B,C≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum possible difference between the number of red blocks and the number of blue blocks.\n\nSample Input 1\n\n3 3 3\n\nSample Output 1\n\n9\n\nFor example, Snuke can paint the blocks as shown in the diagram below.\nThere are 9 red blocks and 18 blue blocks, thus the difference is 9.\n\nSample Input 2\n\n2 2 4\n\nSample Output 2\n\n0\n\nFor example, Snuke can paint the blocks as shown in the diagram below.\nThere are 8 red blocks and 8 blue blocks, thus the difference is 0.\n\nSample Input 3\n\n5 3 5\n\nSample Output 3\n\n15\n\nFor example, Snuke can paint the blocks as shown in the diagram below.\nThere are 45 red blocks and 30 blue blocks, thus the difference is 9.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 44, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s048893473", "group_id": "codeNet:p04011", "input_text": "use v6;\nmy $n = get().chomp;\nmy $k = get().chomp;\nmy $x = get().chomp;\nmy $y = get().chomp;\n\nif ($n < $k) {\n \tsay $k * $x;\n} else {\n \tsay $k * $x + ($n - $k) * $y;\n}\n\nexit;", "language": "Perl", "metadata": {"date": 1472565458, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p04011.html", "problem_id": "p04011", "resource_group": "low_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/Perl/s048893473.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s048893473", "user_id": "u581311198"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": "use v6;\nmy $n = get().chomp;\nmy $k = get().chomp;\nmy $x = get().chomp;\nmy $y = get().chomp;\n\nif ($n < $k) {\n \tsay $k * $x;\n} else {\n \tsay $k * $x + ($n - $k) * $y;\n}\n\nexit;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 517, "memory_kb": 66288}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s871026820", "group_id": "codeNet:p04012", "input_text": "my $s = glob<>;\nfor my $c ( 'a' .. 'z' ) {\n length( $s ) % 2 and print 'No' and exit;\n $s =~ s/$c//g;\n $s or last;\n}\nprint 'Yes';\n", "language": "Perl", "metadata": {"date": 1565305042, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04012.html", "problem_id": "p04012", "resource_group": "low_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/Perl/s871026820.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s871026820", "user_id": "u822702091"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "my $s = glob<>;\nfor my $c ( 'a' .. 'z' ) {\n length( $s ) % 2 and print 'No' and exit;\n $s =~ s/$c//g;\n $s or last;\n}\nprint 'Yes';\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 139, "cpu_time_ms": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s849202088", "group_id": "codeNet:p04012", "input_text": "[?(get.comb.Bag.values.any%2)].say", "language": "Perl", "metadata": {"date": 1537909093, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p04012.html", "problem_id": "p04012", "resource_group": "low_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/Perl/s849202088.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s849202088", "user_id": "u657913472"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "[?(get.comb.Bag.values.any%2)].say", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 145, "memory_kb": 51820}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s179221095", "group_id": "codeNet:p04013", "input_text": "($=,$~,@_)=glob`dd`;@@[$=*=$~]=1;$%=$~-$_,@@=map$_+$@[$%++],@@for@_;print$@[$=]-1", "language": "Perl", "metadata": {"date": 1538016521, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04013.html", "problem_id": "p04013", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04013/input.txt", "sample_output_relpath": "derived/input_output/data/p04013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04013/Perl/s179221095.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s179221095", "user_id": "u657913472"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "($=,$~,@_)=glob`dd`;@@[$=*=$~]=1;$%=$~-$_,@@=map$_+$@[$%++],@@for@_;print$@[$=]-1", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTak has N cards. On the i-th (1 \\leq i \\leq N) card is written an integer x_i.\nHe is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A.\nIn how many ways can he make his selection?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A \\leq 50\n\n1 \\leq x_i \\leq 50\n\nN,\\,A,\\,x_i are integers.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 1 \\leq N \\leq 16.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the number of ways to select cards such that the average of the written integers is exactly A.\n\nSample Input 1\n\n4 8\n7 9 8 9\n\nSample Output 1\n\n5\n\nThe following are the 5 ways to select cards such that the average is 8:\n\nSelect the 3-rd card.\n\nSelect the 1-st and 2-nd cards.\n\nSelect the 1-st and 4-th cards.\n\nSelect the 1-st, 2-nd and 3-rd cards.\n\nSelect the 1-st, 3-rd and 4-th cards.\n\nSample Input 2\n\n3 8\n6 6 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n8 5\n3 6 2 8 7 6 5 9\n\nSample Output 3\n\n19\n\nSample Input 4\n\n33 3\n3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n\nSample Output 4\n\n8589934591\n\nThe answer may not fit into a 32-bit integer.", "sample_input": "4 8\n7 9 8 9\n"}, "reference_outputs": ["5\n"], "source_document_id": "p04013", "source_text": "Score : 300 points\n\nProblem Statement\n\nTak has N cards. On the i-th (1 \\leq i \\leq N) card is written an integer x_i.\nHe is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A.\nIn how many ways can he make his selection?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A \\leq 50\n\n1 \\leq x_i \\leq 50\n\nN,\\,A,\\,x_i are integers.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 1 \\leq N \\leq 16.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the number of ways to select cards such that the average of the written integers is exactly A.\n\nSample Input 1\n\n4 8\n7 9 8 9\n\nSample Output 1\n\n5\n\nThe following are the 5 ways to select cards such that the average is 8:\n\nSelect the 3-rd card.\n\nSelect the 1-st and 2-nd cards.\n\nSelect the 1-st and 4-th cards.\n\nSelect the 1-st, 2-nd and 3-rd cards.\n\nSelect the 1-st, 3-rd and 4-th cards.\n\nSample Input 2\n\n3 8\n6 6 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n8 5\n3 6 2 8 7 6 5 9\n\nSample Output 3\n\n19\n\nSample Input 4\n\n33 3\n3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n\nSample Output 4\n\n8589934591\n\nThe answer may not fit into a 32-bit integer.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 46, "memory_kb": 1348}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s705530272", "group_id": "codeNet:p04016", "input_text": "($n,$s)=<>;\nexit!print$n+1if$n==$s;\nfor(2..sqrt$n){\n\t$%=$n;\n\t$t=0;\n\t0while$t+=$%%$_,$%/=$_;\n\texit!print if$t==$s\n}\nfor$p(1..sqrt($n)-1){\n\t$q=$s-$p;\n\t$_=($n-$q)/$p|0;\n\texit!print if 0<=$p&&$p<$_&&0<=$q&&$q<$_&&$p*$_+$q==$n\n}\nprint-1\n", "language": "Perl", "metadata": {"date": 1515140165, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04016.html", "problem_id": "p04016", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04016/input.txt", "sample_output_relpath": "derived/input_output/data/p04016/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04016/Perl/s705530272.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s705530272", "user_id": "u283869437"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "($n,$s)=<>;\nexit!print$n+1if$n==$s;\nfor(2..sqrt$n){\n\t$%=$n;\n\t$t=0;\n\t0while$t+=$%%$_,$%/=$_;\n\texit!print if$t==$s\n}\nfor$p(1..sqrt($n)-1){\n\t$q=$s-$p;\n\t$_=($n-$q)/$p|0;\n\texit!print if 0<=$p&&$p<$_&&0<=$q&&$q<$_&&$p*$_+$q==$n\n}\nprint-1\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor integers b (b \\geq 2) and n (n \\geq 1), let the function f(b,n) be defined as follows:\n\nf(b,n) = n, when n < b\n\nf(b,n) = f(b,\\,{\\rm floor}(n / b)) + (n \\ {\\rm mod} \\ b), when n \\geq b\n\nHere, {\\rm floor}(n / b) denotes the largest integer not exceeding n / b,\nand n \\ {\\rm mod} \\ b denotes the remainder of n divided by b.\n\nLess formally, f(b,n) is equal to the sum of the digits of n written in base b.\nFor example, the following hold:\n\nf(10,\\,87654)=8+7+6+5+4=30\n\nf(100,\\,87654)=8+76+54=138\n\nYou are given integers n and s.\nDetermine if there exists an integer b (b \\geq 2) such that f(b,n)=s.\nIf the answer is positive, also find the smallest such b.\n\nConstraints\n\n1 \\leq n \\leq 10^{11}\n\n1 \\leq s \\leq 10^{11}\n\nn,\\,s are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nn\ns\n\nOutput\n\nIf there exists an integer b (b \\geq 2) such that f(b,n)=s, print the smallest such b.\nIf such b does not exist, print -1 instead.\n\nSample Input 1\n\n87654\n30\n\nSample Output 1\n\n10\n\nSample Input 2\n\n87654\n138\n\nSample Output 2\n\n100\n\nSample Input 3\n\n87654\n45678\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n31415926535\n1\n\nSample Output 4\n\n31415926535\n\nSample Input 5\n\n1\n31415926535\n\nSample Output 5\n\n-1", "sample_input": "87654\n30\n"}, "reference_outputs": ["10\n"], "source_document_id": "p04016", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor integers b (b \\geq 2) and n (n \\geq 1), let the function f(b,n) be defined as follows:\n\nf(b,n) = n, when n < b\n\nf(b,n) = f(b,\\,{\\rm floor}(n / b)) + (n \\ {\\rm mod} \\ b), when n \\geq b\n\nHere, {\\rm floor}(n / b) denotes the largest integer not exceeding n / b,\nand n \\ {\\rm mod} \\ b denotes the remainder of n divided by b.\n\nLess formally, f(b,n) is equal to the sum of the digits of n written in base b.\nFor example, the following hold:\n\nf(10,\\,87654)=8+7+6+5+4=30\n\nf(100,\\,87654)=8+76+54=138\n\nYou are given integers n and s.\nDetermine if there exists an integer b (b \\geq 2) such that f(b,n)=s.\nIf the answer is positive, also find the smallest such b.\n\nConstraints\n\n1 \\leq n \\leq 10^{11}\n\n1 \\leq s \\leq 10^{11}\n\nn,\\,s are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nn\ns\n\nOutput\n\nIf there exists an integer b (b \\geq 2) such that f(b,n)=s, print the smallest such b.\nIf such b does not exist, print -1 instead.\n\nSample Input 1\n\n87654\n30\n\nSample Output 1\n\n10\n\nSample Input 2\n\n87654\n138\n\nSample Output 2\n\n100\n\nSample Input 3\n\n87654\n45678\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n31415926535\n1\n\nSample Output 4\n\n31415926535\n\nSample Input 5\n\n1\n31415926535\n\nSample Output 5\n\n-1", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 232, "cpu_time_ms": 500, "memory_kb": 384}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s637034217", "group_id": "codeNet:p04022", "input_text": "<>;\nfor(`factor`){\n\t$x=$t{$x}=1;\n\ts/( \\d+)\\1*\\b/$x*=$&**($a=$&=~y! !!%3);$t{$x}*=$&**(-$a%3)/ge;\n\t++$h{$x}\n}\n$%=!!$h{1};\ndelete$h{1};\n$%+=$h{$h{$_}>$h{$t{$_}}?$_:$t{$_}},$h{$_}=$h{$t{$_}}=0for keys%h;\nprint$%\n", "language": "Perl", "metadata": {"date": 1555319015, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04022.html", "problem_id": "p04022", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04022/input.txt", "sample_output_relpath": "derived/input_output/data/p04022/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04022/Perl/s637034217.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s637034217", "user_id": "u283869437"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "<>;\nfor(`factor`){\n\t$x=$t{$x}=1;\n\ts/( \\d+)\\1*\\b/$x*=$&**($a=$&=~y! !!%3);$t{$x}*=$&**(-$a%3)/ge;\n\t++$h{$x}\n}\n$%=!!$h{1};\ndelete$h{1};\n$%+=$h{$h{$_}>$h{$t{$_}}?$_:$t{$_}},$h{$_}=$h{$t{$_}}=0for keys%h;\nprint$%\n", "problem_context": "Score : 1100 points\n\nProblem Statement\n\nSnuke got positive integers s_1,...,s_N from his mother, as a birthday present. There may be duplicate elements.\n\nHe will circle some of these N integers. Since he dislikes cubic numbers, he wants to ensure that if both s_i and s_j (i ≠ j) are circled, the product s_is_j is not cubic. For example, when s_1=1,s_2=1,s_3=2,s_4=4, it is not possible to circle both s_1 and s_2 at the same time. It is not possible to circle both s_3 and s_4 at the same time, either.\n\nFind the maximum number of integers that Snuke can circle.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ s_i ≦ 10^{10}\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns_1\n:\ns_N\n\nOutput\n\nPrint the maximum number of integers that Snuke can circle.\n\nSample Input 1\n\n8\n1\n2\n3\n4\n5\n6\n7\n8\n\nSample Output 1\n\n6\n\nSnuke can circle 1,2,3,5,6,7.\n\nSample Input 2\n\n6\n2\n4\n8\n16\n32\n64\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n1\n10\n100\n1000000007\n10000000000\n1000000009\n999999999\n999\n999\n999\n\nSample Output 3\n\n9", "sample_input": "8\n1\n2\n3\n4\n5\n6\n7\n8\n"}, "reference_outputs": ["6\n"], "source_document_id": "p04022", "source_text": "Score : 1100 points\n\nProblem Statement\n\nSnuke got positive integers s_1,...,s_N from his mother, as a birthday present. There may be duplicate elements.\n\nHe will circle some of these N integers. Since he dislikes cubic numbers, he wants to ensure that if both s_i and s_j (i ≠ j) are circled, the product s_is_j is not cubic. For example, when s_1=1,s_2=1,s_3=2,s_4=4, it is not possible to circle both s_1 and s_2 at the same time. It is not possible to circle both s_3 and s_4 at the same time, either.\n\nFind the maximum number of integers that Snuke can circle.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ s_i ≦ 10^{10}\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns_1\n:\ns_N\n\nOutput\n\nPrint the maximum number of integers that Snuke can circle.\n\nSample Input 1\n\n8\n1\n2\n3\n4\n5\n6\n7\n8\n\nSample Output 1\n\n6\n\nSnuke can circle 1,2,3,5,6,7.\n\nSample Input 2\n\n6\n2\n4\n8\n16\n32\n64\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n1\n10\n100\n1000000007\n10000000000\n1000000009\n999999999\n999\n999\n999\n\nSample Output 3\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 209, "cpu_time_ms": 1329, "memory_kb": 48476}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s514100084", "group_id": "codeNet:p04022", "input_text": "<>;\nfor(`factor`){\n\t$x=1;$y=1;\n\ts/( \\d+)\\1*\\b/$x*=$&**($a=$&=~y! !!%3);$y*=$&<1e5&&$&**(-$a%3)/ge;\n\t++$h{$x};\n\t$t{$x}=$y\n}\n$%=!!$h{1};\ndelete$h{1};\nwhile(keys%h){\n\t$_=(keys%h)[0];\n\t$%+=$h{$_}>$h{$t{$_}}?$h{$_}:$h{$t{$_}};\n\tdelete$h{$_};\n\tdelete$h{$t{$_}}\n}\nprint$%,$/\n", "language": "Perl", "metadata": {"date": 1555317092, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04022.html", "problem_id": "p04022", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04022/input.txt", "sample_output_relpath": "derived/input_output/data/p04022/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04022/Perl/s514100084.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s514100084", "user_id": "u283869437"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "<>;\nfor(`factor`){\n\t$x=1;$y=1;\n\ts/( \\d+)\\1*\\b/$x*=$&**($a=$&=~y! !!%3);$y*=$&<1e5&&$&**(-$a%3)/ge;\n\t++$h{$x};\n\t$t{$x}=$y\n}\n$%=!!$h{1};\ndelete$h{1};\nwhile(keys%h){\n\t$_=(keys%h)[0];\n\t$%+=$h{$_}>$h{$t{$_}}?$h{$_}:$h{$t{$_}};\n\tdelete$h{$_};\n\tdelete$h{$t{$_}}\n}\nprint$%,$/\n", "problem_context": "Score : 1100 points\n\nProblem Statement\n\nSnuke got positive integers s_1,...,s_N from his mother, as a birthday present. There may be duplicate elements.\n\nHe will circle some of these N integers. Since he dislikes cubic numbers, he wants to ensure that if both s_i and s_j (i ≠ j) are circled, the product s_is_j is not cubic. For example, when s_1=1,s_2=1,s_3=2,s_4=4, it is not possible to circle both s_1 and s_2 at the same time. It is not possible to circle both s_3 and s_4 at the same time, either.\n\nFind the maximum number of integers that Snuke can circle.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ s_i ≦ 10^{10}\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns_1\n:\ns_N\n\nOutput\n\nPrint the maximum number of integers that Snuke can circle.\n\nSample Input 1\n\n8\n1\n2\n3\n4\n5\n6\n7\n8\n\nSample Output 1\n\n6\n\nSnuke can circle 1,2,3,5,6,7.\n\nSample Input 2\n\n6\n2\n4\n8\n16\n32\n64\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n1\n10\n100\n1000000007\n10000000000\n1000000009\n999999999\n999\n999\n999\n\nSample Output 3\n\n9", "sample_input": "8\n1\n2\n3\n4\n5\n6\n7\n8\n"}, "reference_outputs": ["6\n"], "source_document_id": "p04022", "source_text": "Score : 1100 points\n\nProblem Statement\n\nSnuke got positive integers s_1,...,s_N from his mother, as a birthday present. There may be duplicate elements.\n\nHe will circle some of these N integers. Since he dislikes cubic numbers, he wants to ensure that if both s_i and s_j (i ≠ j) are circled, the product s_is_j is not cubic. For example, when s_1=1,s_2=1,s_3=2,s_4=4, it is not possible to circle both s_1 and s_2 at the same time. It is not possible to circle both s_3 and s_4 at the same time, either.\n\nFind the maximum number of integers that Snuke can circle.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ s_i ≦ 10^{10}\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns_1\n:\ns_N\n\nOutput\n\nPrint the maximum number of integers that Snuke can circle.\n\nSample Input 1\n\n8\n1\n2\n3\n4\n5\n6\n7\n8\n\nSample Output 1\n\n6\n\nSnuke can circle 1,2,3,5,6,7.\n\nSample Input 2\n\n6\n2\n4\n8\n16\n32\n64\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n1\n10\n100\n1000000007\n10000000000\n1000000009\n999999999\n999\n999\n999\n\nSample Output 3\n\n9", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5258, "memory_kb": 44504}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s304253041", "group_id": "codeNet:p04026", "input_text": "<>=~/(.).?\\1/;print@-?1+$-[0].$\".$+[0]:'-1 -1'", "language": "Perl", "metadata": {"date": 1471143178, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04026.html", "problem_id": "p04026", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04026/input.txt", "sample_output_relpath": "derived/input_output/data/p04026/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04026/Perl/s304253041.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304253041", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2 5\n", "input_to_evaluate": "<>=~/(.).?\\1/;print@-?1+$-[0].$\".$+[0]:'-1 -1'", "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": "p04026", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 46, "cpu_time_ms": 27, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s558945664", "group_id": "codeNet:p04029", "input_text": "say [+] 1..get", "language": "Perl", "metadata": {"date": 1520341611, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p04029.html", "problem_id": "p04029", "resource_group": "low_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/Perl/s558945664.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s558945664", "user_id": "u657913472"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "say [+] 1..get", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 14, "cpu_time_ms": 126, "memory_kb": 49280}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s347951406", "group_id": "codeNet:p04029", "input_text": "#!/usr/bin/env perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $N = ;\nsay $N * ($N + 1) / 2;", "language": "Perl", "metadata": {"date": 1474410888, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04029.html", "problem_id": "p04029", "resource_group": "low_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/Perl/s347951406.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s347951406", "user_id": "u130813824"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "#!/usr/bin/env perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $N = ;\nsay $N * ($N + 1) / 2;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 117, "cpu_time_ms": 11, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s452893476", "group_id": "codeNet:p04029", "input_text": "use v6;\nmy $n = get().chomp;\nmy $ans = 0;\nloop (my $i = 1; $i <= $n; $i++) {\n \t$ans += $i;\n}\nsay $ans;\n\nexit;", "language": "Perl", "metadata": {"date": 1471142145, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p04029.html", "problem_id": "p04029", "resource_group": "low_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/Perl/s452893476.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s452893476", "user_id": "u581311198"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "use v6;\nmy $n = get().chomp;\nmy $ans = 0;\nloop (my $i = 1; $i <= $n; $i++) {\n \t$ans += $i;\n}\nsay $ans;\n\nexit;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 115, "cpu_time_ms": 783, "memory_kb": 55164}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s588956551", "group_id": "codeNet:p04030", "input_text": "$_=get;s/.?B// xx 9;.say", "language": "Perl", "metadata": {"date": 1537869137, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p04030.html", "problem_id": "p04030", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04030/input.txt", "sample_output_relpath": "derived/input_output/data/p04030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04030/Perl/s588956551.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s588956551", "user_id": "u657913472"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "$_=get;s/.?B// xx 9;.say", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "sample_input": "01B0\n"}, "reference_outputs": ["00\n"], "source_document_id": "p04030", "source_text": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 24, "cpu_time_ms": 298, "memory_kb": 65872}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s876536091", "group_id": "codeNet:p04030", "input_text": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $S = $ARGV[0];\ndo {\n $S =~ s/(0|1)B//;\n $S =~ s/^B//;\n} while( $S =~ /(0|1)B/ );\n$S =~ s/B//g;\n\nsay $S;", "language": "Perl", "metadata": {"date": 1474420234, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04030.html", "problem_id": "p04030", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04030/input.txt", "sample_output_relpath": "derived/input_output/data/p04030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04030/Perl/s876536091.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s876536091", "user_id": "u392449960"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $S = $ARGV[0];\ndo {\n $S =~ s/(0|1)B//;\n $S =~ s/^B//;\n} while( $S =~ /(0|1)B/ );\n$S =~ s/B//g;\n\nsay $S;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "sample_input": "01B0\n"}, "reference_outputs": ["00\n"], "source_document_id": "p04030", "source_text": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 177, "cpu_time_ms": 12, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s925067625", "group_id": "codeNet:p04030", "input_text": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $S = ;\ndo {\n $S =~ s/(0|1)B//;\n $S =~ s/^B//;\n} while( $S =~ /(0|1)B/ );\n\n$S =~ s/B//;\n\nsay $S;", "language": "Perl", "metadata": {"date": 1474419593, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04030.html", "problem_id": "p04030", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04030/input.txt", "sample_output_relpath": "derived/input_output/data/p04030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04030/Perl/s925067625.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s925067625", "user_id": "u392449960"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $S = ;\ndo {\n $S =~ s/(0|1)B//;\n $S =~ s/^B//;\n} while( $S =~ /(0|1)B/ );\n\n$S =~ s/B//;\n\nsay $S;", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "sample_input": "01B0\n"}, "reference_outputs": ["00\n"], "source_document_id": "p04030", "source_text": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 11, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s310022955", "group_id": "codeNet:p04031", "input_text": "get;my@a=map *+101,get.words;say min (sum map *²,--<<@a)xx 201", "language": "Perl", "metadata": {"date": 1537866786, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p04031.html", "problem_id": "p04031", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04031/input.txt", "sample_output_relpath": "derived/input_output/data/p04031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04031/Perl/s310022955.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s310022955", "user_id": "u657913472"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "get;my@a=map *+101,get.words;say min (sum map *²,--<<@a)xx 201", "problem_context": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\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 minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "sample_input": "2\n4 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p04031", "source_text": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\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 minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 63, "cpu_time_ms": 180, "memory_kb": 57716}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s458076329", "group_id": "codeNet:p04031", "input_text": "use 5.018;\nuse utf8;\nuse strict;\nuse warnings;\nuse feature qw/say/;\nuse List::Util qw/min max/;\n\nchomp(my $N = );\nchomp(my $as = );\nmy @as = map { $_ + 0 } split(/ /, $as);\nmy $max = max(@as);\nmy $min = min(@as);\n\nmy $score = min map { calc_score($_, @as) } ($min..$max);\nsay($score);\n\nsub calc_score {\n my ($res, @as) = @_;\n my $score = 0;\n $score += ($_ - $res) ** 2 for @as;\n $score;\n}\n", "language": "Perl", "metadata": {"date": 1474411922, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04031.html", "problem_id": "p04031", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04031/input.txt", "sample_output_relpath": "derived/input_output/data/p04031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04031/Perl/s458076329.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s458076329", "user_id": "u502685724"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "use 5.018;\nuse utf8;\nuse strict;\nuse warnings;\nuse feature qw/say/;\nuse List::Util qw/min max/;\n\nchomp(my $N = );\nchomp(my $as = );\nmy @as = map { $_ + 0 } split(/ /, $as);\nmy $max = max(@as);\nmy $min = min(@as);\n\nmy $score = min map { calc_score($_, @as) } ($min..$max);\nsay($score);\n\nsub calc_score {\n my ($res, @as) = @_;\n my $score = 0;\n $score += ($_ - $res) ** 2 for @as;\n $score;\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\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 minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "sample_input": "2\n4 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p04031", "source_text": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\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 minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 24, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s695128981", "group_id": "codeNet:p04033", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($a, $b) = split / /, );\nif ($a>0) {\n say 'Positive';\n} elsif ($a<=0 && 0<=$b) {\n say 'Zero';\n} elsif (($b-$a)%2==0) {\n say 'Negative';\n} else {\n say 'Positive';\n}", "language": "Perl", "metadata": {"date": 1585265315, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04033.html", "problem_id": "p04033", "resource_group": "low_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/Perl/s695128981.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s695128981", "user_id": "u979552932"}, "prompt_components": {"gold_output": "Positive\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($a, $b) = split / /, );\nif ($a>0) {\n say 'Positive';\n} elsif ($a<=0 && 0<=$b) {\n say 'Zero';\n} elsif (($b-$a)%2==0) {\n say 'Negative';\n} else {\n say 'Positive';\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s872158608", "group_id": "codeNet:p04033", "input_text": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($a, $b) = split / /, );\nif ($a>0) {\n say 'Positive';\n} elsif ($a<=0 && 0<=$b) {\n say 'Zero';\n} elsif ($a==$b) {\n say 'Positive';\n} elsif (scalar($a..$b)%2==0) {\n say 'Positive';\n} else {\n say 'Negative';\n}", "language": "Perl", "metadata": {"date": 1585264984, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04033.html", "problem_id": "p04033", "resource_group": "low_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/Perl/s872158608.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s872158608", "user_id": "u979552932"}, "prompt_components": {"gold_output": "Positive\n", "input_to_evaluate": "use v5.18; # strict say state\nuse warnings;\nuse List::Util qw(reduce first max min sum0);\n\nchomp (my ($a, $b) = split / /, );\nif ($a>0) {\n say 'Positive';\n} elsif ($a<=0 && 0<=$b) {\n say 'Zero';\n} elsif ($a==$b) {\n say 'Positive';\n} elsif (scalar($a..$b)%2==0) {\n say 'Positive';\n} else {\n say 'Negative';\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 319, "cpu_time_ms": 5, "memory_kb": 896}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s827424485", "group_id": "codeNet:p04033", "input_text": "use v6;\n\nmy ($a, $b) = get().chomp.split(' ');\nif (0 < $a) {\n\tsay 'Positive';\n} elsif ($b < 0) {\n\tmy $n = $b - $a;\n\tif ($n % 2 == 0) {\n\t\tsay 'Negative';\n\t} else {\n\t\tsay 'Positive';\n\t}\n} else {\n\tsay 'Zero';\n}\n\n\nexit;", "language": "Perl", "metadata": {"date": 1470112410, "filename_ext": "pl", "original_language": "Perl6 (rakudo-star 2016.01)", "problem_description_relpath": "problem_descriptions/p04033.html", "problem_id": "p04033", "resource_group": "low_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/Perl/s827424485.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s827424485", "user_id": "u581311198"}, "prompt_components": {"gold_output": "Positive\n", "input_to_evaluate": "use v6;\n\nmy ($a, $b) = get().chomp.split(' ');\nif (0 < $a) {\n\tsay 'Positive';\n} elsif ($b < 0) {\n\tmy $n = $b - $a;\n\tif ($n % 2 == 0) {\n\t\tsay 'Negative';\n\t} else {\n\t\tsay 'Positive';\n\t}\n} else {\n\tsay 'Zero';\n}\n\n\nexit;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 549, "memory_kb": 67232}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s682031372", "group_id": "codeNet:p04034", "input_text": "($N,$M)=glob<>;\n$N++;\n@C=0;$#C=$N;$C[1]=1;\n@L=(\"1\")x($N);\n\nfor(1..$M){\n ($x,$y)=glob<>;\n $L[$x]--;\n $L[$y]++;\n $C[$y]++ if($C[$x]>0);\n $C[$x]=0 if($L[$x]<1);\n}\nprint scalar (grep{$_>0}@C)", "language": "Perl", "metadata": {"date": 1559921133, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04034.html", "problem_id": "p04034", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04034/input.txt", "sample_output_relpath": "derived/input_output/data/p04034/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04034/Perl/s682031372.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s682031372", "user_id": "u573154728"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "($N,$M)=glob<>;\n$N++;\n@C=0;$#C=$N;$C[1]=1;\n@L=(\"1\")x($N);\n\nfor(1..$M){\n ($x,$y)=glob<>;\n $L[$x]--;\n $L[$y]++;\n $C[$y]++ if($C[$x]>0);\n $C[$x]=0 if($L[$x]<1);\n}\nprint scalar (grep{$_>0}@C)", "problem_context": "Problem Statement\n\nWe have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.\n\nSnuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.\n\nFind the number of boxes that may contain the red ball after all operations are performed.\n\nConstraints\n\n2≤N≤10^5\n\n1≤M≤10^5\n\n1≤x_i,y_i≤N\n\nx_i≠y_i\n\nJust before the i-th operation is performed, box x_i contains at least 1 ball.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nx_1 y_1\n:\nx_M y_M\n\nOutput\n\nPrint the number of boxes that may contain the red ball after all operations are performed.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\n2\n\nJust after the first operation, box 1 is empty, box 2 contains one red ball and one white ball, and box 3 contains one white ball.\n\nNow, consider the second operation. If Snuke picks the red ball from box 2, the red ball will go into box 3. If he picks the white ball instead, the red ball will stay in box 2.\nThus, the number of boxes that may contain the red ball after all operations, is 2.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n2 3\n\nSample Output 2\n\n1\n\nAll balls will go into box 3.\n\nSample Input 3\n\n4 4\n1 2\n2 3\n4 1\n3 4\n\nSample Output 3\n\n3", "sample_input": "3 2\n1 2\n2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p04034", "source_text": "Problem Statement\n\nWe have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.\n\nSnuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.\n\nFind the number of boxes that may contain the red ball after all operations are performed.\n\nConstraints\n\n2≤N≤10^5\n\n1≤M≤10^5\n\n1≤x_i,y_i≤N\n\nx_i≠y_i\n\nJust before the i-th operation is performed, box x_i contains at least 1 ball.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nx_1 y_1\n:\nx_M y_M\n\nOutput\n\nPrint the number of boxes that may contain the red ball after all operations are performed.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\n2\n\nJust after the first operation, box 1 is empty, box 2 contains one red ball and one white ball, and box 3 contains one white ball.\n\nNow, consider the second operation. If Snuke picks the red ball from box 2, the red ball will go into box 3. If he picks the white ball instead, the red ball will stay in box 2.\nThus, the number of boxes that may contain the red ball after all operations, is 2.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n2 3\n\nSample Output 2\n\n1\n\nAll balls will go into box 3.\n\nSample Input 3\n\n4 4\n1 2\n2 3\n4 1\n3 4\n\nSample Output 3\n\n3", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 740, "memory_kb": 14976}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s565088787", "group_id": "codeNet:p04035", "input_text": "<>=~$\";$'>$_+$_[++$%]or$x=$%for@_=glob<>;print$_?abs:($x?P:Imp).ossible,$/for$x&&(0..$x-1,1-$`..-$x)\n", "language": "Perl", "metadata": {"date": 1588216578, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04035.html", "problem_id": "p04035", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04035/input.txt", "sample_output_relpath": "derived/input_output/data/p04035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04035/Perl/s565088787.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s565088787", "user_id": "u468291514"}, "prompt_components": {"gold_output": "Possible\n2\n1\n", "input_to_evaluate": "<>=~$\";$'>$_+$_[++$%]or$x=$%for@_=glob<>;print$_?abs:($x?P:Imp).ossible,$/for$x&&(0..$x-1,1-$`..-$x)\n", "problem_context": "Problem Statement\n\nWe have N pieces of ropes, numbered 1 through N. The length of piece i is a_i.\n\nAt first, for each i (1≤i≤N-1), piece i and piece i+1 are tied at the ends, forming one long rope with N-1 knots. Snuke will try to untie all of the knots by performing the following operation repeatedly:\n\nChoose a (connected) rope with a total length of at least L, then untie one of its knots.\n\nIs it possible to untie all of the N-1 knots by properly applying this operation? If the answer is positive, find one possible order to untie the knots.\n\nConstraints\n\n2≤N≤10^5\n\n1≤L≤10^9\n\n1≤a_i≤10^9\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN L\na_1 a_2 ... a_n\n\nOutput\n\nIf it is not possible to untie all of the N-1 knots, print Impossible.\n\nIf it is possible to untie all of the knots, print Possible, then print another N-1 lines that describe a possible order to untie the knots. The j-th of those N-1 lines should contain the index of the knot that is untied in the j-th operation. Here, the index of the knot connecting piece i and piece i+1 is i.\n\nIf there is more than one solution, output any.\n\nSample Input 1\n\n3 50\n30 20 10\n\nSample Output 1\n\nPossible\n2\n1\n\nIf the knot 1 is untied first, the knot 2 will become impossible to untie.\n\nSample Input 2\n\n2 21\n10 10\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n5 50\n10 20 30 40 50\n\nSample Output 3\n\nPossible\n1\n2\n3\n4\n\nAnother example of a possible solution is 3, 4, 1, 2.", "sample_input": "3 50\n30 20 10\n"}, "reference_outputs": ["Possible\n2\n1\n"], "source_document_id": "p04035", "source_text": "Problem Statement\n\nWe have N pieces of ropes, numbered 1 through N. The length of piece i is a_i.\n\nAt first, for each i (1≤i≤N-1), piece i and piece i+1 are tied at the ends, forming one long rope with N-1 knots. Snuke will try to untie all of the knots by performing the following operation repeatedly:\n\nChoose a (connected) rope with a total length of at least L, then untie one of its knots.\n\nIs it possible to untie all of the N-1 knots by properly applying this operation? If the answer is positive, find one possible order to untie the knots.\n\nConstraints\n\n2≤N≤10^5\n\n1≤L≤10^9\n\n1≤a_i≤10^9\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN L\na_1 a_2 ... a_n\n\nOutput\n\nIf it is not possible to untie all of the N-1 knots, print Impossible.\n\nIf it is possible to untie all of the knots, print Possible, then print another N-1 lines that describe a possible order to untie the knots. The j-th of those N-1 lines should contain the index of the knot that is untied in the j-th operation. Here, the index of the knot connecting piece i and piece i+1 is i.\n\nIf there is more than one solution, output any.\n\nSample Input 1\n\n3 50\n30 20 10\n\nSample Output 1\n\nPossible\n2\n1\n\nIf the knot 1 is untied first, the knot 2 will become impossible to untie.\n\nSample Input 2\n\n2 21\n10 10\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n5 50\n10 20 30 40 50\n\nSample Output 3\n\nPossible\n1\n2\n3\n4\n\nAnother example of a possible solution is 3, 4, 1, 2.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 101, "cpu_time_ms": 339, "memory_kb": 29440}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s047745872", "group_id": "codeNet:p04039", "input_text": "$_+=<>;@D=glob<>;$_++while/[@D]/;print", "language": "Perl", "metadata": {"date": 1506755219, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04039.html", "problem_id": "p04039", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04039/input.txt", "sample_output_relpath": "derived/input_output/data/p04039/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04039/Perl/s047745872.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s047745872", "user_id": "u283869437"}, "prompt_components": {"gold_output": "2000\n", "input_to_evaluate": "$_+=<>;@D=glob<>;$_++while/[@D]/;print", "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": "p04039", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38, "cpu_time_ms": 90, "memory_kb": 1024}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s910071246", "group_id": "codeNet:p04045", "input_text": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $N_K = ;\nmy ($N, $K) = split(' ', $N_K);\n\nmy $D = ;\nmy %like_n;\n$like_n{$_}++ for (0..9);\ndelete $like_n{$_} for split(' ', $D);\n\nmy @like_n = sort keys %like_n;\nmy $out = '';\nmy $up = undef;\nfor my $n (split(//, $N)) {\n if ($up) {\n my ($i) = @like_n;\n $out .= $i;\n next;\n }\n if ($like_n{$n}) {\n $out .= $n;\n next;\n }\n $up = 1;\n my ($i) = grep { $_ > $n } @like_n;\n if ($i) {\n $out .= $i;\n next;\n }\n $out .= '10';\n}\n\nsay $out;\n", "language": "Perl", "metadata": {"date": 1476165290, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04045.html", "problem_id": "p04045", "resource_group": "low_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/Perl/s910071246.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s910071246", "user_id": "u392449960"}, "prompt_components": {"gold_output": "2000\n", "input_to_evaluate": "#!perl\nuse strict;\nuse warnings;\nuse utf8;\nuse feature qw/say/;\n\nmy $N_K = ;\nmy ($N, $K) = split(' ', $N_K);\n\nmy $D = ;\nmy %like_n;\n$like_n{$_}++ for (0..9);\ndelete $like_n{$_} for split(' ', $D);\n\nmy @like_n = sort keys %like_n;\nmy $out = '';\nmy $up = undef;\nfor my $n (split(//, $N)) {\n if ($up) {\n my ($i) = @like_n;\n $out .= $i;\n next;\n }\n if ($like_n{$n}) {\n $out .= $n;\n next;\n }\n $up = 1;\n my ($i) = grep { $_ > $n } @like_n;\n if ($i) {\n $out .= $i;\n next;\n }\n $out .= '10';\n}\n\nsay $out;\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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 585, "cpu_time_ms": 7, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s409570439", "group_id": "codeNet:p04045", "input_text": "use strict;\nuse warnings;\n\nmy ($n, $k) = split / /, <>;\nmy @d = split / /, <>;\nchomp $k;\nchomp $d[-1];\n\nmy @not_num = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\nfor(my $i = 0; $i < $k; $i++) {\n \t$not_num[$d[$i]] = 1;\n}\nmy @ans = split //, $n;\n@ans = reverse(@ans);\n\nfor(my $i = 0; $i <= $#ans; $i++) {\n \tif($ans[$i] >= 10) {\n \t\t$ans[$i] %= 10;\n \t\tif($i == $#ans) {\n \t\t\t$ans[$i + 1] = 1;\n \t\t} else {\n \t\t\t$ans[$i + 1]++;\n \t\t}\n \t}\n\n \twhile(1) {\n \t\tlast if($not_num[$ans[$i]] == 0);\n \t\tif($ans[$i] != 9) {\n \t\t\t$ans[$i]++;\n \t\t} else {\n \t\t\t$ans[$i] = 0;\n \t\t\tif($i != $#ans) {\n \t\t\t\t$ans[$i + 1]++;\n \t\t\t} else {\n \t\t\t\t$ans[$i + 1] = 1;\n \t\t\t}\n \t\t}\n \t}\n}\n@ans = reverse(@ans);\nprint @ans;\nprint \"\\n\";\n\nexit;", "language": "Perl", "metadata": {"date": 1473100477, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04045.html", "problem_id": "p04045", "resource_group": "low_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/Perl/s409570439.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s409570439", "user_id": "u581311198"}, "prompt_components": {"gold_output": "2000\n", "input_to_evaluate": "use strict;\nuse warnings;\n\nmy ($n, $k) = split / /, <>;\nmy @d = split / /, <>;\nchomp $k;\nchomp $d[-1];\n\nmy @not_num = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\nfor(my $i = 0; $i < $k; $i++) {\n \t$not_num[$d[$i]] = 1;\n}\nmy @ans = split //, $n;\n@ans = reverse(@ans);\n\nfor(my $i = 0; $i <= $#ans; $i++) {\n \tif($ans[$i] >= 10) {\n \t\t$ans[$i] %= 10;\n \t\tif($i == $#ans) {\n \t\t\t$ans[$i + 1] = 1;\n \t\t} else {\n \t\t\t$ans[$i + 1]++;\n \t\t}\n \t}\n\n \twhile(1) {\n \t\tlast if($not_num[$ans[$i]] == 0);\n \t\tif($ans[$i] != 9) {\n \t\t\t$ans[$i]++;\n \t\t} else {\n \t\t\t$ans[$i] = 0;\n \t\t\tif($i != $#ans) {\n \t\t\t\t$ans[$i + 1]++;\n \t\t\t} else {\n \t\t\t\t$ans[$i + 1] = 1;\n \t\t\t}\n \t\t}\n \t}\n}\n@ans = reverse(@ans);\nprint @ans;\nprint \"\\n\";\n\nexit;", "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": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 817, "cpu_time_ms": 11, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s040263928", "group_id": "codeNet:p04047", "input_text": "my $N = <>;\nchomp $N;\nmy @L = split \" \", <>;\n\n@L = sort {$a <=> $b} @L;\nmy @list = grep {$_ % 2 == 0} 0..$#L;\n\nmy $sum;\nfor (@list) {\n $sum += $L[$_];\n}\nprint $sum;\n", "language": "Perl", "metadata": {"date": 1569703697, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04047.html", "problem_id": "p04047", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04047/input.txt", "sample_output_relpath": "derived/input_output/data/p04047/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04047/Perl/s040263928.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s040263928", "user_id": "u469420552"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "my $N = <>;\nchomp $N;\nmy @L = split \" \", <>;\n\n@L = sort {$a <=> $b} @L;\nmy @list = grep {$_ % 2 == 0} 0..$#L;\n\nmy $sum;\nfor (@list) {\n $sum += $L[$_];\n}\nprint $sum;\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "sample_input": "2\n1 3 1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p04047", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s752906336", "group_id": "codeNet:p04047", "input_text": "<>;(join$\",sort{$a-$b}glob<>)=~s/\\d+ (\\d+)/$%+=$&<$1?$&:$1/ger;print$%,$/", "language": "Perl", "metadata": {"date": 1468717494, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04047.html", "problem_id": "p04047", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04047/input.txt", "sample_output_relpath": "derived/input_output/data/p04047/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04047/Perl/s752906336.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s752906336", "user_id": "u283869437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "<>;(join$\",sort{$a-$b}glob<>)=~s/\\d+ (\\d+)/$%+=$&<$1?$&:$1/ger;print$%,$/", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "sample_input": "2\n1 3 1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p04047", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 14, "memory_kb": 768}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s236621063", "group_id": "codeNet:p04048", "input_text": "#!/usr/bin/perl\nuse Math::BigInt;\n\nwhile (<>) {\n ($n, $x) = split /\\s/, $_;\n last;\n}\n\n$d = Math::BigInt->new($n);\n\nif ($x <= $n / 3) {\n $d = ($n - $x) * 3;\n} elsif ($n / 3 < $x && $x < $n / 2) {\n $d = ($n - $x) * 4;\n} elsif ($n / 2 == $x) {\n $d = $x * 3;\n} elsif ($n / 2 < $x && $x < ($n * 2) / 3) {\n $d = ($n - $x) * 2 * 3;\n} else {\n $d = $x * 3;\n}\n\nprint \"$d\\n\";\n", "language": "Perl", "metadata": {"date": 1468722675, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04048.html", "problem_id": "p04048", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04048/input.txt", "sample_output_relpath": "derived/input_output/data/p04048/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04048/Perl/s236621063.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s236621063", "user_id": "u669573977"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "#!/usr/bin/perl\nuse Math::BigInt;\n\nwhile (<>) {\n ($n, $x) = split /\\s/, $_;\n last;\n}\n\n$d = Math::BigInt->new($n);\n\nif ($x <= $n / 3) {\n $d = ($n - $x) * 3;\n} elsif ($n / 3 < $x && $x < $n / 2) {\n $d = ($n - $x) * 4;\n} elsif ($n / 2 == $x) {\n $d = $x * 3;\n} elsif ($n / 2 < $x && $x < ($n * 2) / 3) {\n $d = ($n - $x) * 2 * 3;\n} else {\n $d = $x * 3;\n}\n\nprint \"$d\\n\";\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSnuke is conducting an optical experiment using mirrors and his new invention, the rifle of Mysterious Light.\n\nThree mirrors of length N are set so that they form an equilateral triangle.\nLet the vertices of the triangle be a, b and c.\n\nInside the triangle, the rifle is placed at the point p on segment ab such that ap = X.\n(The size of the rifle is negligible.)\nNow, the rifle is about to fire a ray of Mysterious Light in the direction of bc.\n\nThe ray of Mysterious Light will travel in a straight line, and will be reflected by mirrors, in the same ways as \"ordinary\" light.\nThere is one major difference, though: it will be also reflected by its own trajectory as if it is a mirror!\nWhen the ray comes back to the rifle, the ray will be absorbed.\n\nThe following image shows the ray's trajectory where N = 5 and X = 2.\n\nIt can be shown that the ray eventually comes back to the rifle and is absorbed, regardless of the values of N and X.\nFind the total length of the ray's trajectory.\n\nConstraints\n\n2≦N≦10^{12}\n\n1≦X≦N-1\n\nN and X are integers.\n\nPartial Points\n\n300 points will be awarded for passing the test set satisfying N≦1000.\n\nAnother 200 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 X\n\nOutput\n\nPrint the total length of the ray's trajectory.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n12\n\nRefer to the image in the Problem Statement section.\nThe total length of the trajectory is 2+3+2+2+1+1+1 = 12.", "sample_input": "5 2\n"}, "reference_outputs": ["12\n"], "source_document_id": "p04048", "source_text": "Score : 500 points\n\nProblem Statement\n\nSnuke is conducting an optical experiment using mirrors and his new invention, the rifle of Mysterious Light.\n\nThree mirrors of length N are set so that they form an equilateral triangle.\nLet the vertices of the triangle be a, b and c.\n\nInside the triangle, the rifle is placed at the point p on segment ab such that ap = X.\n(The size of the rifle is negligible.)\nNow, the rifle is about to fire a ray of Mysterious Light in the direction of bc.\n\nThe ray of Mysterious Light will travel in a straight line, and will be reflected by mirrors, in the same ways as \"ordinary\" light.\nThere is one major difference, though: it will be also reflected by its own trajectory as if it is a mirror!\nWhen the ray comes back to the rifle, the ray will be absorbed.\n\nThe following image shows the ray's trajectory where N = 5 and X = 2.\n\nIt can be shown that the ray eventually comes back to the rifle and is absorbed, regardless of the values of N and X.\nFind the total length of the ray's trajectory.\n\nConstraints\n\n2≦N≦10^{12}\n\n1≦X≦N-1\n\nN and X are integers.\n\nPartial Points\n\n300 points will be awarded for passing the test set satisfying N≦1000.\n\nAnother 200 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 X\n\nOutput\n\nPrint the total length of the ray's trajectory.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n12\n\nRefer to the image in the Problem Statement section.\nThe total length of the trajectory is 2+3+2+2+1+1+1 = 12.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 388, "cpu_time_ms": 63, "memory_kb": 4608}, "variant": "low_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Perl:s728860197", "group_id": "codeNet:p04048", "input_text": "#!/usr/bin/perl\n\nwhile (<>) {\n ($n, $x) = split /\\s/, $_;\n last;\n}\n\nif ($x <= $n / 3) {\n printf(\"%d\\n\", ($n - $x) * 3);\n} elsif ($n / 3 < $x && $x < $n / 2) {\n printf(\"%d\\n\", ($n - $x) * 4);\n} elsif ($n / 2 == $x) {\n printf(\"%d\\n\", $x * 3);\n} elsif ($n / 2 < $x && $x < ($n * 2) / 3) {\n printf(\"%d\\n\", $n * 3);\n} else {\n printf(\"%d\\n\", $x * 3);\n}\n", "language": "Perl", "metadata": {"date": 1468721708, "filename_ext": "pl", "original_language": "Perl (v5.18.2)", "problem_description_relpath": "problem_descriptions/p04048.html", "problem_id": "p04048", "resource_group": "low_resource", "sample_input_relpath": "derived/input_output/data/p04048/input.txt", "sample_output_relpath": "derived/input_output/data/p04048/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04048/Perl/s728860197.pl", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s728860197", "user_id": "u669573977"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "#!/usr/bin/perl\n\nwhile (<>) {\n ($n, $x) = split /\\s/, $_;\n last;\n}\n\nif ($x <= $n / 3) {\n printf(\"%d\\n\", ($n - $x) * 3);\n} elsif ($n / 3 < $x && $x < $n / 2) {\n printf(\"%d\\n\", ($n - $x) * 4);\n} elsif ($n / 2 == $x) {\n printf(\"%d\\n\", $x * 3);\n} elsif ($n / 2 < $x && $x < ($n * 2) / 3) {\n printf(\"%d\\n\", $n * 3);\n} else {\n printf(\"%d\\n\", $x * 3);\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSnuke is conducting an optical experiment using mirrors and his new invention, the rifle of Mysterious Light.\n\nThree mirrors of length N are set so that they form an equilateral triangle.\nLet the vertices of the triangle be a, b and c.\n\nInside the triangle, the rifle is placed at the point p on segment ab such that ap = X.\n(The size of the rifle is negligible.)\nNow, the rifle is about to fire a ray of Mysterious Light in the direction of bc.\n\nThe ray of Mysterious Light will travel in a straight line, and will be reflected by mirrors, in the same ways as \"ordinary\" light.\nThere is one major difference, though: it will be also reflected by its own trajectory as if it is a mirror!\nWhen the ray comes back to the rifle, the ray will be absorbed.\n\nThe following image shows the ray's trajectory where N = 5 and X = 2.\n\nIt can be shown that the ray eventually comes back to the rifle and is absorbed, regardless of the values of N and X.\nFind the total length of the ray's trajectory.\n\nConstraints\n\n2≦N≦10^{12}\n\n1≦X≦N-1\n\nN and X are integers.\n\nPartial Points\n\n300 points will be awarded for passing the test set satisfying N≦1000.\n\nAnother 200 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 X\n\nOutput\n\nPrint the total length of the ray's trajectory.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n12\n\nRefer to the image in the Problem Statement section.\nThe total length of the trajectory is 2+3+2+2+1+1+1 = 12.", "sample_input": "5 2\n"}, "reference_outputs": ["12\n"], "source_document_id": "p04048", "source_text": "Score : 500 points\n\nProblem Statement\n\nSnuke is conducting an optical experiment using mirrors and his new invention, the rifle of Mysterious Light.\n\nThree mirrors of length N are set so that they form an equilateral triangle.\nLet the vertices of the triangle be a, b and c.\n\nInside the triangle, the rifle is placed at the point p on segment ab such that ap = X.\n(The size of the rifle is negligible.)\nNow, the rifle is about to fire a ray of Mysterious Light in the direction of bc.\n\nThe ray of Mysterious Light will travel in a straight line, and will be reflected by mirrors, in the same ways as \"ordinary\" light.\nThere is one major difference, though: it will be also reflected by its own trajectory as if it is a mirror!\nWhen the ray comes back to the rifle, the ray will be absorbed.\n\nThe following image shows the ray's trajectory where N = 5 and X = 2.\n\nIt can be shown that the ray eventually comes back to the rifle and is absorbed, regardless of the values of N and X.\nFind the total length of the ray's trajectory.\n\nConstraints\n\n2≦N≦10^{12}\n\n1≦X≦N-1\n\nN and X are integers.\n\nPartial Points\n\n300 points will be awarded for passing the test set satisfying N≦1000.\n\nAnother 200 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 X\n\nOutput\n\nPrint the total length of the ray's trajectory.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n12\n\nRefer to the image in the Problem Statement section.\nThe total length of the trajectory is 2+3+2+2+1+1+1 = 12.", "split": "train", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 368, "cpu_time_ms": 9, "memory_kb": 512}, "variant": "low_resource"}